Preventing new records in a datagrid

  • Thread starter Thread starter Marco
  • Start date Start date
M

Marco

I'm sure that I'm missing something obvious but I can't see an option to
disable the addition of new records in the datagrid control. The closest
option I have seen is to make it read only but I want to still be able to
edit the existing records. How can I do this? Thanks.
 
Try setting the Datagrid itself to Read Only, and adding ColumnStyles for
the columns you wish to be editable, and set their readonly property to
false.

Hope this helps.
 
I had already tried that and unfortunately all the columns still get set to
read only.
 
Marco,

Use a dataview and than dataview.allownew = false

When you than want to add a row in code you have to set the dataview first
to allownew = true temporarly by the way.

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top