We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

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.
Live Chat Icon For mobile
Up arrow icon