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.