Auto Generate Hierarchy can not load child table records

4 posts, 0 answers
  1. Kind
    Kind avatar
    5 posts
    Member since:
    Aug 2017

    Posted 19 Aug 2017 Link to this post

    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

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3532 posts

    Posted 21 Aug 2017 Link to this post

    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.
  3. Kind
    Kind avatar
    5 posts
    Member since:
    Aug 2017

    Posted 21 Aug 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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.

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3532 posts

    Posted 21 Aug 2017 Link to this post

    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.
Back to Top