events - How to trigger DataGridevents DataGridBeginningEdit, DataGridCellEditEnding with a Combobox in Silverlight? / CellTemplate for a Combobox -
i want use datagridevents (datagridbeginningedit, datagridcelleditending, ..etc) handle , detect changes. far understood, without "celltemplate" these not triggered. trying create appropriate celltemplate using textblock, guess not straightforward binding using combobox in celleditingtemplate, because using "displaymemberpath"..
there examples of simpler cases couldn't find smth scenario. see xaml snippet below;
<data:datagridtemplatecolumn width="100"> <data:datagridtemplatecolumn.celltemplate> <datatemplate> <textblock horizontalalignment="center" /> </datatemplate> </data:datagridtemplatecolumn.celltemplate> <data:datagridtemplatecolumn.celleditingtemplate> <datatemplate> <combobox horizontalalignment="stretch" itemssource="{binding durationtypelist, source={staticresource itemsourceprovider}}" selectedvaluepath="code" selectedvalue="{binding path=durationtypecode, mode=twoway}" displaymemberpath="template" /> </datatemplate> </data:datagridtemplatecolumn.celleditingtemplate> </data:datagridtemplatecolumn>
thank you
it turns out, have 2 options..
solution #1
<data:datagridtemplatecolumn.celltemplate> <datatemplate> <textblock horizontalalignment="left" text="{binding path=durationtype.template, mode=oneway}" /> </datatemplate> </data:datagridtemplatecolumn.celltemplate> <data:datagridtemplatecolumn.celleditingtemplate> <datatemplate> <combobox horizontalalignment="stretch" itemssource="{binding durationtypelist, source={staticresource itemsourceprovider}}" selectedvaluepath="code" selectedvalue="{binding path=durationtype, mode=twoway}" displaymemberpath="template" /> </datatemplate> </data:datagridtemplatecolumn.celleditingtemplate>
i changed binding path string object code , template properties..
this blog helped lot..
Comments
Post a Comment