R
Roy
What is the best way to approach this problem? I have a datagrid with
an imagebutton. When one clicks the imagebutton it triggers an onClick
sub which makes column 9 (a user control) visible or invisible. Only
problem is when one clicks the imagebutton on a specific row, I want
*only* that row's column 9 to appear or disappear.
********My imagebutton*******************
<asp:TemplateColumn><ItemTemplate>
<asp:ImageButton id="imagebutton1" runat="server"
AlternateText="ImageButton 1" ImageAlign="left"
ImageUrl="arrow_right.gif" OnClick="ImageButton_Click"/>
</ItemTemplate></asp:TemplateColumn>
*********My user control (row 9)*********
<asp:TemplateColumn Visible = "false">
<ItemTemplate><tr><td colspan="9">
<UC_Grid:Nested id="FVDGrid" x=<%# container.dataitem("vown")%> y=<%#
container.dataitem("van_no")%> runat="server" />
</td></tr></ItemTemplate>
</asp:TemplateColumn>
**********My click sub**********
Public Sub ImageButton_Click(sender As Object, e As
ImageClickEventArgs)
If MR_Grid.Columns(9).Visible = False Then
MR_Grid.Columns(9).Visible = True
Else
MR_Grid.Columns(9).Visible = False
End If
End Sub
I tried modifying the sub with the individual cell as seen below, but
that bombs out with your average "'Item' is not a member of
'System.Web.UI.ImageClickEventArgs'" error. Anyone have any clues on
how I can implement this functionality?
Public Sub ImageButton_Click(sender As Object, e As
ImageClickEventArgs)
If e.Item.Cells(9).Visible = False Then
e.Item.Cells(9).Visible = True
Else
e.Item.Cells(9).Visible = False
End If
End Sub
an imagebutton. When one clicks the imagebutton it triggers an onClick
sub which makes column 9 (a user control) visible or invisible. Only
problem is when one clicks the imagebutton on a specific row, I want
*only* that row's column 9 to appear or disappear.
********My imagebutton*******************
<asp:TemplateColumn><ItemTemplate>
<asp:ImageButton id="imagebutton1" runat="server"
AlternateText="ImageButton 1" ImageAlign="left"
ImageUrl="arrow_right.gif" OnClick="ImageButton_Click"/>
</ItemTemplate></asp:TemplateColumn>
*********My user control (row 9)*********
<asp:TemplateColumn Visible = "false">
<ItemTemplate><tr><td colspan="9">
<UC_Grid:Nested id="FVDGrid" x=<%# container.dataitem("vown")%> y=<%#
container.dataitem("van_no")%> runat="server" />
</td></tr></ItemTemplate>
</asp:TemplateColumn>
**********My click sub**********
Public Sub ImageButton_Click(sender As Object, e As
ImageClickEventArgs)
If MR_Grid.Columns(9).Visible = False Then
MR_Grid.Columns(9).Visible = True
Else
MR_Grid.Columns(9).Visible = False
End If
End Sub
I tried modifying the sub with the individual cell as seen below, but
that bombs out with your average "'Item' is not a member of
'System.Web.UI.ImageClickEventArgs'" error. Anyone have any clues on
how I can implement this functionality?
Public Sub ImageButton_Click(sender As Object, e As
ImageClickEventArgs)
If e.Item.Cells(9).Visible = False Then
e.Item.Cells(9).Visible = True
Else
e.Item.Cells(9).Visible = False
End If
End Sub