Hi,
Just started working on Telerik Controls and was using the RadGrid for a few days now. My Requirement was to show "extra information" in form of Labels and Images in the Grid after a row is collapsed by clicking the "+" or "arrow" icon. I found the following example helpful:
http://demos.telerik.com/aspnet/prometheus/Grid/Examples/Hierarchy/NestedViewTemplate/DefaultCS.aspx
but even if I copy the whole code and test it I cannot collapse an expanded row when I click nothing happens. I tried adding different controls in the NestedViewTemplate and found out that when I place a button there and click it (after expanding), the row collapses. What does that mean? What am I missing here?
Here is my code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="myExperiments._Default" %> |
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml" > |
<head runat="server"> |
<title>Experiment Page</title> |
</head> |
<body> |
<form id="myForm" runat="server" method="post"> |
<telerik:RadScriptManager ID="myScriptMngr" runat="server" EnableTheming="True"> |
</telerik:RadScriptManager> |
<telerik:RadAjaxManager ID="myRadAjaxManager" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="myRadGrid"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="myRadGrid" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<telerik:RadGrid ID="myRadGrid" runat="server" |
GridLines="None" Skin="Default2006" Width="500px" |
AutoGenerateColumns="False"> |
<MasterTableView AllowMultiColumnSorting="True"> |
<NestedViewTemplate> |
<p> |
<asp:DetailsView ID="myDetailsView" runat="server" Width="125px" ></asp:DetailsView> |
</p> |
</NestedViewTemplate> |
<RowIndicatorColumn Visible="False"> |
<HeaderStyle Width="20px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn Resizable="False"> |
<HeaderStyle Width="20px"></HeaderStyle> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False" |
DataField="Column1" HeaderText="Column 1" ShowSortIcon="False" |
UniqueName="column"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Column2" HeaderText="Column 2" |
UniqueName="column1"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Column3" HeaderText="Column3" |
UniqueName="column2"> |
</telerik:GridBoundColumn> |
</Columns> |
<EditFormSettings> |
<PopUpSettings ScrollBars="None"></PopUpSettings> |
</EditFormSettings> |
</MasterTableView> |
</telerik:RadGrid> |
</form> |
</body> |
</html> |