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 only drag the last column

Thread ID:

Created:

Updated:

Platform:

Replies:

123825 Apr 25,2016 05:09 AM Apr 26,2016 05:31 AM Windows Forms 1
loading
Tags: GridGroupingControl
Moises
Asked On April 25, 2016 05:09 AM

Good morning, I have a problem with the GridGroupingControl

I've been looking for information in the forum but I have not found anything

I only want to get  block or disable drag the last column

Thanks in advance

Amresh S [Syncfusion]
Replied On April 26, 2016 05:31 AM

Hi Moises, 
 
Thank you for using Syncfusion products. 
 
Query 
Solution 
I only want to get  block or disable drag the last column 
Solution 1: 
We can restrict the dragging of a specified column by using the event, TableControlQueryAllowDragColumn. The AllowDrag property can be set as “false” depending upon the specified column. Please refer to the below code snippet. 
 
Code Example: 
// Trigger the required event. 
this.gridGroupingControl1.TableControlQueryAllowDragColumn += new GridQueryAllowDragColumnEventHandler(gridGroupingControl1_TableControlQueryAllowDragColumn); 
// Determine the last column and then restricting. 
void gridGroupingControl1_TableControlQueryAllowDragColumn(object sender, GridQueryAllowDragColumnEventArgs e) 
{ 
   if (this.gridGroupingControl1.TableDescriptor.VisibleColumns.IndexOf(e.Column) + 1 == this.gridGroupingControl1.TableDescriptor.VisibleColumns.Count) 
    e.AllowDrag = false; 
} 
 
 
Solution 2: 
We can also restrict the dragging to a specified column by the following code, 
 
Code Example: 
// Trigger the required event. 
this.gridGroupingControl1.TableControlQueryAllowDragColumn += new GridQueryAllowDragColumnEventHandler(gridGroupingControl1_TableControlQueryAllowDragColumn); 
// Determine the last column and then restricting. 
void gridGroupingControl1_TableControlQueryAllowDragColumn(object sender, GridQueryAllowDragColumnEventArgs e) 
{ 
  if (e.Column == "SampleData") // Specify the column to be restricted. 
      e.AllowDrag = false; 
} 
 
 
Please refer to the below attached sample and let us know your concerns. 
 
Sample: 
 
Regards, 
Amresh S. 


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.

;