Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
685
Column hiding on webhierachicalDataGrid on bands
posted

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

 

Parents Reply Children
No Data