CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    114

    How to remove or hide a Last rows of DataGrid in c#?

    Hi gurus,

    I think its stupid question for u people.. The problem here is by default last row will added in DataGrid like

    > Col1 Col2 Col3
    10 20 30
    * null null null

    Please the output which is shown above. and what i want is i want to remove the last(that is auto generated one.. by default it will come)..

    Thanks in advance

    REgards
    Saravanan

  2. #2
    Join Date
    Nov 2004
    Posts
    13

    Re: How to remove or hide a Last rows of DataGrid in c#?

    you can set the property of grid 'Read Only' then it will not show the last row of the gird.

  3. #3
    Join Date
    May 2003
    Location
    Germany
    Posts
    936

    Re: How to remove or hide a Last rows of DataGrid in c#?

    Or you have to bind a collection to the datagrid instead of a dataset.
    Useful or not? Rate my posting. Thanks.

  4. #4
    Join Date
    Jul 2002
    Location
    India
    Posts
    505

    Re: How to remove or hide a Last rows of DataGrid in c#?


  5. #5
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: How to remove or hide a Last rows of DataGrid in c#?

    I am assuming you are binding the DataGrid to a DataTable. If this is so, then you should use a DataView in the following way:
    Code:
    DataView dv = new DataView(yourDataTable);
    dv.AllowNew = false;
    yourGrid.DataSource = dv;

  6. #6
    Join Date
    Sep 2005
    Posts
    114

    Re: How to remove or hide a Last rows of DataGrid in c#?

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured