469,645 Members | 1,941 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

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 1334

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by bill yeager | last post: by
2 posts views Thread by Kees de Winter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.