Hi I am using webhierachicalDataGrid and I have 3 tables table1 with column Id, Code, Desc, table2 with columns Id, Type here Id have multiple entries with different types and Table3 with Id, Type, Code, Desc, Number, and other columns
Now I am doing it with hierachical grid on band[0] i want to bind table1's column Code, desc
and on Band[1] i want to bind column Type of table2 and on band[2] I am binding Number, and some other column of table3. For this I am binding it with dataset and making relation on tables columns.
dsResult.Relations.Add("Level0Relationship", dsResult.Tables[0].Columns["Id"], dsResult.Tables[1].Columns["Id"]); DataColumn[] parentColumns = new DataColumn[] { dsResult.Tables[1].Columns["Type"], dsResult.Tables[1].Columns["Id"] }; DataColumn[] childColumns = new DataColumn[] { dsResult.Tables[2].Columns["Type"], dsResult.Tables[2].Columns["Id"] }; DataRelation relation1 = new DataRelation("Level1Relationship", parentColumns, childColumns); dsResult.Relations.Add("Level1Relationship", parentColumns, childColumns);
<ig:WebHierarchicalDataGrid ID="grdJCCDetails" runat="server" Height="200" AutoGenerateColumns="false" Width="100%" AjaxIndicator-AjaxIndicator-ImageUrl="../../images/indicator_bar.gif" AjaxIndicator-AltText="" BorderStyle="None" EnableViewState="False" EnableDataViewState="False" OnInitializeRow="grdJCCDetails_InitializeRow" ShowFooter="true" ShowHeader="true" InitialDataBindDepth="-1" InitialExpandDepth="-1" OnInit="grdJCCDetails_Init"> <Columns> <ig:BoundDataField DataFieldName="JobCostCodeId" Key="JobCostCodeId" Header-Text="JobCostCodeId" Hidden="true" /> <ig:BoundDataField DataFieldName="JobCostCode" Key="JobCostCode" Header-Text="Cost Code" /> <ig:BoundDataField DataFieldName="JobCostCodeDescription" Key="JobCostCodeDescription" Header-Text="Cost Code Description" /> </Columns> </ig:WebHierarchicalDataGrid>
I am unable to bind data to grid on level.
Please suggest where and what is wrong with this code
Hello Shyam,
Thank you for posting in the community.
I was unable to reproduce the behavior you have described. I'm attaching the sample I created. In order to be able to investigate this issue further, I would need a sample project, demonstrating the issue you are experiencing.
Please let me know if you have any other questions.
Hi Nikolay
Thanks for your support.
It is working for me but I am facing an issue when clicking on parent to expand row. I want to do this
1> Hide header of child grid at level1.
2> Hide column of child grid at (level1) but don't want to do this on InitializeRow. Can I make it using an seperate method after binding data with grid.
How can i achieve this?
Hi Shyam,
I suggest that you set the AutoGenerateColumns and AutoGenerateBands properties to false and then add your bands and columns in the markup or using the design view. After that you could set the ShowHeader property of the child band to false and hide a column through its Hidden property.
Please let me know if this helps.
Hi
Thanks for your reply
I tried all the way to bind or format band columns but not getting it. For your reference I am attaching an sample application, please have a look and suggest where and what is wrong.
Here i am manipulating it on InitializeRow in code on band1(Level1 ) i want to hide header of this band and also want to hide column on band2(level2) of grid and also want to add summay of Subtotal on footer of that band.
Is there any way how can i find bands and column of band in a separate method?
Thanks
Shyam
If you need any further assistance on the matter please do not hesitate to ask.
Thx for your supportI am binding data to WebHierarchicalDataGrid with 2 levels(Bands) with setting properties to AutoGenerateColumns="true" AutoGenerateBands="false" and also hiding/formatting columns based on conditions.
I also follow this link
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.2/CLR4.0/html/WebHierarchicalDataGrid_Hide_a_Column.html
than I am getting an error on click of expand row (Runtime Exception: No child grid script descriptors are available!) to resolve this I also bind datasource on every postback, on making it for every postback expanded data or child grid are not coming,
For your kind reference I am attaching a sample application. Please suggest how to hide or format columns.Here I want to hide header of band1(level1) and also want to hide column on band2(level2) of grid.Please suggest where and what is wrong?
Regards
Please do not hesitate to ask if you need further assistance on that matter.