Binding problem with DropDownList? (repost)

Discussion in 'ASP .Net Datagrid Control' started by Paul Owen, Feb 10, 2005.

  1. Paul Owen

    Paul Owen Guest

    I have been pulling my hair out (what is left of it) for a few days trying to
    figure out what is wrong with this..

    I have a repeater control that renders a number of controls bound to a
    datasource. Within this repeater, there are a number of dropdownlists which
    have their datasource set to different picklists which need to be sync'ed to
    the main source. This never happens however I have tried it. First I had a
    problem identifying the control but I think I solved that. Now when I debug,
    I find that the items in the ddl is
    0. I have tried to databind the control, but I get a stack overflow. At the
    moment I am calling:

    OnDataBound='<%#GetTypeIndex((Container.FindControl("DIrectorate_ID")),
    Container.DataItem("directorate name"))%>'

    The code called is the following:

    Public Function GetTypeIndex(ByVal c As Control, ByVal Type_Name As String)
    As Integer
    Dim lb As DropDownList
    lb = c
    'Response.Write(c.ID)
    ' Response.Write(Type_Name)
    ' Response.Write(lb.Items.Count)
    ' Response.End()


    Dim li As ListItem
    Dim index As Integer

    For Each li In lb.Items
    If li.Text = Type_Name Then
    li.Selected = True
    index = lb.SelectedIndex
    End If
    Next

    Return index

    End Function

    Am I going completely mad on this?
     
    Paul Owen, Feb 10, 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. Tom Jorgenson
    Replies:
    3
    Views:
    7,031
  2. =?Utf-8?B?UkFNQURV?=
    Replies:
    0
    Views:
    612
    =?Utf-8?B?UkFNQURV?=
    May 16, 2004
  3. =?Utf-8?B?UkFNQURV?=
    Replies:
    2
    Views:
    8,372
    Ashish M Bhonkiya
    May 16, 2004
  4. WebBuilder451
    Replies:
    0
    Views:
    1,961
    WebBuilder451
    Nov 7, 2008
  5. Wayne  Wengert

    Problem Binding DS to DropDownList

    Wayne Wengert, Jan 8, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    303
    Saravana
    Jan 10, 2005
Loading...

Share This Page