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?
ADAdministrator Syncfusion Team July 21, 2004 07:05 AM
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.
APAndrey PlindaJuly 21, 2004 10:18 PM
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.
ADAdministrator Syncfusion Team July 21, 2004 11:51 PM
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");