wpf - Problem with binding property on control in datagrid header -
.net 4, caliburn micro. need add textbox, comobobox , controls datagrid headers , bind property view model class on these controls.
so try use headertemplate:
xaml:
<datagrid itemssource="{binding calls}" autogeneratecolumns="false"> <datagrid.columns> <datagridtextcolumn isreadonly="true" cellstyle="{staticresource cellstyle}" binding="{binding path=number}"> <datagridtextcolumn.headertemplate> <datatemplate> <stackpanel orientation="vertical"> <textblock text="cell phone no"/> <textbox width="120" fontsize="14" verticalalignment="center" borderthickness="1" text="{binding path=numberfiltervalue, mode=onewaytosource, updatesourcetrigger=propertychanged}"/> </stackpanel> </datatemplate> </datagridtextcolumn.headertemplate> </datagridtextcolumn> </datagrid.columns> </datagrid> in header have textbox control , try bind property numberfiltervalue view model class.
view model class:
public string numberfiltervalue { { return _numberfiltervalue; } set { _numberfiltervalue = value; notifyofpropertychange(() => numberfiltervalue); filtercalls(); } } problem binding not works. property numberfiltervalue still empty.
what root of problem , how can solve it? thank cooperation.
if sure meant onewaytosource , not oneway should read this: onewaytosource binding seems broken in .net 4.0
Comments
Post a Comment