Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to handle Visual Studio's SDK commands on DataGrid ?

$
0
0

Hello Everyone,

I have a DataGrid as following -

I want to create a line on that Data grid when I press "F7" key of keyboard. So far now, I have done following things :

1. I have created a "CreateLine Command" in .vsct file. (Added this command under specific menu, making that command invisible)

2. Assigned a keyboard shortcut "F7" to "CreateLine Command" from .vssettings file (Note that I have remove original shortcut of "F7" and assign new command to it).

Now When I press "F7" on normal editor, it works fine. But when pressed on  UserControl or Window in WPF, it doesn't work. Because UserControl or Window doesn't come to know that which key has been pressed on it. In this case, handling key_up or key_Down event is not feasible, because we have more than 20 Xaml files.

I come to know that "IOleCommandTarget" interface is useful in this scenario which has QueryStatus() method which catches SDK command which was pressed on UserControl or Window but unfortunately it didn't work.

Please do the needful to me.

Thanks in advance.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>