How do you disable inserting new items into the grid?
3 Answers, 1 is accepted
answered on 12 Jun 2009, 05:18 AM
There are two properties that allow you to disable the insertion of new items. The first one, called IsReadOnly, will disable any modification of the grid data, including insertion of new items. The second one is CanUserInsertRows, which only controls the insertion behavior. If set to false you will not be able to insert new rows, but you will be able to edit cells, etc.
I must be missing something very obvious, but CanUserInsertRows is not a property on the gridview itself is it? I can't seem to find it. I don't want the entire grid to be read-only, I just want to stop the user from being able to insert rows by hitting the "Insert" key.
answered on 15 Jun 2009, 06:16 AM
The property CanUserInsertRows is defined on GridViewDataControl . The RadGridView inherits from GridViewDataControl so you should be able to use that property when dealing with both RadGridView and GridViewDataControl.
When you set CanUserInsertRows to false the users will not be allowed to create new rows but they will be able to edit the existing ones.