|
-
Sep 7th, 2007, 07:47 AM
#1
Thread Starter
Junior Member
[RESOLVED][2005] Template in Grid 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
Last edited by Milouvr3; Sep 13th, 2007 at 08:11 AM.
-
Sep 8th, 2007, 10:46 AM
#2
Re: [2005] Template in Grid View
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.
-
Sep 13th, 2007, 08:09 AM
#3
Thread Starter
Junior Member
Re: [2005] Template in Grid View
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|