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

QueryAllowDragColumnHeader fired when columns not dragged

The event QueryAllowDragColumnHeader is raised when 2 columns are clicked in quick succession.

Please let me know if a fix would be provided, as our application has a bug filed related to this.

Our application uses Essential Studio 6.1.0.34.


5 Replies

AD Administrator Syncfusion Team March 11, 2008 11:19 PM UTC

Hi Sathish,

Thank you for your patience.

The TableControlQueryAllowDragColumn event is raised when you mouseover the column header in a GroupingGrid. In that event handler, you can check the reason for getting raised this event by using e.Reason property from the GridQueryAllowDragColumnEventArg. Below are the codes:


void gridGroupingControl1_TableControlQueryAllowDragColumn(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridQueryAllowDragColumnEventArgs e)
{
if (e.Reason == GridQueryAllowDragColumnReason.HitTest)
{
Console.WriteLine("Indicate hitting is occur");
}
else if (e.Reason == GridQueryAllowDragColumnReason.MouseUp)
{
Console.WriteLine("Indicate mouse up");
}
else if (e.Reason == GridQueryAllowDragColumnReason.Remove)
{
Console.WriteLine("Occurs When removed group column");
}
else
{
Console.WriteLine(" Indicate RedArrowIndicator is displayed");
}

}


Please let me know if this helps.

Regards,
Srirajan




SA Satish March 12, 2008 07:20 AM UTC

Is there a way to prevent that event from being fired or any other way to handle the event, as we want the grid not to swap the columns if they are just being clicked.



AD Administrator Syncfusion Team March 25, 2008 05:29 PM UTC

Hi Satish,

Thank you for your patience.

You need to handle TableControlQueryAllowDragColumn and set the e.AllowDrag to false to prevent the swapping of the columns in a grid. Please refer the code below for more details.


void gridGroupingControl1_TableControlQueryAllowDragColumn(object sender, GridQueryAllowDragColumnEventArgs e)
{
e.AllowDrag = false;
}


Please let me know if this helps.

Best Regards,
Srirajan




SJ Satish Janakiraman April 15, 2008 09:15 AM UTC

Hi,

Thanks for the update. I still want to enable column reordering. The issue that I face is that, the columns are reordered when any two columns are just clicked (not dragged) in quick succession.

regards,
Satish



SJ Satish Janakiraman April 29, 2008 11:42 AM UTC

Do I have an update on my previous post?

Thanks,
Satish


Loader.
Live Chat Icon For mobile
Up arrow icon