Getting contents of a PlaceHolder

I

IndyChris

I am attempting to add a drill down datagrid to my webpage so the user
will not have to leave the page to get further information on a row.

There are 12 other columns before this column.
<asp:TemplateColumn>
<ItemStyle Width="1" />
<ItemTemplate>
<asp:placeHolder ID="ExpandedContent" Visible="false" Runat="server">
</td></tr>
<tr>
<new datagrid goes here>

</td> </tr> </asp:placeHolder> </ItemTemplate> </asp:TemplateColumn>

Here's what I'm trying to do in the C# code. This should trigger when
the user clicks the +/- sign at the beginning of the row.
protected void Grid_ItemCommand( Object sender, CommandEventArgs e )
{
if ( e.CommandName == "Expand" )
{
ExpandedContent =
(PlaceHolder)this.ConfGrid.Columns[this.ConfGrid.Columns.Count - 1].
// PlaceHolder ExpandedContent =
(PlaceHolder)confGrid.Item.Cells[confGrid.Columns.Count -
1].FindControl("ExpandedContent");
ExpandedContent.Visible = !(ExpandedContent.Visible);
// ImageButton btnExpand =
(ImageButton)ConfGrid.Item.Cells[0].FindControl("btnExpand");
if (btnExpand.ImageUrl == "~/Images/Plus.gif")
{
btnExpand.ImageUrl = "~/Images/Minus.gif";
}
else
{
btnExpand.ImageUrl = "~/Images/Plus.gif";
}
}

I can't get the ExpandedContent to have a value. How to I get the
contents of the PlaceHolder into my variable.

Thanks
 
I

IndyChris

Nevermind...I figured it out. I wasn't properly using the event
handler. All is good now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top