"Wrong" parent for TextBox controls in composite control

Discussion in 'ASP .Net Building Controls' started by Jonas, Jan 30, 2005.

  1. Jonas

    Jonas Guest

    Hi!

    I have built two very similar composite controls that consists of a number
    of textboxes each.
    In the PreRender-event I have the following code which I use to dynamically
    set the TabIndex on the textboxes so that they get right in the flow of the
    parent page.

    Dim ctl As Control
    For Each ctl In CType(sender, cmPerson).Controls
    If TypeOf ctl Is TextBox Then
    CType(ctl, TextBox).TabIndex += _tabIndexControl
    End If
    Next

    One of my composite controls works just fine, when the parent page loads, I
    set the _tabIndexControl value via a property and the code above is
    executed. But on my other control, which has the same code, just different
    textboxes and layout, the code do not find the textboxes in the Controls
    collection.

    Any tips?

    TIA

    Jonas
     
    Jonas, Jan 30, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sleigh
    Replies:
    1
    Views:
    2,736
    sleigh
    Feb 12, 2004
  2. Chad
    Replies:
    0
    Views:
    252
  3. Nick Stansbury

    Composite Custom Control - Textbox Readonly Bug

    Nick Stansbury, Mar 20, 2006, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    441
    Nick Stansbury
    Mar 20, 2006
  4. Mike

    Composite vs non composite Controls

    Mike, Mar 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    290
    Sundararajan
    Mar 11, 2005
  5. ErwinP
    Replies:
    1
    Views:
    815
    ErwinP
    Aug 19, 2005
Loading...

Share This Page