By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,143 Members | 1,855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,143 IT Pros & Developers. It's quick & easy.

What does sender.Parent.Parent.Cells() reference? Frustrating...

P: n/a
Roy
Ok, this is incredibly annoying. Below I have an ImageButton and it's
ImageButton_Click sub. See the 6 response.writes? The output for them
is displayed below in asterisks. Question: What part of the
TemplateColumn below does sender.parent.parent.Cells(9) reference???
IOW, what tag does it reference? The templatecolumn is the 9th field in
the datagrid yet no matter what I do, whatever
"sender.parent.parent.Cells(9)" is referencing, I do not have access
to. Help!

*System.Web.UI.WebControls.TableCell*
*blank, nothing displayed*
*System.Web.UI.WebControls.DataGridItem*
*blank, nothing displayed*
*System.Web.UI.WebControls.TableCell*
*blank, nothing displayed*
Public Sub ImageButton_Click(sender As Object, e As
ImageClickEventArgs)
response.write(sender.parent)
response.write(sender.parent.id)
response.write(sender.parent.parent)
response.write(sender.parent.parent.id)
response.write(sender.parent.parent.Cells(9))
response.write(sender.parent.parent.Cells(9).id) <<<<---REFERENCE?
End Sub

**********0th Column in datagrid*****
<asp:TemplateColumn><ItemTemplate>
<asp:ImageButton id="imagebutton1" runat="server" AlternateText="Click
to Expand Record"
ImageAlign="left" ImageUrl="arrow_right.gif"
OnClick="ImageButton_Click"/>
</ItemTemplate></asp:TemplateColumn>

*********9th column in datagrid******
<asp:TemplateColumn><ItemTemplate>
<tr id="tr"><td colspan="9" id="td">
<UC_Grid:Nested id="FVDGrid" x=<%# container.dataitem("vown")%> y=<%#
container.dataitem("van_no")%> runat="server" />
</td></tr>
</ItemTemplate></asp:TemplateColumn>

Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
It references the TableCell that will contain the controls for the
template.

Are you trying to locate a specific, named control like the nested
grid? If so, I believe FindControl a bit less painful.

See:
http://odetocode.com/Articles/116.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 11 Feb 2005 11:24:18 -0800, "Roy" <ro**********@gmail.com> wrote:
Ok, this is incredibly annoying. Below I have an ImageButton and it's
ImageButton_Click sub. See the 6 response.writes? The output for them
is displayed below in asterisks. Question: What part of the
TemplateColumn below does sender.parent.parent.Cells(9) reference???
IOW, what tag does it reference? The templatecolumn is the 9th field in
the datagrid yet no matter what I do, whatever
"sender.parent.parent.Cells(9)" is referencing, I do not have access
to. Help!

*System.Web.UI.WebControls.TableCell*
*blank, nothing displayed*
*System.Web.UI.WebControls.DataGridItem*
*blank, nothing displayed*
*System.Web.UI.WebControls.TableCell*
*blank, nothing displayed*
Public Sub ImageButton_Click(sender As Object, e As
ImageClickEventArgs)
response.write(sender.parent)
response.write(sender.parent.id)
response.write(sender.parent.parent)
response.write(sender.parent.parent.id)
response.write(sender.parent.parent.Cells(9))
response.write(sender.parent.parent.Cells(9).id ) <<<<---REFERENCE?
End Sub

**********0th Column in datagrid*****
<asp:TemplateColumn><ItemTemplate>
<asp:ImageButton id="imagebutton1" runat="server" AlternateText="Click
to Expand Record"
ImageAlign="left" ImageUrl="arrow_right.gif"
OnClick="ImageButton_Click"/>
</ItemTemplate></asp:TemplateColumn>

*********9th column in datagrid******
<asp:TemplateColumn><ItemTemplate>
<tr id="tr"><td colspan="9" id="td">
<UC_Grid:Nested id="FVDGrid" x=<%# container.dataitem("vown")%> y=<%#
container.dataitem("van_no")%> runat="server" />
</td></tr>
</ItemTemplate></asp:TemplateColumn>


Nov 19 '05 #2

P: n/a
Roy
Sorta... I'm trying to make the 9th column visible/invisible when
someone clicks the imagebutton. I've been trying to get FindControl to
work for a day (see link). It doesn't. I give up. I'm quitting
programming and becoming a sheepherder.
http://groups-beta.google.com/group/...ea1978756f3f6e

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.