Finding Grid controls

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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


    Rick Spiewak Guest

  2. Similar Questions and Discussions

    1. Finding the values of Dynamic Controls in a Composite Control
      Hi Everyone, I've created a Custom Composite Control that creates a number of children -- Hidden Input Fields, to be exact. Because my control...
    2. A solution to finding controls in datagrid footer...
      Hi all, I saw a lots of developers posting question on finding controls in datagrid footer... I have experimenting differents solution and find...
    3. Controls in certain cells in a grid
      I have a grid with several fields an many records. For fields that have a large amount of text in them, I want to show a button that the user can...
    4. Using controls in Grid
      Hi, I am new to Grids with the problem to create runtime created grids that has custom controls on it Can someone please tell me how I apply server...
    5. Problem finding datagrid in Page.controls collection
      You can find datagrid in page by refering the form. Gatagrid is a child control of Form. Here is the code ----------------- Dim ctl As New...
  3. #2

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

    "Rick Spiewak" <rickspiewak@mindspring.com> wrote in message
    news:uSsu0KjUDHA.2112@TK2MSFTNGP10.phx.gbl...
    > 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139