Click here to Skip to main content
16,012,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear One,

How to hide First column in GridView when using Command Name="edit" option.

Steps,
1. I have image button in GridView (FirstColumn).
2. When I edit the row, GridView FirstColumn is hide(How to Hide.?)
3. And After edit the row in GridView. All Columns, -include FirstColumn also display.

(reply as soon as Possible)
With Regards
By,
Mohan
Posted
Updated 23-Nov-11 20:46pm
v2

in the gridview rowcommand event put the following code.

foreach(gridviewrow grv in gridview.rows)
{
grv.column[0].visible=false;
}
 
Share this answer
 
hi,
when your are writing code for the edit data logic in that make that particular column visible to false.
ex:

if(CommandName="Edit")
{
gridview1.columns[0].visible=false;
else
gridview1.columns.visible=true;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900