How to setup a GridHierachy with this kind of Source

2 posts, 0 answers
  1. Vuyiswa Maseko
    Vuyiswa Maseko avatar
    187 posts
    Member since:
    Jan 2010

    Posted 17 Aug 2010 Link to this post

    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



  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 18 Aug 2010 Link to this post

    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 :)
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top