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

Binding Collection

1 Answer 38 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Kristjan Einarsson
Top achievements
Rank 1
Kristjan Einarsson asked on 27 Aug 2010, 05:32 PM
I'm having some binding troubles and was wondering if you could help me out.
if ie:
sudo code
class Product
 prop parentid
 prop Name
 prop Color
 prop List<PricePerMonth>
 prop List<PricePerMonthHeader>
 prop List<Prouct> Children
  
class PricePerMonth
 prop Price

classPricePerMonthHeader
 prop Header

and the result would something like this:
Name | Color | Month 1 | Month 2 | Month 3... etc.
car x       blue        300          200               22    ....
     > some children
car z     red          10             22                 33
     > some children

Is there any good way to achieve this ?

Regards
Kristj√°n.

1 Answer, 1 is accepted

Sort by
0
Kristjan Einarsson
Top achievements
Rank 1
answered on 01 Sep 2010, 03:45 PM
Well found out.
By using

for (int i = 0; i < datasource.Values.Count(); i++)
 {
     GridViewDataColumn col = new GridViewDataColumn();
     Binding b = new Binding("Values[" + i + "].value")
     { Mode = BindingMode.TwoWay };
     col.DataMemberBinding = b;
     radTreeListView.Columns.Add(col);
}
Tags
TreeListView
Asked by
Kristjan Einarsson
Top achievements
Rank 1
Answers by
Kristjan Einarsson
Top achievements
Rank 1
Share this question
or