Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > What does sender.Parent.Parent.Cells() reference? Frustrating...

Reply
Thread Tools

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

 
 
Roy
Guest
Posts: n/a
 
      02-11-2005
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>

 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      02-11-2005
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" <(E-Mail Removed)> 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>


 
Reply With Quote
 
 
 
 
Roy
Guest
Posts: n/a
 
      02-11-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET 2.0 ASPx Page does not load, but HTM does prabhupr@hotmail.com ASP .Net 1 02-08-2006 12:57 PM
Button OnClick does not fire on first postback, but does on second Janet Collins ASP .Net 0 01-13-2006 10:08 PM
Does the 2.0 Framework come out when Visual Studio .NET 2005 does? needin4mation@gmail.com ASP .Net 3 10-07-2005 12:55 AM
CS0234 Global does not exist ... but it genuinely does Bill Johnson ASP .Net 0 07-08-2005 06:34 PM
Does no one else think microsoft does a poor job? =?Utf-8?B?SmVyZW15IEx1bmRncmVu?= Wireless Networking 2 11-20-2004 12:17 AM



Advertisments