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

How to setup a GridHierachy with this kind of Source

1 Answer 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vuyiswa
Top achievements
Rank 2
Vuyiswa asked on 17 Aug 2010, 07:34 AM
Good Day All

My datasource is a List as defined like this

public List<EAV> GetRecords(List<string> ParentRecords, List<string> ChildRecords)
{
    List<EAV> Final = new List<EAV>();
 
    for (int i = 0; i < ParentRecords.Count; i++)
    {
        //Put a check for child records exists and add
        Final.Add(new EAV(ParentRecords[i], ChildRecords[0]));
        //Start looping from 2nd J = 1 instead of 0
        for (int J = 1; J < ChildRecords.Count; J++)
        {
            //remove ParentRecords[i]
            Final.Add(new EAV("", ChildRecords[J]));
        }
    }
 
    return Final;
}

And as you can see it brings back a list. Now this will arrange everything in hiearchial form but i need to be able to collapse and uncollase the results , but now it shows in a Grid as normal data as depicted in the image below


Thanks



1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 18 Aug 2010, 08:32 PM
What you could do is subscribe to the OnNeedDataSource event and then the OnDetailDataBind event. This would allow you to define the first level of your hierarchy and then based on that value have your detailtables defined in these events. The links I provided are to the documentation articles regarding each of these particular events and I think they should help :)
Tags
Grid
Asked by
Vuyiswa
Top achievements
Rank 2
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or