Hi All,
I developed a webheirarchy grid using 2009.2 version which is a self referenced Heirarchy grid....but i want to display another child band based on the last grand child result..i did the coding upto self reference child bands...below shows the code
.aspx
<ig:WebHierarchicalDataGrid ID="whdg_process_repository" runat="server" AutoGenerateBands="false"
AutoGenerateColumns="false" EnableViewState="false" Font-Size="Smaller" InitialDataBindDepth="-1"
InitialExpandDepth="0" OnInitializeRow="whdg_process_repository_OnInitializeRow"
Visible="true" Width="100%">
<ExpandCollapseAnimation SlideCloseDirection="Auto" SlideCloseDuration="300" SlideOpenDirection="Auto"
SlideOpenDuration="300" />
<Columns>
<ig:TemplateDataField Key="Id">
<ItemTemplate>
<asp:HiddenField ID="HiddenFieldComplianceRep" runat="server" Value='<%# Eval("Id") %>' />
</ItemTemplate>
</ig:TemplateDataField>
<ig:TemplateDataField Key="FrameWorkName">
<Header Text="FrameWorkName" />
<asp:Label ID="Label_FrameWorkName" runat="server" Text='<%# Eval("FrameWorkName") %>'
Width="250px"></asp:Label>
<ig:TemplateDataField Key="OpenFindings">
<Header Text="OpenFindings" />
<asp:Label ID="Label_OpenFindings" runat="server" Text="" Width="250px"></asp:Label>
<ig:TemplateDataField Key="ClosedFindings">
<Header Text="ClosedFindings" />
<asp:Label ID="Label_ClosedFindings" runat="server" Text="" Width="250px"></asp:Label>
<ig:TemplateDataField Key="Rating">
<Header Text="Rating" />
<asp:Label ID="Label_Rating" runat="server" Text="" Width="250px"></asp:Label>
<ig:TemplateDataField Key="AddControl">
<Header Text="Add Control" />
<asp:Button runat="server" ID="Button_AddControl" CssClass="submitSmallButton" Text="Add"
ToolTip="Add Control" CausesValidation="false"></asp:Button>
</Columns>
<Bands>
<ig:Band AutoGenerateColumns="false" IsSelfReference="true">
<asp:HiddenField ID="HiddenFieldComplianceRepChild" runat="server" Value='<%# Eval("Id") %>' />
<ig:BoundDataField Header-Text="Type" />
<%-- <ig:BoundDataField CssClass="description" DataFieldName="Description"
Header-Text="Description" Key="description" Width="200px" />
<ig:BoundDataField DataFieldName="Type" Header-Text="Type" Key="type" />
<ig:BoundDataField CssClass="exported" DataFieldName="Exported" Header-Text="" Key="exported" />--%>
</ig:Band>
</Bands>
</ig:WebHierarchicalDataGrid>
.aspx.cs
public void loadDatatoWHDGridProcessRep()
{
DataSet ds = new DataSet();
ds = new ComplianceReportBO().GetFrameWorkNames();
if (ds.Tables[0].Rows.Count > 0)
DataRelation rel = new DataRelation("ComplianceRep", ds.Tables["ComplianceRep"].Columns["Id"], ds.Tables["ComplianceRep"].Columns["parent_id"]);
ds.Relations.Add(rel);
// Set the table's primary key field
ds.Tables["ComplianceRep"].PrimaryKey = new DataColumn[] { ds.Tables["ComplianceRep"].Columns["Id"] };
this.whdg_process_repository.IsSelfReference = true;
this.whdg_process_repository.MaxDataBindDepth = 2;
this.whdg_process_repository.DataSource = ds;
this.whdg_process_repository.DataMember = "ComplianceRep";
this.whdg_process_repository.DataKeyFields = "Id";
this.whdg_process_repository.DataBind();
}
Please suggest me hw can i do
Hi Naag,
Can you check the following sample: http://samples.infragistics.com/aspnet/Samples/WebHierarchicalDataGrid/Data/SelfReferencing/Default.aspx?cn=hierarchical-data-grid&sid=50332390-4793-4089-8256-2caafe7ef4aa which is self -referencing data source how can be approached.