Using nested generic Lists objects for hierachical GridView

4 posts, 0 answers
  1. MikeB
    MikeB avatar
    42 posts
    Member since:
    May 2008

    Posted 21 Apr 2009 Link to this post

    Hi,

    Does anyone have an example of using a nested generic Lists to create a hierarchical  grid?

    If have objects like this:

      100     public class AcctCallLogHistoryDetail

      101     {

      102         internal AcctCallLogHistoryDetail()

      103         {

      104             CallLogDetail = new List<CallLog>();

      105         }

      106 

      107         public string CallLog { get; internal set; }

      108         public List<CallLog> CallLogDetail { get; internal set; }

      109     }

      110 

      111     public class AcctCallLogHistory

      112     {

      113         public int AcctNumber { get; internal set; }

      114 

      115         public List<AcctCallLogHistoryDetail> CallLogHistoryDetail { get; internal set; }

      116 

      117         internal AcctCallLogHistory()

      118         {

      119             CallLogHistoryDetail = new List<AcctCallLogHistoryDetail>();

      120         }

      121 

      122         internal void addDetail(string callLog, CallLog callLogDetail)

      123         {

      124             AcctCallLogHistoryDetail acctCallLogDetail =

      125                 (from d in CallLogHistoryDetail

      126                  where d.CallLog == callLog

      127                  select d).FirstOrDefault();

      128             if (acctCallLogDetail == null)

      129             {

      130                 acctCallLogDetail = new AcctCallLogHistoryDetail();

      131                 acctCallLogDetail.CallLog = callLog;

      132                 CallLogHistoryDetail.Add(acctCallLogDetail);

      133             }

      134             acctCallLogDetail.CallLogDetail.Add(callLogDetail);

      135         }

      136     }


    I expose a property :

       95         public List<AcctCallLogHistoryDetail> AcctCallLogs

       96         {

       97             get { return _curAcctCallLogs.CallLogHistoryDetail; }

       98         }


    that I use for the GridView datasource.

    I'm sure it is simple.  I just can't seem to get the GridView properties set.

    Thanks,

    Mike B.



  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 23 Apr 2009 Link to this post

    Hello MikeB,

    The current edition of RadGridView does not support this scenario, when a nested generic list of objects is used.

    You can try to use manually generated hierarchy like the one in our Demo applications, but in this scenario this will be more complex for implementation and synchronization.

    We planed to include this functionality in the future versions of RadGridView.

    Greetings,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. gerbrand
    gerbrand avatar
    78 posts
    Member since:
    Mar 2009

    Posted 23 Apr 2009 Link to this post

    Hello,

    I wrote a small weblog about this.

    I had to do this also manually for my hierarchy that had 3 levels, the example is showing 2 levels but you will get the idea.

    I hope it helps you.

  5. Vassil Petev
    Admin
    Vassil Petev avatar
    1765 posts

    Posted 24 Apr 2009 Link to this post

    gerbrand, you earned another set of points for this blog! Thank you very much, keep it up!


    All the best,
    Vassil
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top