473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

can't find controls in datalist

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........
Nov 18 '05 #1
1 3605
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 adatagrid 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 hanged"
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........
.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bill yeager | last post by:
I have a datagrid control within a datalist control. When I try and do a "Find" on the control, the object comes back with nothing and then my pgm crashes. I am 100% sure that my datagird inside...
1
by: bill yeager | last post by:
I did some more debugging and found the following: 1) I placed the following code in the button event just to see if I could cycle thru the datagrid control collection: <code> Dim strhello As...
2
by: Chris Fink | last post by:
This should be relatively simple but I am unable to find an asp:button tag in a datalist footer. I have tried it numerous ways including the FindControl method from the many events that the...
10
by: Nathan Sokalski | last post by:
I have a DataList control with an EditTemplate. Three of the controls in this template include a Calendar, a Button with CommandName="update", and a Button with CommandName="cancel". Whenever I...
5
by: Just Me | last post by:
Given a button name Btn_5 and Index=5 I want to do something like dim zz as string = Btn_??Index??.Text or given an array of buttons, do:
3
by: Jon Paal | last post by:
how do I load controls to the templates for the DataList control. <asp:datalist id="dl1" runat="server" > <ItemTemplate> " how to load control(s) here ????" </ItemTemplate>...
0
by: HP | last post by:
Hi there I have a datalist control with some bound controls in its Item Template and a gridview bound to one of those fields (residing also in Item Template). I've found out that when I click...
1
by: Salim | last post by:
Hi, I'm trying to get UniqueID of a linkbutton. I have 2 web user controls. And a master page. In fisrst web user control there is a datalist. In datalist ItemCreated event, I try to find...
0
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I am having this problem. I have this datalist and whenever I expand the datalist by the plus button, it overlaps other controls on my web page and sometimes these controls come...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.