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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -