c# - Trigger in textbox inside CellEditingTemplate -
i have such message
initialization of 'system.windows.controls.textbox' threw exception.
for template
<datagridtemplatecolumn.celleditingtemplate> <datatemplate> <textbox text="{binding time, mode=twoway, updatesourcetrigger=propertychanged}" focusmanager.focusedelement="{binding relativesource={relativesource self}}"> <textbox.triggers> <datatrigger binding="{binding time}" value="39"> <setter property="textbox.isenabled" value="false"></setter> </datatrigger> </textbox.triggers> </textbox> </datatemplate> </datagridtemplatecolumn.celleditingtemplate>
it started appear after added trigger. went wrong? thanks.
we can't use datatrigger below,it should in style,controltemplate , datatemplate,so add trigger style of textbox
<textbox.triggers> <datatrigger binding="{binding time}" value="39"> <setter property="textbox.isenabled" value="false"></setter> </datatrigger> </textbox.triggers>
Comments
Post a Comment