WPF DataGrid 'Select All Button' followed by Control-C -


right after loading wpf datagrid, hit 'select button' (upper left hand corner) followed control-c.

but sequence not copy datagrid items clipboard.

how can make work?

it seems data grid not focus when button clicked, have fix yourself:

datagrid.commandbindings.add(new commandbinding(applicationcommands.selectall, ondatagridselectall)); 

and then:

private void ondatagridselectall(object sender, executedroutedeventargs e) {     var grid = (datagrid)sender;     grid.focus();     grid.selectall(); } 

you can add command binding in xaml if want so.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -