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
 
Back
Top