Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends

is there any way to hide particular button in grid view ?
i have a command button in grid view for save the record, if user clicks that button then record will be saved and i have to hide / disable that button from grid view
Posted
Updated 20-Nov-13 22:21pm
v2

C#
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
   {


C#
if (e.Row.RowType == DataControlRowType.DataRow)
          {

              Button btn_hide= (Button)e.Row.FindControl("btnedit");


//btn_edit is id Of the Button which you want to hide in GridView

//this your control which you want to Get.. like button,label.. anything you want

btn_hide.visible=false

}
 
Share this answer
 
Comments
Prasad gavande 21-Nov-13 5:56am    
Thank you very much
 
Share this answer
 
Comments
Prasad gavande 21-Nov-13 4:30am    
thanks SnehasishN
[no name] 21-Nov-13 4:34am    
accept the answer if it's helpful..
Prasad gavande 21-Nov-13 4:47am    
actually it will disable all the column , if i am correct .. but i want to disable that record only ..

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