Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > can't find controls in datalist

Reply
Thread Tools

can't find controls in datalist

 
 
bill yeager
Guest
Posts: n/a
 
      02-23-2004
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_Selecte dIndexCh
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........
 
Reply With Quote
 
 
 
 
bill yeager
Guest
Posts: n/a
 
      02-24-2004
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.....
>-----Original Message-----
>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_Select edIndexC

h
>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........
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 0 02-10-2011 05:18 PM
Find.find does not find orphaned links? Wybo Dekker Ruby 1 11-15-2005 02:50 PM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM
unable do find dynamically created controls in a datalist Jun ASP .Net Web Controls 1 03-02-2004 03:05 PM
cannot find some controls in a datalist William Yeager ASP .Net Web Controls 2 02-26-2004 12:48 AM



Advertisments