I need to control Controls in a Grid View Template
i need to enable and disable them when i want
e.g: when i click a button template controls will be enabled, and disabled after updating them
Printable View
I need to control Controls in a Grid View Template
i need to enable and disable them when i want
e.g: when i click a button template controls will be enabled, and disabled after updating them
The GridView has a RowDataBound event. This event gets fired for each row as it's being bound to the database. You can do an e.Item.FindControl() in this event to get a hold of the control in question, cast it to the type of the control, then enable or disable it. You can do this, of course, depending on whatever criteria you have.
You mentioned a button in the template controls, so you may have to handle the RowCommand event instead. This gets fired for the button (or any control) in any row in the GridView. You can still use e.Item.FindControl or e.FindControl and enable or disable it.
problem solved
vb Code:
dim X as system.web.ui.webcontrols.textbox for each item as gridviewrow in gridview1.rows X=item.findcontrol("Y") X.enabled=true Next