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

Auto Generate Hierarchy can not load child table records

3 Answers 94 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kind
Top achievements
Rank 1
Kind asked on 19 Aug 2017, 09:38 AM

hi, daer..

in the case of using Auto Generate Hierarchy of Grid View if the first record of the partent table has not related record in child's table, grid view can not load other parent child's records.

 For example, as shown in the picture (01.png), I have 4 tables. 

The Patient table is Parent and 3 other are children (one to many relations). Now if the first record of the Patient table that retrieves to grid data source has no related record in 3 other tables, the grid does not display child's records for other parent table records. shown in picture 02.png.

I'm using .net 4.7 and UI For  WinForms 2017_2_613

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Aug 2017, 08:25 AM
Hello, 

Thank you for writing.  

At runtime, if the data source for the grid is a System.Data.DataSet type and there are relations defined in it, the hierarchy can be created automatically. Set the AutoGenerateHierarchy property true to get this behavior. The following help article is quite useful for binding to hierarchical data automatically: http://docs.telerik.com/devtools/winforms/gridview/hierarchical-grid/binding-to-hierarchical-data-automatically
 
If you are still experiencing any further difficulties, feel free to submit a support ticket where you provide a sample project and our support staff will gladly assist you. 

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Kind
Top achievements
Rank 1
answered on 21 Aug 2017, 09:13 AM

Hello,

thanks for answering

my grid data source is a Dateset from entity context like below code :

 using (var entity = new VaccinationEntities())
            {   
                gvPatientList.AutoGenerateHierarchy = true;
                gvPatientList.DataSource = entity.Patients.ToList();

          }

but again if first retrieved record has no related data to the child's table , AutoGenerateHierarchy can not detect hierarchy of tables and just show parent table and child table without their data.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Aug 2017, 09:46 AM
Hello, 

Thank you for writing back. 

I have prepared a sample project for your reference demonstrating how to automatically generate the hierarchy in RadGridView. Note that it is necessary to have a relation between the tables specifying the master and child column in the DataTables.

I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Kind
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Kind
Top achievements
Rank 1
Share this question
or