c# - WPF Datagrid Double Click Cell MVVM Design -


i have wpf application contains datagrid. bound list object "orders" shown below.

public class orderblock {   public settings setting;   public list<order> orders; } public class order {   public int amount;   public string orderid;   public string orderiddup;   public string name;   public string namedup;   public bool dupids;   // , string, int fields } 

for reasons out of control possible there can more 1 orderid, hence orderiddup property. datagrid default shows orderid , not orderiddup.

what user able click on cell id , window load show them other id 2 names , let them choose id should used.

i have been reading wpf datagrid doesn’t support functionality of double clicking on cell. bit lost how should start going issue. other issue can see trying (being operative word) use mvvm design how kind of event exposed view model?

also best way go showing such information.

any great, thanks, m

instead of double-clicking on cell may double-click on grid

    <datagrid.inputbindings>         <mousebinding gesture="leftdoubleclick" command="{binding edit}" commandparameter="{binding elementname=usersdatagrid, path=selecteditem}" />     </datagrid.inputbindings> 

in viewmodel

    public icommand edit { get; private set; }   edit = new relaycommand(edituser, x => _isadmin);     private static void edituser(object usr)     {         if (!(usr user))             return;          new usereditorviewmodel(usr user);     } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -