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

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

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