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

Change grouping

Hi, How do I block a group of two columns, if you have a column grouped and the user from any other group in place.

"to put the grid outar remove the column that was already in the group" gridGroupingControl in VB.NET?

Follows as an attachment I want.

Thanks



What I want and I do not want_aaa4b968.zip

3 Replies

JJ Jisha Joy Syncfusion Team April 21, 2011 11:03 AM UTC

Hi,

You can achieve the desired behavior by handling the TableControlQueryAllowGroupByColumn event. It Occurs when the user drags a column header over the GroupDropArea. In your event handler, you can determine if the grid can be grouped by the selected column.

Regards,
Jisha



TO Tomio April 25, 2011 08:37 PM UTC

Good afternoon.
Thanks for the help, but I've already.
The code is as follows:

Private Sub gridGrouping_TableControlQueryAllowGroupByColumn(ByVal sender As System.Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridQueryAllowGroupByColumnEventArgs) Handles gridGrouping.TableControlQueryAllowGroupByColumn

e.AllowGroupByColumn = False

If e.Reason = GridQueryAllowDragColumnReason.MouseUp Then

gridGrouping.TableDescriptor.GroupedColumns.Clear()

gridGrouping.TableDescriptor.GroupedColumns.Add(e.Column)

End If

End Sub

Regards,
Tomio




AA Arulraj A Syncfusion Team May 9, 2011 05:07 AM UTC

Hi Tomio,

Thanks for the update

You can achieve the required behaviour by clearing the grouped columns collection in TableControlQueryAllowGroupByColumn event. The following code explains the same.

Private Sub gridGrouping_TableControlQueryAllowGroupByColumn(ByVal sender As System.Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridQueryAllowGroupByColumnEventArgs) Handles gridGrouping.TableControlQueryAllowGroupByColumn

Me.gridGroupingControl1.TableDescriptor.GroupedColumns.Clear()

End Sub


Regards,
Arulraj.A




Loader.
Live Chat Icon For mobile
Up arrow icon