This is a migrated thread and some comments may be shown as answers.

Need help with Hierachy grid expanding to nested view data

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 20 Nov 2012, 06:42 PM

Hi,

I am trying to get the telerik hierachy grid to work. I got the grid row to show up when the grid is loaded. When I click on the arrow to expand the first row, the row expands. I see the two tab page and the first tab grid data is loaded. However when I click on the 2nd tab, nothing happens. when I clicked the 2nd or 3rd row, it is not expand. It just display a blank line.

 Any help is greatly appreciated.

JC

<

 

 

telerik:RadGrid ID="rgdSubmitterMatrix" runat="server" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="odsSubmitterNotice" GridLines="None" OnItemDataBound="rgdSubmitterMatrix_ItemDataBound" OnPreRender="Page_Load" ShowGroupPanel="True" Skin="Outlook" >

<PagerStyle Mode="NumericPages" />

 

<mastertableview allowmulticolumnsorting="True" datasourceid="odsSubmitterNotice" GroupLoadMode="server">

 <NestedViewTemplate>

<asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">

<telerik:RadTabStrip runat="server" ID="rtsSubmitterMatrix" MultiPageID="rmpSubmitterMatrix" SelectedIndex="0">

<Tabs>

<telerik:RadTab runat="server" Text="Submitter Response" PageViewID="rpvSubmitterResponse">

</telerik:RadTab>

<telerik:RadTab runat="server" Text="Determination Notice" PageViewID="rpvDeterminationNotice">

</telerik:RadTab>

</Tabs>

</telerik:RadTabStrip>

<telerik:RadMultiPage runat="server" ID="rmpSubmitterNotice" SelectedIndex="0" RenderSelectedPageOnly="false">

<telerik:RadPageView runat="server" ID="rpvSubmitterResponse">

<asp:Label ID="lblSubmitterResponse" Font-Bold="true" Font-Italic="true" Text="Submitter Response"

Visible="false" runat="server"></asp:Label>

<telerik:RadGrid runat="server" ID="rgdSubmitterNotice" DataSourceID="odsSubmitterResponse" ShowFooter="true"

AllowSorting="true" EnableLinqExpressions="false">

<MasterTableView ShowHeader="true" AutoGenerateColumns="false" AllowPaging="true"

DataKeyNames="FAC_RECORD_UID" PageSize="10" HierarchyLoadMode="ServerOnDemand">

<Columns>

<telerik:GridBoundColumn SortExpression="FAC_RECORD_UID" HeaderText="OASIS #" HeaderButtonType="TextButton" DataField="FAC_RECORD_UID" UniqueName="FAC_RECORD_UID">

</telerik:GridBoundColumn>

<telerik:GridDateTimeColumn SortExpression="DATE_RECEIVED" HeaderText="Received Date" HeaderButtonType="TextButton"

DataField="DATE_RECEIVED" UniqueName="DATE_RECEIVED" DataFormatString="{0:MM/dd/yyyy}">

</telerik:GridDateTimeColumn>

<telerik:GridBoundColumn SortExpression="RESPONSE_VALUE" HeaderText="Response" HeaderButtonType="TextButton" DataField="RESPONSE_VALUE" UniqueName="RESPONSE_VALUE">

</telerik:GridBoundColumn>

</Columns>

</MasterTableView>

</telerik:RadGrid>

</telerik:RadPageView>

<telerik:RadPageView runat="server" ID="rpvDeterminationNotice">

<asp:Label ID="lblDeterminationNotice" Font-Bold="true" Font-Italic="true" Text="Determination Notice"

Visible="false" runat="server"></asp:Label>

<telerik:RadGrid runat="server" ID="rgdDeterminationNotice" DataSourceID="odsDeterminationNotice" ShowFooter="true"

AllowSorting="true" EnableLinqExpressions="false">

<MasterTableView ShowHeader="true" AutoGenerateColumns="false" AllowPaging="true"

DataKeyNames="FAC_RECORD_UID" PageSize="10" HierarchyLoadMode="ServerOnDemand">

<Columns>

<telerik:GridBoundColumn SortExpression="FAC_RECORD_UID" HeaderText="OASIS #" HeaderButtonType="TextButton" DataField="FAC_RECORD_UID" UniqueName="FAC_RECORD_UID">

</telerik:GridBoundColumn>

<telerik:GridDateTimeColumn SortExpression="DATE_SENT" HeaderText="Date Sent" HeaderButtonType="TextButton"

DataField="DATE_SENT" UniqueName="DATE_SENT" DataFormatString="{0:MM/dd/yyyy}">

</telerik:GridDateTimeColumn>

<telerik:GridDateTimeColumn SortExpression="DOCUMENT_RELEASE_DATE" HeaderText="Document Release Date" HeaderButtonType="TextButton"

DataField="DOCUMENT_RELEASE_DATE" UniqueName="DOCUMENT_RELEASE_DATE" DataFormatString="{0:MM/dd/yyyy}">

</telerik:GridDateTimeColumn>

<telerik:GridBoundColumn SortExpression="REMARKS" HeaderText="Remarks" HeaderButtonType="TextButton" DataField="REMARKS" UniqueName="REMARKS">

</telerik:GridBoundColumn>

</Columns>

</MasterTableView>

</telerik:RadGrid>

</telerik:RadPageView>

</telerik:RadMultiPage>

</asp:Panel>

</NestedViewTemplate>

<Columns>

<telerik:GridBoundColumn SortExpression="OASIS_NUMBER" HeaderText="Submitter Notice OASIS #" HeaderButtonType="TextButton" DataField="OASIS_NUMBER" UniqueName="OASIS_NUMBER">

</telerik:GridBoundColumn>

<telerik:GridDateTimeColumn SortExpression="DATE_SENT" HeaderText="Submitter Notice Date Sent" HeaderButtonType="TextButton" DataField="DATE_SENT" UniqueName="DATE_SENT" DataFormatString="{0:MM/dd/yyyy}">

</telerik:GridDateTimeColumn>

<telerik:GridDateTimeColumn SortExpression="DATE_DUE" HeaderText="Submitter Notice Date Due" HeaderButtonType="TextButton" DataField="DATE_DUE" UniqueName="DATE_DUE" DataFormatString="{0:MM/dd/yyyy}">

</telerik:GridDateTimeColumn>

</Columns>

</mastertableview>

<clientsettings allowdragtogroup="False">

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

</clientsettings>

<headercontextmenu enableautoscroll="True">

</headercontextmenu>

</telerik:RadGrid>

 




public

partial class SubmitterMatrix : System.Web.UI.UserControl

 {

 

 

protected void Page_Load(object sender, EventArgs e)

{

if (!Page.IsPostBack)

 {

 

 

if (rgdSubmitterMatrix.MasterTableView.Items.Count > 0)

 

{

rgdSubmitterMatrix.MasterTableView.Items[0].Expanded =

 

true;

 

rgdSubmitterMatrix.MasterTableView.Items[0].ChildItem.FindControl(

 

"InnerContainer").Visible = true;

 

}

 

}

 

 

protected void rgdSubmitterMatrix_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)

 {

 }

 

 

protected void rgdSubmitterMatrix_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

 {

}

 

 

protected void rgdSubmitterMatrix_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

 {

if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item is GridDataItem)

{

((GridDataItem)e.Item).ChildItem.FindControl("InnerContainer").Visible = !e.Item.Expanded;

}

}

 

 

protected void rgdSubmitterMatrix_ItemCreated(object sender, GridItemEventArgs e)

{

if (e.Item is GridNestedViewItem)

{

e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;

}

}

 

 

protected void odsSubmitterNotice_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)

{

}

 

 

protected void odsSubmitterNotice_Selected(object sender, ObjectDataSourceStatusEventArgs e)

{

}

 

 

protected void odsSubmitterResponse_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)

{

}

 

 

protected void odsDeterminationNotice_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)

{

}


1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 23 Nov 2012, 09:30 AM
Hello John,

Please check out the following demos:
  - Standard Hierarchy
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/declarativerelations/defaultcs.aspx
  - Programmatic Hierarchy
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/autogeneratedhierarchy/defaultcs.aspx
  - Hierarchy with Templates
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx
  - Template relations
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplatedeclarativerelations/defaultcs.aspx
  - Master / Detail grids
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx

and choose the approach most suitable to your specific requirements.

I hope this will prove helpful.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or