
October 29th, 2012, 02:34 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 2
Time spent in forums: 39 m 59 sec
Reputation Power: 0
|
|
|
RadioButtonList populated with xmlDataSource
Hi. This is my first post and also quite new to .NET.
I have a radioButtonList which is populated with an xmlDataSource. The data source is variable. I set it in my codebehind. My trouble is that I then need to know the Items.Count of the RadioButtonList and it is showing as Zero. I need to know the count because I loop through the radioButtonList to enable or disable the buttons.
Here is the radioButtonList:
PHP Code:
<asp:RadioButtonList ID="dslRadioButtonList" runat="server" RepeatDirection="Horizontal" CssClass="hide-rb" AutoPostBack="True">
</asp:RadioButtonList>
Here is the codebehind setting the xmlDataSource:
PHP Code:
Private Sub setDslXml(site As String)
dslRadioButtonList.CssClass = "show-rb"
If site = "0003" Then
With dslRadioButtonList
.DataSourceID = "dslDataSource"
.DataTextField = "text"
.DataValueField = "value"
End With
dslDataSource.DataFile = "~/dslmi.xml"
dslDataSource.DataBind()
Else
With dslRadioButtonList
.DataSourceID = "dslDataSource"
.DataTextField = "text"
.DataValueField = "value"
End With
dslDataSource.DataFile = "~/dsl2.xml"
dslDataSource.DataBind()
End If
Dim countbuttons = dslRadioButtonList.Items.Count
End Sub
I appreciate any help!
E
|