Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid Delete Row? 1

Status
Not open for further replies.
Nov 19, 2003
117
0
0
US
Is there anyway to restrict the delete key from deleting a row in my datagrid?

Sincerely,
Fritts
 
You can make the DataGrid itself unrepsonsive to a Delete with

Dim cm As CurrencyManager = CType(Me.BindingContext(DataGrid.DataSource, DataGrid.DataMember), CurrencyManager)
CType(cm.List, DataView).AllowDelete = False

I found that in the documentation a long time ago and use it whenever I want to make a DataGrid that you can't delete from. I don't really understand all of what it does but it works for me. I think that's what you were asking for?
 
Thanks Felechaji,
that tip worked out beautifuly i don't get it but it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top