473,394 Members | 1,094 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,394 software developers and data experts.

cannot gain access to controls

I have a datalist displaying parent information and a
datagrid presenting child information. The data is being
rendered just fine. The datagrid has template columns on
it that I cannot gain access to in my Itemcommand event
of the datalist.

When I press a button on the datalist, that brings me
into the Itemcommand event. I have access to the datagrid
control, but not any column controls on the datagrid. For
instance, my first column is a checkbox with an ID
of "Condition3" that I can't find. While debugging, I
have cycled thru the control items of the Datalist, and
cannot find any of the columns inside my datagrid (which
is inside my datalist).

Here is ItemTemplate portion of my Datalist with the HTML:
id=Name2 runat="server" Text='<%# DataBinder.Eval
(Container, "DataItem.Name")%>'>
id=LockNumber2 runat="server" Text='<%# DataBinder.Eval
(Container, "DataItem.Lock_Number")%>'>
id=LoanID2 runat="server" Text='<%# DataBinder.Eval
(Container, "DataItem.LoanID")%>' Visible="False">

<asp:Button id="btnWaive" runat="server"
Text="Waive All Conditions"

<asp:Button id="btnNoWaive" runat="server"
Text="Don't Waive Any Condtions"
id=Datagrid3 runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#999999"
BorderStyle="None" BorderWidth="1px" CellPadding="3"
GridLines="Vertical" datasource='<%#
("spMSSASPGetDistinctOutstandingConditionsInInvest orReview
StepspMSSASPGetOutstandingConditionsInInvestorRevi ewStep")

<SelectedItemStyle Font-Bold="True"
ForeColor="White" BackColor="#008A8C"></SelectedItemStyle>


<ItemStyle ForeColor="Black"

<HeaderStyle Font-Bold="True" ForeColor="White"

<FooterStyle ForeColor="Black"



<asp:checkbox runat="server"



<asp:BoundColumn DataField="Name" ReadOnly="True"

<asp:TemplateColumn HeaderText="LoanID">


<asp:label runat="server" id="LoanID3"
Text='<%# DataBinder.Eval(Container, "DataItem.LoanID") %




<asp:TemplateColumn HeaderText="Lock Number">


<asp:label runat="server"
id="LockNumber3" Text='<%# DataBinder.Eval
(Container, "DataItem.Lock_Number") %>'>




<asp:TemplateColumn HeaderText="Conditional Dtl


<asp:label runat="server"
id="ConditionDetailID3" Text='<%# DataBinder.Eval
(Container, "DataItem.ConditionDetailID") %>'>




<asp:BoundColumn DataField="ConditionID"

<asp:BoundColumn DataField="Description"

<asp:BoundColumn DataField="Comment"
ReadOnly="True" HeaderText="Comment"></asp:BoundColumn>

<PagerStyle HorizontalAlign="Center"
ForeColor="Black" BackColor="#999999"

Here is the code-behind where I'm trying to access the
Private Sub DataList2_ItemCommand(ByVal source As Object,
ByVal e As
System.Web.UI.WebControls.DataListCommandEventArgs )
Handles DataList2.ItemCommand

Dim dgChild As DataGrid = e.Item.FindControl
Dim chkCondition As CheckBox = e.Item.FindControl

In the first line above, I gain access to my datagird.
However, the next line, I don't have any access to my
columns within my datagrid.

How can I gain access to these column controls within my
Nov 18 '05 #1
0 1492

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

Similar topics

by: Ryan Park | last post by:
Hi, //SITUATION I got a panel control that hold a certain position on a form. Every controls or UIs are on this panel. At certain situation, I called dispose() method of this panel control...
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
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...
by: Keith Harris | last post by:
Hi, I am trying to create a DataGrid that has a hyperlink in column 1. Because of design reasons, the grid will auto generate columns and a repeater will not work. this output of the grid after...
by: aurora10 | last post by:
Can ant body help me to see how to get access to all controls of the Form for Sub in a different class. Thanks in advance. this is how it looks: ////////////////////////////////////////...
by: jason.teen | last post by:
Hi, I am having trouble importing a spreadsheet from Excel into an Access Database. I have noticed that even specifying the Cell Type of the Excel Data Cell, When I import it, still get...
by: Kees de Winter | last post by:
Hi, I dynamically create several user controls of the same type but then on postback I can not access the properties of the user controls. Why is that?? I get the "Object reference not set to an...
by: esteban40oz | last post by:
I have 9 buttons on my form. Button1, Button2, Button3, etc I want to create an array to access the value of each of them. Dim buttonArray() As Button = {Button1, Button2, Button3, Button4,...
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...
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...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.