.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 29th, 2012, 02:34 PM
eeliason eeliason is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 2 eeliason User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #2  
Old October 29th, 2012, 03:06 PM
eeliason eeliason is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 2 eeliason User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 59 sec
Reputation Power: 0
Well, nothing like posting your first question and then figuring it out 5 minutes later!

I changed:

dslDataSource.DataBind()

to

dslRadioButtonList.DataBind()

Works much better.

E

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > RadioButtonList populated with xmlDataSource

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap