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

Using nested generic Lists objects for hierachical GridView

3 Answers 61 Views
GridView
This is a migrated thread and some comments may be shown as answers.
MikeB
Top achievements
Rank 1
MikeB asked on 21 Apr 2009, 02:25 PM
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.



3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 23 Apr 2009, 08:48 AM
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.
0
gerbrand
Top achievements
Rank 2
answered on 23 Apr 2009, 03:26 PM
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.

0
Vassil Petev
Telerik team
answered on 24 Apr 2009, 02:50 PM
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.
Tags
GridView
Asked by
MikeB
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
gerbrand
Top achievements
Rank 2
Vassil Petev
Telerik team
Share this question
or