disable Inserting new records into a datagrid?

desperado

Well-known member
Joined
Oct 7, 2006
Messages
68
Programming Experience
Beginner
Hi, I want to disallow the user from inserting new records on that DataGrid, but I cannot find a way to do this. Is there a way to prevent a user from inserting a new row through the DataGrid. The data that gets entered into the datagrid is by using select statements.

Im using vb.net 2003.

Thanks
 
In design time.... properties of the grid, there should be one called "AllowInserts" or something close to that. Set it to false.

-tg
 
With the DataGrid control I have used this code to disallow new rows:
VB.NET:
Dim cm As CurrencyManager = BindingContext(gridDisplay.DataSource, gridDisplay.DataMember)
Dim dv As DataView = cm.List
dv.AllowNew = False
 
Thanks for both your suggestions, the problem is solved now.

Thanks a million both of you.
 
Last edited:
Back
Top