Finding Grid controls

  • Thread starter Thread starter Rick Spiewak
  • Start date Start date
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
 
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)
 
Back
Top