Hi,
Is there a way to deselect the first line of ultragrid by default? I know it is not selected but activated but if you select other rows, when you browse the selected rows there is also the first row in the Count property.
why is there this behavior?
I have try with different solutions that i found in other topics but don't work
As you pointed out, the first row in the grid is NOT selected. It's just highlighted because it's the ActiveRow. But I'm quite puzzled as to what you mean by "when you browse the selected rows there is also the first row in the Count property."
That is not the case. The grid does not select the first row, so initially the grid.Selected.Rows.Count is 0. If you are seeing a selected row and your user has not selected a row, then something else in your code must be doing that.
Perhaps there is something in your code that is always selected the active row? In grid_AfterRowActivate, maybe?
You might want to hook the BeforeSelectChange event of the grid and look at the call stack (assuming it's firing) to see where that selected row is coming from.
Hello Ca,
In order to prevent the first row of the UltraGrid from being activated, you can set the SyncWithCurrencyManager property of the grid to “false.” The reason this happens by default is because the grid automatically synchronizes its ActiveRow with the current position of the .NET BindingManager and setting this property to false will prevent that.
Please let me know if you have any other questions or concerns on this matter.