void CustomWinGrid_MouseClick(object sender, MouseEventArgs e) { UltraGrid grid = sender as UltraGrid; if (grid == null) return; UIElement controlElement = this.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; } /* it will check for the selected column and if any selected column found * it will set the selected property of the all cells. this part is required * to apply cut,copy,paste functionality. */ if (column != null) { foreach (UltraGridRow row in grid.Rows) { if (!row.Cells[column.Index].Selected) row.Cells[column.Index].Selected = true; else row.Cells[column.Index].Selected = false; } } }