How to disable a control in command field control in gridview

后端 未结 5 448
刺人心
刺人心 2021-01-07 09:07

how to find a command field control in the gridview.

in a method not in the row data bound.

so far i have used this coding but i cant find the control.

5条回答
  •  伪装坚强ぢ
    2021-01-07 09:49

    You miss to specify the row

    Something like :

    ImageButton edit = (ImageButton)EmployeeDetails.Rows[0].Cells[0].FindControl("Image");
    edit.Enabled = false;
    

    If you want to disable the column that contains the imageButton , you can do :

    EmployeeDetails.Columns[0].Visible = false;
    

提交回复
热议问题