Hi,
There is an event called "ColumnHeaderMouseClick" in Windows.Forms.DataGridView. is there any similar event
available with UltraWinGrid.UltraGrid ?
Solution suggested by you is working , but it takes long time to execute that event.
My requirement is when user click on any of the column of the grid and he can apply cut,paste,copy functionality.
but cut,copy,paste functionality is working with selected cells. if i will implement this method its working fine. but its taking long time.
is there any other solution to this problem ?
Thanks in Advance.
No, there is not event that notifies of a single click (there is, however, a DoubleClickHeader event). Note that you could handle the control's MouseClick event and hit test for a column header.
Example:void ultraGrid_MouseClick(object sender, MouseEventArgs e){ UltraGrid grid = sender as UltraGrid; UIElement controlElement = grid.DisplayLayout.UIElement; UIElement elementAtPoint = controlElement != null ? controlElement.ElementFromPoint(e.Location) : null; UltraGridColumn column = null; while ( elementAtPoint != null ) { HeaderUIElement headerElement = elementAtPoint as HeaderUIElement; if ( headerElement != null && headerElement.Header is Infragistics.Win.UltraWinGrid.ColumnHeader ) { column = headerElement.GetContext( typeof(UltraGridColumn) ) as UltraGridColumn; break; }
elementAtPoint = elementAtPoint.Parent; }}