U can use the following code
i) If the datasource is a data table then,
dgrd.DataSource.DefaultView.AllowNew = False
(dgrd is the Datagrid)
ii) If the datasource is a data set then,
dgrd.DataMember.DefaultView.AllowNew = False
(dgrd is the Datagrid)
iii) or u can directly set it as follows
objDataTable.DefaultView.AllowNew = False
(objDataTable is the table being displayed on the grid)
> Can anybody translate the C# code to VB.NET in this article? I translated it as such:
>
> Dim cm As CurrencyManager = Me.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember)
>
> Dim dv As DataView = cm.List
>
> dv.AllowNew = False
>
> but when I run the form, the Append row still appears.
>
> Please send your response via email to
[email protected] as well.