c# - Issue with doubleclick on datagrid -


i have following on datagrid in c# code:

<datagrid.inputbindings>       <mousebinding gesture="leftdoubleclick" command="{binding cmdtransunitfillerrowdblclick}" />   </datagrid.inputbindings>   

it works part except if user first selects row (single click) , tries double-clicking row. in situation cmdtransunitfillerrowdblclick code never fired processing.

so, how can cmdtransunitfillerrowdblclick fire correctly on double-click when row selected?
since may ask:

private void executecmdtransunitfillerrowdblclick(object parameter)   {     if (dgtransunitfillerselecteditem != null)         transunitfillerdoubleclick(dgtransunitfillerselecteditem.collectionrowid); } 

see my answer related question. problem datagrid no longer has focus after user selects row (or cell, actually); cell user clicked in datagrid does. have change focus datagrid allow this.

change:

<datagrid.inputbindings>       <mousebinding gesture="leftdoubleclick" command="{binding cmdtransunitfillerrowdblclick}" />   </datagrid.inputbindings> 

to:

<datagrid.inputbindings>       <mousebinding gesture="leftdoubleclick" command="{binding cmdtransunitfillerrowdblclick}" />       <mousebinding gesture="leftclick" command="{binding cmdtransunitfillerrowclick}" />   </datagrid.inputbindings> 

...and add:

private void executecmdtransunitfillerrowclick(object parameter)   {     if (dgtransunitfillerselecteditem != null)         the_name_of_your_datagrid.focus(); } 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -