How to find control dynamically added in the header

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default How to find control dynamically added in the header

    Pls any body tell me how can i find the control added in the following way :

    Protected Overrides Sub OnItemDataBound(ByVal e As
    System.Web.UI.WebControls.DataGridItemEventArgs)

    Dim i As Integer

    If e.Item.ItemType = WebControls.ListItemType.Header Then

    For i = 0 To e.Item.Cells.Count - 1

    e.Item.Cells(i).Text += "<BR><Input type=text class=FilterTextBox
    runat=server id='txtcontrol" & i & "' ></input>"

    Next

    End If

    End Sub

    Now Tell me how can i find the txtcontrol(1...n) added in the header of each
    column in code behind.






    Amit Chudasama Guest

  2. Similar Questions and Discussions

    1. Managing ViewState of a dynamically created Custom Composite Server Control -(where the original is also dynamically created)
      Ok here's my scenario. I have a Custom Composite Server Control (CCSC) consisting of a TextBox, Button & Panel. (And some other code - which I...
    2. Handle Event of Dynamically Added User Control
      Hi There! How to handle the events of a dynamically added user control? e.g. I have following code... Dim myUserControl as Object =...
    3. Add header text dynamically in a datagrid with templatecolumns?
      Hello, I have a dg, which uses templatecolumns. Now I would like to assing the header text of these columns, with the names I have in my...
    4. Determine if custom control is being added dynamically?
      Hi, Is it possible to determine in your custom control code if it is being added to the control hierarchy through page parsing or being added...
    5. Dynamically Added TextBoxes
      Is there anyway to get the value of a dynamically added textbox that was added after OnInit in Page_Load on Postback? Page_Load Dim tb As...
  3. #2

    Default Re: How to find control dynamically added in the header

    Hi Amit,

    I thinkyou can try

    e.Item.FindControlByID [ or name] and mention the TextBox ID [ or name]

    Thanks
    Raghavendra

    "Amit Chudasama" <amitc@vmfsoft.com> wrote in message
    news:OgLA$DmiEHA.3476@tk2msftngp13.phx.gbl...
    > Pls any body tell me how can i find the control added in the following way
    :
    >
    > Protected Overrides Sub OnItemDataBound(ByVal e As
    > System.Web.UI.WebControls.DataGridItemEventArgs)
    >
    > Dim i As Integer
    >
    > If e.Item.ItemType = WebControls.ListItemType.Header Then
    >
    > For i = 0 To e.Item.Cells.Count - 1
    >
    > e.Item.Cells(i).Text += "<BR><Input type=text class=FilterTextBox
    > runat=server id='txtcontrol" & i & "' ></input>"
    >
    > Next
    >
    > End If
    >
    > End Sub
    >
    > Now Tell me how can i find the txtcontrol(1...n) added in the header of
    each
    > column in code behind.
    >
    >
    >
    >
    >
    >

    Raghavendra T V 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