redarrowindicator

Is there a way to draw 'x's in a similar fashion to the the redarrowindicator when dragging is disabled for a column?

1 Reply

HA haneefm Syncfusion Team July 31, 2007 09:56 PM UTC

Hi Zach,

You can do this by hanlding the TableControlMouseDown event of the grid and draw the image("X") using the DragWindow class. Below is a code snippet that show this task.

private Syncfusion.Windows.Forms.DragWindow dragWindow;
private bool IsDiableColumnDrag = false;

void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
Element el = e.TableControl.PointToNestedDisplayElement(e.Inner.Location);
if (el.Kind == DisplayElementKind.ColumnHeader)
{
IsDiableColumnDrag = true;
dragWindow = new Syncfusion.Windows.Forms.DragWindow();
dragWindow.Opacity = .5f;
dragWindow.DragBitmap = SystemIcons.Hand.ToBitmap();
dragWindow.Invalidate();
dragWindow.ShowWindowTopMost();
dragWindow.StartDrag(Control.MousePosition);

}
}

Please refer to the attached sample for implementation and let me know if this helps.
DrawDragXInGrid.zip

Best regards,
Haneef

Loader.
Up arrow icon