Hi,
I am programmaticall y binding gridview to a datatable. I want to hide 2 columns. I can be done by adding code in RowCreated event of gridview like
e.Row.Cells[0].Visible = false;
e.Row.Cells[5].Visible = false;
but after that paging is not working.
I tried another way by using gridview's column.Visible property
but its giving error
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
gvAllReports.Co lumns[1].Visible = false;
//gvAllReports.Co lumns[6].Visible = false;
Please guide me wat should I do
I am programmaticall y binding gridview to a datatable. I want to hide 2 columns. I can be done by adding code in RowCreated event of gridview like
e.Row.Cells[0].Visible = false;
e.Row.Cells[5].Visible = false;
but after that paging is not working.
I tried another way by using gridview's column.Visible property
but its giving error
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
gvAllReports.Co lumns[1].Visible = false;
//gvAllReports.Co lumns[6].Visible = false;
Please guide me wat should I do
Comment