Hi!
I try to implement an interactive filter to my DataGridView. So I've created a ContextMenuStrip with to menus "Add Filter" and "Remove Filter". I've assigned this ContextMenuStrip to each HeaderCell of each coulmn. So that the ContextMenuStrip is only shown on the header.
What I now need is at the opening of the ContextMenuStrip on which Column the ContextMenuStrip is displayed. How can I do this?
I've tried the following but this code returns the last active column:
ContextMenuStrip
myMenu = (ContextMenuStrip)((ToolStripMenuItem)sender).GetCurrentParent();DataGridView gdvFilter = (DataGridView)myMenu.SourceControl;
gdvFilter.CurrentCell.ColumnIndex
Thanks in advance...
Greets Markus