GridView according to documentation is readonly when Optionsbehavior.Editable is set to false. When internal navigator is used the + and - buttons ar enabled and work. Also calling deleteRow deletes the row without checking the editable property.
If a view is non editable then it is expected to be readonly from all ways of interaction including calling of function. But at least it sould prevent the user interface to add or remove rows.
Workaround
C#gridView1.OptionsBehavior.Editable = false;
gridControl1.EmbeddedNavigator.Buttons.Append.Visible = false;
gridControl1.EmbeddedNavigator.Buttons.Remove.Visible = false;
This workaround does not work well. The grid may (and in my case does) have many views, others editable others not but the navigator is single instance. And I know I can handle the focusedview changed event and make the changes myself.
So in this case at least it sould be some property to set this kind of behavior.
On second thought, I think that it would be much more functional to have properties for the 3 functions (append, edit,delete) seperately. So if someone wants to get a full readonly grid, could set all 3 properties to false. But on some other cases (like mine at the moment) someone would like to allow inserts and updates but not deletes
thanks
Spyros
Its been a year since I mention this issue
Its quite a bug to set the gridview editable property to false an still can add and delete rows
I think its quite common to business logic to have a way to allow or not adding, editing, deleting row.
Is there any news about this issue?
Hi Spyros,
I'm sorry, but I cannot give you any estimate, because we have not established any release date for this feature. We will notify you about our progress over on this feature. Sorry for any inconvenience.
Thanks,
Andrew
Following two options have been added:
ColumnView.OptionsBehavior.AllowDeleteRows (DefaultBoolean)
ColumnView.OptionsBehavior.AllowAddRows (DefaultBoolean)
(If equals "Default" then Editable state is used)