Finding Grid controls

R

Rick Spiewak

I have been unable to find an elegant way to navigate to the controls in a
DataGrid in edit mode in order to get the changed values. I end up with a
lot of code like:

e.Item.Controls(5).Controls(0)

to get at a simple textbox, or:

e.Item.Controls(5).Controls(1)

if there is a multiline text box.

No ID's seem to end up on these controls, and I can't seem to find a
generalizable, clean way to access them. Any ideas?

Regards - Rick
 
G

Guest

I don't know if this is OK for you but I sometimes use template columns,
then I name the controls in design mode, and access them this way :

Dim txt as Textbox
txt=ctype(e.Item.fincontrols("txtName"), Textbox)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top