// prevent editing the locked columns as well void _flex_BeforeDoubleClick(object sender, C1.Win.C1FlexGrid.BeforeMouseDownEventArgs e) { if (_lockedCols.Contains(_flex.MouseCol)) { e.Cancel = true; } }
private void _flex_BeforeMouseDown(object sender, C1.Win.C1FlexGrid.BeforeMouseDownEventArgs e) { // start dragging when the user clicks the row headers C1FlexGrid flex = sender as C1FlexGrid; HitTestInfo hti = flex.HitTest(e.X, e.Y); if (hti.Type == HitTestTypeEnum.RowHeader) { // select the row int index = hti.Row; flex.Select(index, 0, index, flex.Cols.Count - 1, false); // save info for target _src = flex; // do drag drop DragDropEffects dd = flex.DoDragDrop(flex.Clip, DragDropEffects.Move); // if it worked, delete row from source (it's a move) if (dd == DragDropEffects.Move) { flex.Rows.Remove(index); } // done, reset info _src = null; } }