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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ggc only sorting one way (ascending) and not the other way (descending)

Thread ID:





54029 Dec 28,2006 04:05 AM UTC Jan 4,2007 09:09 AM UTC WinForms 4
Tags: Grouping
James Blibo
Asked On December 28, 2006 04:05 AM UTC

I have a ggc with a checkbox in the first column (header and records). When I click the any column in the header to sort, the ggc sorts by that column in ascending order. However, when I click the header again, the ggc will not sort in descending order. What gives?

Administrator [Syncfusion]
Replied On December 28, 2006 07:33 AM UTC

Hi James,

Please try to provide us some more information on this issue. I tried to reproduce the issue, but couldn't. kindly provide us a sample to reproduce the issue or modify any broswer sample accordingly.

Thanks for your patience.


James Blibo
Replied On December 28, 2006 03:25 PM UTC

This grid is part of a larger project, so I just pull out the relevant code that affects this grid. I've attached the code.

I ggc basically have a checkbox in the first column (header and rows). This is a bounded column from the datasource. I'm also using a custom user control celltype as a dropdown from from one of your samples in the grid.

The ggc would just sort in one direction and not the other for each column.


James Blibo
Replied On December 29, 2006 03:37 AM UTC

Ok! I think I firgure out what's going on!

I am handling the fllw events in the grid...

this.gridGroupingControl2.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(gridGroupingControl2_QueryCellStyleInfo);
this.gridGroupingControl2.SaveCellText += new Syncfusion.Windows.Forms.Grid.GridCellTextEventHandler(gridGroupingControl2_SaveCellText);
this.gridGroupingControl2.TableControlCellClick += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventHandler(gridGroupingControl2_TableControlCellClick);
this.gridGroupingControl2.TableControl.MouseUp += new MouseEventHandler(TableControl_MouseUp);
this.gridGroupingControl2.TableControlCheckBoxClick += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventHandler(gridGroupingControl2_TableControlCheckBoxClick);
this.gridGroupingControl2.TableControlCurrentCellMoving += new GridTableControlCurrentCellMovingEventHandler(gridGroupingControl2_TableControlCurrentCellMoving);

However, when I comment out the TableControl_MouseUp event, the grid now sorts in both direction.

However, I am using the TableControl_MouseUp event because I saw this in an example on this forum about having a checkbox in the header column. Will commenting out this code just to make sorting in both direction works means that the checkbox in the header NOT worked?

Administrator [Syncfusion]
Replied On January 4, 2007 09:09 AM UTC

Hi James,

Thank you for being patience.

The reason for this issue is because the TableControlMouseUp event has been handled for all columns. You can avoid this by checking for the checkbox column and according raising the MouseUp for the respective cell renderer. The following is the code snippet

>>>>>>>>>>Code Snippet<<<<<<<<<<<<<
private void TableControl_MouseUp(object sender, MouseEventArgs e)
int row, col;
this.gridGroupingControl1.TableControl.PointToRowCol(new Point(e.X, e.Y), out row, out col);
GridTableCellStyleInfo style = this.gridGroupingControl1.TableControl.Model[row, col];
if(style.TableCellIdentity.Column.MappingName.Equals("Col3")) // Col3 is CheckBox column
IMouseController controller;
this.gridGroupingControl1.TableControl.MouseControllerDispatcher.HitTest(new Point(e.X, e.Y), e.Button, e.Clicks, out controller);
if(controller.Name == "DragGroupHeader")
this.gridGroupingControl1.TableControl.GetCellRenderer(row, col).RaiseMouseUp(row, col, e);

Please let us know if you need any further assistance.
Have a nice day.

Best regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon