Hi Pankaj,
I had a doubt in your question. Why dont u directly bind the grid with out that field (column). Y do u want that as a hidden entry in gridview.
[COLOR="Red"]Best Regards,
Phani Chavali[/COLOR]
kameswari
Junior Poster in Training
76 posts since Sep 2008
Reputation Points: 13
Solved Threads: 16
Hi Pankaj
I have written the same code in my row databound to hide that column and succesfully its hiding the column in the datagrid.
Here is the code.. you can check...
protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Cells[6].Visible = false;
}
in my code i have 7 columns... i just want to hide 7th column thats y i used above line.
I think in ur code you just check the number of columns first...
for example if your db have 5 columns and you want to hide 3rd column then you need to set as
e.Row.Cells[2].Visible=false;
//in row databound
Try and check with your number of columns...
Best Regards,
Phani Chavali.
kameswari
Junior Poster in Training
76 posts since Sep 2008
Reputation Points: 13
Solved Threads: 16