Velocity Reviews

Velocity Reviews (
-   ASP .Net Datagrid Control (
-   -   Binding problem with DropDownList? (repost) (

Paul Owen 02-10-2005 02:49 PM

Binding problem with DropDownList? (repost)
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.FindContro l("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(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

Return index

End Function

Am I going completely mad on this?

All times are GMT. The time now is 12:49 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.