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

SelectionChanged event in GridControl.

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

4 Replies

AD Administrator Syncfusion Team 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.


AP Andrey Plinda 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!


AD Administrator Syncfusion Team 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");
	}
}


AP Andrey Plinda July 22, 2004 07:10 AM UTC

Thanks! :)

Loader.
Up arrow icon