Complex DataGrid Binding

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The question I have is how to -=> Effectively <=- and -=> Efficently <=-
bind a DataGrid to a 1 deep organizational chart, where "R" would be a
row of data and 1..N would be the columns of the row. I need to have the
data displayed and updated/added, so I will need 2 way binding.


+---+
| R | (View this in NotePad)
+---+
|
+-------+-------+-------+-------+
| | | | |
+---+ +---+ +---+ +---+ +---+
| 1 | | 2 | | 3 | |...| | N |
+---+ +---+ +---+ +---+ +---+


I am currently creating the columns of the DataGrid dynamically, which
works fine. The binding is where I am getting stuck. A -=> Very <=-
simplistic view of my data looks like this.



+-----------------------------+
| MyRowCollection |
+-----------------------------+
| Guid ID |
| MyRowCollection rows |
+-----------------------------+
| 1
| to
| N
+-----------------------------+
| MyRow |
+-----------------------------+
| Guid ID |
| MyColumnDataCollection data |
+-----------------------------+
| 1
| to
| N
+------------------+
| MyColumnData |
+------------------+
| Guid ID |
| object data |
+------------------+



Any thoughts would be appreciated.

Dave
 
Dave said:
The question I have is how to -=> Effectively <=- and -=> Efficently <=-
bind a DataGrid to a 1 deep organizational chart, where "R" would be a
row of data and 1..N would be the columns of the row. I need to have the
data displayed and updated/added, so I will need 2 way binding.

<snip>

If you want to combine rows into one grid view that don't have the same
columns, you'll need to use an ITypedList implementation with your own
property descriptors, which can make up for the fact that some fields may
not be defined for a specific row. I have written a blog article about
this in the past, which you can find here:

http://www.sturmnet.org/blog/archives/2005/02/04/simulating-fields/

Hope this helps!


Oliver Sturm
 
Back
Top