hi all,
I need to implement Copy, Paste, Cut operations (main tool menu item) on WinGrid cells or textboxes, which are placed on nested container controls on MdiChildForms.
this.ActiveControl always give the highest level MdiChildForm instead of the actual grid or textbox that I selected. How do I get the real active control so that I can do something like grid..PerformAction(UltraGridAction.Copy) or textBox.Copy( )??
Thanks in advance
I would think that you have to continue walking down the control hiearchy looking for the active control; this property is on ContainerControl, so you would also have to check for that.
UltraGrid activeGrid = null;ContainerControl container = this.ActiveControl as ContainerControl;while (container != null){ Control activeControl = container.ActiveControl; if (activeControl is UltraGrid) { activeGrid = (UltraGrid)activeControl; break; } container = activeControl as ContainerControl;}
-Matt