Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
240
Automatic grouping in xamdatatree
posted

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  - 

 

public

 

 

partial class AccountList : object, System.ComponentModel.INotifyPropertyChanged

{ public string accountId;   

 

 

 

  public string currencyCode;

 

 

 

  public string startDate;

}

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

                   9/9/2011

Test2

           USD

                   8/9/2011

     EUR

                  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;

 

 

 

 

private string

accountIDField;

 

 

 

 

private string

currencyCDField;

 

 

 

 

private string

balanceClassCDField;

 

 

 

 

private System.DateTime

valueDateField;

 

 

 

 

private decimal

originalBalanceAdjustmentField;

 

 

 

 

private decimal

netBalanceAdjustmentField;

 

 

 

 

///

<remarks/>

 

[System.Xml.Serialization.

 

 

XmlElementAttribute

 

(Order=0)]

 

 

 

public string

BuID {

 

 

 

get

{

 

 

 

return this

.buIDField;

}

 

 

 

set

{

 

 

 

this.buIDField = value

;

 

 

 

this.RaisePropertyChanged("BuID"

);

 

 

Parents Reply Children
No Data