Finding Grid controls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rick Spiewak

    #1

    Finding Grid controls

    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


  • Guest's Avatar

    #2
    Re: Finding Grid controls

    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.Ite m.fincontrols(" txtName"), Textbox)

    "Rick Spiewak" <rickspiewak@mi ndspring.com> wrote in message
    news:uSsu0KjUDH A.2112@TK2MSFTN GP10.phx.gbl...[color=blue]
    > 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
    >
    >[/color]


    Comment

    Working...