xml - How to Parse nodes in datasource return using XAML DataGrid? -
i have odd return webservice proving difficult bind datagrid
. here being returned webservice:
<new0collection> <new0item> <orno>0010121825</orno> <!-- xml data encoded --> <ponr><obponr>1</obponr><obponr>2</obponr><obponr>3</obponr></ponr> </new0item>
there limitation on our system have encode nested nodes. trying list within list, have been able in datalist
rowtemplate
. user selects line in datagrid
, , sub-list of related items shown.
<datagrid name="prodlines_list3" verticalalignment="stretch" horizontalalignment="stretch" itemssource="{binding new0collection}" rowdetailsvisibilitymode="{binding elementname=expandrows_txt,path=text,mode=oneway}" style="{dynamicresource styledatagrid}" headersvisibility="all" autogeneratecolumns="false" rowheaderwidth="0" canusersortcolumns="true" canuserresizerows="false" canuseraddrows="false" canuserdeleterows="false" verticalgridlinesbrush="#50e5e5e5" horizontalgridlinesbrush="#50e5e5e5" horizontalcontentalignment="center" rowheight="25" height="auto" width="auto" grid.row="1" grid.column="0"> <datagrid.resources> <datatemplate x:key="expanderbt"> <stackpanel orientation="horizontal"> <checkbox x:name="expandrows_check" content="row mode:" ischecked="{x:null}" isthreestate="true" margin="5" fontsize="14" /> <textbox x:name="expandrows_txt" text="{binding elementname=prodlines_list,path=rowdetailsvisibilitymode,mode=twoway,updatesourcetrigger=propertychanged}" /> </stackpanel> </datatemplate> </datagrid.resources> <datagrid.rowdetailstemplate> <datatemplate> <listbox x:name="operations_listbox" itemssource="{binding ponr}" width="auto" verticalalignment="top" horizontalalignment="stretch" margin="20,0,0,0" maxheight="200"> <listbox.itemtemplate> <datatemplate x:name="operations_items"> <dockpanel x:name="itemdockpanel" background="#c5c5c5"> <textblock x:name="voopno_txt" text="{binding}" margin="3,3,3,3" verticalalignment="center" horizontalalignment="left" dockpanel.dock="left" /> </dockpanel> </datatemplate> </listbox.itemtemplate> </listbox> </datatemplate> </datagrid.rowdetailstemplate> <datagrid.columns> <datagridtextcolumn header="order" binding="{binding orno}" /> <datagridtextcolumn header="line" binding="{binding ponr}" /> </datagrid.columns> </datagrid>
you can see ponr nodes displaying xml code, , getting every character displayed listboxitem
in row template.
although should this:
(this datagrid
works, because data not being returned webservice)
is there better way format web-service data, or there binding trick use?
Comments
Post a Comment