Hello,
I have a problem when firing an event on clicking a button in a grid. What I want to do is visualize a asp panel when clicking the button. My Rad Grid looks like this
and the code behind where the event fires is:
The problem is that the paneNodeView does not appear on postback. While debbuging everything looks fine. The paneNodeView.Visible is set to true, but it doesn't show. This worked well when using the MS Grid. Is there a difference in the RadGrid behaviour that I'm not aware of. Please fill me in.
Thanks,
Chris
I have a problem when firing an event on clicking a button in a grid. What I want to do is visualize a asp panel when clicking the button. My Rad Grid looks like this
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" Width="100%" Skin="Default2006" |
AllowSorting="True" PageSize="5" ShowStatusBar="true" ShowFooter="True" |
AllowPaging="True" GridLines="None" OnSortCommand="RadGrid1_SortCommand" |
OnPageIndexChanged="RadGrid1_PageIndexChanged" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCommand="RadGrid1_ItemCommand"> |
<PagerStyle Mode="NextPrevAndNumeric" /> |
<MasterTableView Width="100%" AutoGenerateColumns="false" ShowFooter="True" TableLayout="Auto"> |
<Columns> |
<telerik:GridTemplateColumn> |
<HeaderTemplate> |
<asp:LinkButton runat="server" ID="lbParentDir" CommandName="_parent" CommandArgument='<%# ViewState["parentId"] %>' Text="^..." /> |
</HeaderTemplate> |
<ItemTemplate> |
<asp:LinkButton runat="server" ID="lbTitle" CommandName="_children" Text='<%# Bind("title") %>' CommandArgument='<%# Bind("id") %>' /> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
(...) |
<telerik:GridTemplateColumn > |
<ItemTemplate> |
<asp:Button runat="server" CssClass="button" ID="btView" CommandArgument='<%# Bind("id") %>' CommandName="_view" Text="View"/> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
</Columns> |
</MasterTableView> |
</telerik:RadGrid> |
and the code behind where the event fires is:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e) |
{ |
if (e.CommandName == "_view") |
{ |
int id = Convert.ToInt32(e.CommandArgument); |
ViewState["id"] = id; |
panelNodeView.Visible = true; |
} |
} |
The problem is that the paneNodeView does not appear on postback. While debbuging everything looks fine. The paneNodeView.Visible is set to true, but it doesn't show. This worked well when using the MS Grid. Is there a difference in the RadGrid behaviour that I'm not aware of. Please fill me in.
Thanks,
Chris