c# - How to read datagrid checkbox status when populating the datagrid with an itemsource in wpf -


i have datagrid populating using items source , setting equal datatable's default view this:

exampledatagrid.itemssource = exampledatatable.defaultview; 

here xaml datagrid im using:

<datagrid x:name="exampledatagrid" autogeneratecolumns="false" horizontalalignment="left" height="261" verticalalignment="top" width="209" margin="2,0,-2,0" gridlinesvisibility="none" headersvisibility="none" selectionmode="single" canuseraddrows="false" >                             <datagrid.columns>                                 <datagridtemplatecolumn x:name="select">                                     <datagridtemplatecolumn.celltemplate>                                         <datatemplate>                                             <checkbox x:name="ck" content="{binding data}" ischecked="{binding path=isselected, updatesourcetrigger=lostfocus, mode=twoway}" />                                         </datatemplate>                                     </datagridtemplatecolumn.celltemplate>                                 </datagridtemplatecolumn>                                 <datagridtextcolumn binding="{binding parttype}" width="auto"/>                             </datagrid.columns>                         </datagrid> 

it (i removed grid , header):

enter image description here

the problem i'm having can't check if check box checked or not items source in use.

can me out this?


Comments