Home - Forums-.NET - FlyGrid.Net (Windows Forms) - How to disable user selection?

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

How to disable user selection?
Link Posted: 12-Mar-2007 04:03
I have a grid where I set selected node myself in code. I dont want to allow user to change selection (in any way - by keys or mouse).

I tried several combinations of grid options but gave up. I set grid.Enabled = false. And it works perfectly... Until you need to scroll it.. And then you cannot.

How can I disable selection through UI and still be able to select in code?

Thank you
Link Posted: 14-Mar-2007 02:42
Thanks for your suggestion - the nearest FlyGrid.Net update will support scrolling when FlyGrid is disabled.
Link Posted: 14-Mar-2007 07:04
I think it is better (and simpler) to introduce new FlyGrid.Option (not FlyGrid.Rows.Option) AllowSelect which will enable/disable user ability to change selection (but ensure that programmatic control still can do that)...

Enabling scroll whilst the control.Enabled = false is not what Control class supposed to do (if it is possible at all)... I think .NET architects will be upset
Link Posted: 14-Mar-2007 11:19
Yes, it would be better, once again for the suggestion. We'll try to implement this option to the end of this week.
Link Posted: 15-Mar-2007 01:11
No problem. Thank you for the prompt answer!
Link Posted: 21-Mar-2007 00:17
I have tested 1.4.5.2 for DisableUserSelection.

It does work. Thank you..

But there is a little inconsistency now that I consider a bug:

If you move selection by user actions (keys or mouse) the NodeSelectedChanging event fires as below:
- node1.Selected == true,  grid.Selected == node1
- node2.Selected == false, grid.Selected == node1

If I move selection by code it fires as:
- node1.Selected == true,  grid.Selected == node1
- node2.Selected == false, grid.Selected == null

It was in previous version as well. I just spotted it.

Could you please fix that as well ?

Thank you