Problem
In my ContextMenuStrip when i hover the mouse on an item, it is selected (highlighted) - which is nice
Now I use up down arrow key and selects another item- It gets highlighted, which is also nice
But after that the selection again goes back to the previously selected item(the item selected by the mouse)
I need to persist the last selected item, which is either selected by mouse or by keys.
Could anuone plese suggest a way to handle it?
Any help is appreciated.
Background
I am attaching the ContextMenuStrip to the Customized data grid view.On right clicking on the header of the datagridview, the context menu is opened which lists the columns to display on the datgridview. Right click on the the items, to add to the grid.
Also can use the up and down arrow keys to select a column from the context menu and press enter to add it to the grid.
The grid is refreshed in particular interval, but the context menu is populated only once, that is in the constructor of the grid.