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

SelectionChanged event in GridControl.

Thread ID:





16639 Jul 21,2004 11:40 AM UTC Jul 22,2004 07:10 AM UTC WinForms 4
Tags: GridControl
Andrey Plinda
Asked On July 21, 2004 11:40 AM UTC

Hello! I am using SelectionChanged event to change data sorting mode. After I allow user to move column by setting property "AllowDragSelectedCols" to true, this event fire more rarely as earlier. Can I get around this problem? Best regards. ColumnSelection_9857.zip

Administrator [Syncfusion]
Replied On July 21, 2004 12:05 PM UTC

I am not exactly sure I understand the problem. Are you commenting on the fact that SelectionsChanged does not fire when you move columns? If the user mouses down on the headers of selected columns and drags them, then the SelecttionsChanged event is not raised. This is by design. If you want to catch this particular action, maybe you could use the grid.ColsMoved event that does fire in this case.

Andrey Plinda
Replied On July 22, 2004 03:18 AM UTC

Hello! I mean that before allowing user drag columns SelectionChanged event fire every time as user click on column caption. After allowing column''s drag - only first time. I need event that will fire by every click on column''s caption, even if column''s drag is allowed. Best regards!

Administrator [Syncfusion]
Replied On July 22, 2004 04:51 AM UTC

As suggested above, you could use both events mentioned in my previous response, and this would catch both cases. Or if you want to catch a mousedown on a column header cell, then you can use the GridControlMouseDown event and test for the hit of a column header.
private void gridControl1_GridControlMouseDown(object sender, Syncfusion.Windows.Forms.CancelMouseEventArgs e)
	int row, col;
	Point pt = new Point(e.MouseEventArgs.X, e.MouseEventArgs.Y);
	if(this.gridControl1.PointToRowCol(pt, out row, out col, -1)
		&& row == 0 && col > 0)
		Console.WriteLine("MouseDown on col header");

Andrey Plinda
Replied On July 22, 2004 07:10 AM UTC

Thanks! :)


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

Live Chat Icon For mobile
Live Chat Icon