can't find controls in datalist

B

bill yeager

I have a radiobuttonlist inside a datalist. I also have a
datagrid inside the datalist. The data and the controls
are rendering just fine. However, I need to find these
controls inside the datalist in order to programatically
perform some logic.

I have the following in my HTML which is inside the
ItemTemplate of the datalist:


<asp:RadioButtonList id="Radiobuttonlist" runat="server"
OnSelectedIndexChanged="rblRadioButtonList_SelectedIndexCh
anged"


RepeatDirection="Horizontal" AutoPostBack="True">


<asp:ListItem Value="1">Waive All
Conditions</asp:ListItem>


<asp:ListItem Value="0">Don't Waive Any
Conditions</asp:ListItem>


</asp:RadioButtonList>




I have an event set up which comes into the following
code-behind handler with the debugger after I click one
of the radio buttons.


Protected WithEvents RadioButtonListHdr As RadioButtonList

..

..

..

Public Sub rblRadioButtonList_SelectedIndexChanged(ByVal
sender As Object, ByVal e As System.EventArgs) Handles
RadioButtonListHdr.SelectedIndexChanged



'Capture the postback event from the
radiobuttonlist

Dim rblConditions As RadioButtonList = DirectCast
(FindControl("Radiobuttonlist"), RadioButtonList)

Dim dgChild As DataGrid = DirectCast(FindControl
("DataGrid3"), DataGrid)

Dim chkCondition As CheckBox = DirectCast
(FindControl("Condition3"), CheckBox)

Dim lblLockNumber As Label = DirectCast
(FindControl("LockNumber3"), Label)

Dim lblConditionDetailID As Label = DirectCast
(FindControl("ConditionDetailID3"), Label)

Dim lblLoanID As Label = DirectCast(FindControl
("LoanID3"), Label)




How come I cannot find any of the controls??? I'm very
stumped with this if someone can PLEASE help........
 
B

bill yeager

More simply put, how do I access child controls that
reside in the ItemTemplate section of the datalist???

There's GOT to be a way where I can access those controls
outside of the ItemDataBound event of the datalist.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top