hi all ,
Need to restrict row selection or cell selection ..ie the row shud not be highlighted any help ..plz
Thanks in advance
You can turn off selection using the SelectTypeRow, SelectTypeCell, and SelectTypeCol properties on the Override.
The ActiveRow and ActiveCell in the grid will appear highlighted by default, so you can turn this off by going to grid.Displaylayout.Override and resetting the ActiveRowAppearance and ActiveCellAppearance.
Hi Mike:
Isnt there a way NOT to select (highlight) any row by default?
Override and resetting the ActiveRowAppearance and ActiveCellAppearance, seems to be a workaround.All I want is to display all the records and allow user to select and not show something selected by default.
Hi,
Okay, you seem to be mixing up Active and Selected. They are two completely different concepts and it's important to understand the difference.
By default, the grid will synchronize it's ActiveRow with the current Position of the DotNet CurrencyManager. The CurrencyManager will always have a current position (assuming that there is at least one row of data), so the grid will always have an ActiveRow.
You can turn off the ActiveRowAppearance and ActiveCellAppearance so that there is no special appearance applied to the active row, but there still has to be an active row because the CurrencyManager has one and the grid has no control over that.
It sounds to me like you want to turn off the ActiveRowAppearance and ActiveCellAppearance and then set SelectTypeRow to Single so that the user can select a single row. But make sure you use grid.Selected.Rows to determine the selected row in code and not ActiveRow.