I have the following enumerable property which I am binding to XamDataTree
public
IEnumerable<AccountList> AccountListView
{
get { return m_AccountList; }
set
{ m_AccountList =
value;
);
Type AccountList has the following structure -
partial class AccountList : object, System.ComponentModel.INotifyPropertyChanged
{ public string accountId;
public string currencyCode;
}
AccountListView has a collection of type AccountList , and in the collection, two different instances can have same accountId but different currencyCode and startDate fields.
My requirement is that XamdataTree should automatically group the list based on the account id and curreny code and shows the hierarchy as AccountID - currencyCode - start Date
For example, if the list has collection such as
(Please ignore the syntax)
new AccountList {accountId ="Test1", currencyCode = "USD", startDate = "9/9/2011"}
new AccountList {accountId ="Test1", currencyCode = "USD", startDate = "9/10/2011"}
new AccountList {accountId ="Test1", currencyCode = "EUR", startDate = "9/9/2011"}
new AccountList {accountId ="Test2", currencyCode = "USD", startDate = "8/9/2011"}
new AccountList {accountId ="Test2", currencyCode = "EUR", startDate = "8/10/2011"}
The tree should show something like this -
Test1
USD
9/9/2011
9/10/2011
EUR
Test2
8/9/2011
8/10/2011
Can anyone please help me on how to achieve this using XamDataTree.
Thanks in advance.
public partial class AccountList : object, System.ComponentModel.INotifyPropertyChanged
private string
buIDField;
accountIDField;
currencyCDField;
balanceClassCDField;
private System.DateTime
valueDateField;
private decimal
originalBalanceAdjustmentField;
netBalanceAdjustmentField;
///
<remarks/>
[System.Xml.Serialization.
XmlElementAttribute
(Order=0)]
public string
BuID {
get
return this
.buIDField;
this.buIDField = value
;
this.RaisePropertyChanged("BuID"
Hi,
Looks like you need to convert your class to a hierarchical structure.You could have a collection of accountId that contain a collection of currencyCode, which in turn has a collection of startDate.
This is a lot more complicated in design but our DataUtil will give you the idea.
http://help.infragistics.com/NetAdvantage/Silverlight/2011/1/CLR4.0/?page=Resources_DataUtil.html
Or here is a very simple example that you could consider.
public class StaffMember { public string Name { get; set; } public ObservableCollection Periods { get; set; } } public class Period { public string ClassTitle { get; set; } public ObservableCollection Hour { get; set; } } public class Hour { public int Hour { get; set; } }
I hadn't heard back from you and I'm wondering if you had any further questions.
Hi Marianne,
Currently I am busy with other aspect of the code, so did not get time to try out your example.
Will try out your sample and get back to you in case of any queries.
Thanks for your help.
Pallavi Thanvi
Thanks for letting me know. Please let me know if you have any questions.