How to Forbid user to add new rows in datagrid?

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
L

Lars Netzel

I have a grid that I want users to be able to chaneg values in in all cells
but NOT to add or delete Rows.

is this possible?

Best Regards
/Lars Netzel
 
Use a DataView as DataSource of your grid.
Look at the properties of the DataView class.

Ernest
 
Aha, great thanx, it was exactly what I wanted

AllowDelete = False

..AllowEdit = True

..AllowNew = False


/Lars
 
Dim cm As CurrencyManager =
CType(Me.BindingContext(dataGrid1.DataSource, dataGrid1.DataMember),
CurrencyManager)

CType(cm.List, DataView).AllowNew = False
 

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