Disallow 1 column to Drag

Hi, I was wondering if there was a way to make it so that you can''t move a column in the GGC. I want to make some columns non-moveable while others the user can move. I am currently using something like this but it doesn''t cancel the event. If e.Column = "UWI" Then If e.MouseEventArgs Is Nothing Then If e.Reason = GridQueryAllowDragColumnReason.ShowRedArrowIndicator Then e.AllowDrag = False End If End If Else End If Any ideas.

1 Reply

AD Administrator Syncfusion Team March 22, 2006 05:54 AM UTC

Hi Chris, A column can be prevented from moving by just comparing the e.Column and setting the e.AllowDrag property to False. Below is a code snippet. Private Sub GridGroupingControl1_TableControlQueryAllowDragColumn(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridQueryAllowDragColumnEventArgs) Handles GridGroupingControl1.TableControlQueryAllowDragColumn If e.Column = " UWI" Then e.AllowDrag = False End If End Sub Regards, Calvin.

Loader.
Up arrow icon