467,915 Members | 1,751 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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

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
  • viewed: 1915
Share:
2 Replies
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
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.

Similar topics

reply views Thread by Ravi Tallury | last post: by
2 posts views Thread by Jacek Dziedzic | last post: by
19 posts views Thread by Charles Law | last post: by
1 post views Thread by Pierre | last post: by
1 post views Thread by Iain | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.