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
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.
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.
Re: How to remove or hide a Last rows of DataGrid in c#?
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;
Re: How to remove or hide a Last rows of DataGrid in c#?