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.
Unfortunately, activation email could not send to your email. Please try again.

Disable Drag Columns and columns width change

Thread ID:

Created:

Updated:

Platform:

Replies:

94364 May 10,2010 05:24 AM May 20,2010 09:20 AM Windows Forms 1
loading
Tags: GridControl
Ruslan Gasanbekov
Asked On May 10, 2010 05:24 AM

Hi,

I whould like to achive the following:

1. I got grid with couple of regual columns and couple with stacked header columns, the stacked header can be clicked and opened a new form. I whold like to prevent from changing the columns order, for that I use:
this.m_Grid.TableOptions.AllowDragColumns = false
but then when i click the stacked headers, the shadow of the cell click operation is gone. How can i achive this behavior and keep the shadow of the cell click operation?

2. How can I prevent the user from changing the columns width.

Arulraj A [Syncfusion]
Replied On May 20, 2010 09:20 AM

Hi Ruslan,

Thanks for your interest in Syncfusion Products.

1)To avoid dragging columns, you can handle the TableControlQueryAllowDragColumn event and cancel drag operation. The below code achieves this.

void gridGroupingControl1_TableControlQueryAllowDragColumn(object sender, GridQueryAllowDragColumnEventArgs e)
{
if (e.Reason == GridQueryAllowDragColumnReason.HitTest)
{ e.AllowDrag = false;
e.Handled = true; }
}

We don’t find any issue while clicking in stacked header to display form. If you still see the issue, please implement it in the below sample and resend it to us.


2)To avoid the user from changing the columns width you need to use ColWidthsChanging event. The below code achieves this.

void Model_ColWidthsChanging(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeChangingEventArgs e)
{e.Cancel = true;}


Here is a sample for your reference.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=DisableDragColumn-357361450.zip

Regards,
Arulraj.A

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;