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

Getting contents of a PlaceHolder

P: n/a
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

May 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Nevermind...I figured it out. I wasn't properly using the event
handler. All is good now.

May 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.