wpf - dispay data matrix with different number of columns in each row -
i need display ,in wpf app, 'data matrix' has no fixed tabular structure i.e.
data row 1: aaa bb ccc
data row 2: 222 $$ ddddd eeee
...
data in list of arrays.
i need show data , enable user scroll through it.
strange data structure comes textual flat file, , cannot change this.
i have read lot, , experimented list-view , grid-view, far able get:
1. dymanic column creation, no since have different schema each row
2. rendering each row of data (delimited/formatted) text. no since row data endign in single cell (obviously).
3. (havn't done yet, hoping avoid) have lots of data templates triggers, each diffrent column count - 5 40 - acomodate vast majority of row types.
my question is: how bind data list-like / grid-like scrollable view ?
thanks in advance
if don't need ability select item, can use nested itemscontrols
simply bind first itemscontrol
collection of arrays, , set itemtemplate
itemscontrol
binds array of values.
something this:
<scrollviewer height="300" width="400"> <itemscontrol itemssource="{binding listofarrays}"> <itemscontrol.itemtemplate> <datatemplate> <itemscontrol itemssource="{binding }"> <itemscontrol.itemspanel> <itemspaneltemplate> <stackpanel orientation="horizontal" /> </itemspaneltemplate> </itemscontrol.itemspanel> <itemscontrol.itemtemplate> <datatemplate> <textblock text="{binding }" width="50" /> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol> </scrollviewer>
Comments
Post a Comment