P
Paul Owen
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?
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?