c# wpf ListView with checkbox - check boxes when loading a form by comparing two lists -


i have form in create instances of class box. class box contains list of class visualized listview in form , each item in listview can checked via checkbox. checked items in listview saved new list part of properties of class box. when want edit instances of class box want form open again listview loaded such items checked before checked.

i googled lot not able find solution. have list of selected items in listview , have list displayed in listview. have compare both lists when loading form , check checkboxes of entries in both lists.

this listview in xaml

<listview x:name="panellistview" grid.columnspan="3" grid.column="1" horizontalalignment="left" height="85" margin="0,23,0,0" grid.row="4" grid.rowspan="3" verticalalignment="top" width="189" selectionchanged="panellistview_selectionchanged">             <listview.view>                 <gridview>                     <gridviewcolumn width="40">                         <gridviewcolumn.celltemplate>                             <datatemplate>                                 <checkbox ischecked="{binding mode=twoway, relativesource={relativesource ancestortype={x:type listviewitem}}, path=isselected}" />                             </datatemplate>                         </gridviewcolumn.celltemplate>                         <gridviewcolumnheader tag="select" content="" />                     </gridviewcolumn>                     <gridviewcolumn header="panel name" width="140" displaymemberbinding="{binding name}" />                 </gridview>             </listview.view> </listview> 


Comments