I have used WebHierarchicalDataGrid in my project and I am binding the datasource of the grid using a dataset.
When I set the AutoGenerateBands = "True", then I get a Hierarchical view with all the parent and child columns but as soon as I make this as false and define my own columns in the child band I get only one parent row with no expand arrow and no child rows at all.
I am not able to figure out the problem. Any help will be appreciated.
Aspx Code:
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" AutoGenerateColumns="false"
AutoGenerateBands="false" Height="100%" Width="100%" InitialDataBindDepth="-1"
InitialExpandDepth="0" DataKeyFields="ID_APPLIESTO">
<Columns>
<ig:BoundDataField DataFieldName="APPLIESTO_VALUE" Key="APPLIESTO" Header-Text="Applies To" />
<ig:BoundDataField DataFieldName="ID_APPLIESTO" Key="ID_APPLIESTO" Header-Text="ID_APPLIESTO" />
</Columns>
<Bands>
<ig:Band ShowHeader="true" Key="B1" AutoGenerateColumns="false" DataKeyFields="ID_APPLIESTO">
<ig:BoundDataField DataFieldName="ID_APPLIESTO_GROUP" Key="ID_APPLIESTO_GROUP" Header-Text="ID_APPLIESTO_GROUP" />
</ig:Band>
</Bands>
</ig:WebHierarchicalDataGrid>
Binding Dataset:
oOraAdpt.Fill(ds);
ds.Relations.Add("1", ds.Tables[0].Columns["ID_APPLIESTO"], ds.Tables[1].Columns["ID_APPLIESTO"]);
whdg1.DataSource = ds;
whdg1.DataBind();
Hi,
I took a look at your code and think that if you set the correct DataMember for the grid and the child band it'll fix the issue. If it doesn't please attach a sample WebSite so we can investigate further.
I have the same issue i.e if i put autogeneratebands=true the parent child relation seems fine but when i do autogeneratebands=false and define band myself i dont see the expand/collapse animation. here is my code.
//aspx//
<
="false"
="0">
="Auto"
/>
>
="MKT_AREA">
//code behind//
igV.InitialDataBindDepth = -1;
DataSet ds = new DataSet();
DataTable dt = LeaseNego.getRegions();
DataTable dtArea = LeaseNego.getOpsArea();
ds.Tables.Add(dt); ds.Tables.Add(dtArea);
System.Data.
DataRelation dRelation = new System.Data.DataRelation("RGN_Relation",dt.Columns["RGN_CDE"],dtArea.Columns["RGN_CDE"]);
ds.Relations.Add(dRelation);
igV.DataMember =
"dt"; igV.Bands[0].DataMember = "dtArea";
igV.DataSource = ds;
igV.DataBind();