We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

FAQ: 5.5 How do I prevent the datagrid from displaying its append row

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 jerry@appdataworks.com as well.

7 Replies

II Iulian Ionescu January 5, 2003 04:02 PM

I do it like this, where ME is the datagrid: Dim dv As DataView dv = CType(Me.DataSource, DataView) dv.AllowNew = False > 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 jerry@appdataworks.com as well.


IS Isha March 11, 2003 10:27 PM

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 jerry@appdataworks.com as well.


JA ja September 5, 2003 02:29 PM

Ninguno funciona... :-(


JN Johnny Nguyen September 5, 2003 03:52 PM

I have a master-details datagrid with relations. And I tried all the method below (in VB.NET) and it did NOT seem to work. Can someone show how to make it work with Master-detail grid. Thanks in Advance > 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 jerry@appdataworks.com as well.


JN Johnny Nguyen September 8, 2003 11:40 AM

I have a master-details datagrid with a single relations. I can make it work for the master grid BUT I can NOT make it works for the details grid. Can someone show me how to make it work for the detail grid. Thanks in Advance > > > > > 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 jerry@appdataworks.com as well. >


MA Maddus October 20, 2003 06:37 AM

The defaultview works,.. myDataTable.DefaultView.AllowNew = False myDataGrid.DataSource = myDataTable Greetings


MA Mathieu January 19, 2004 03:22 PM

Where can i get this article? Am trying to do just this... in C# > 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 jerry@appdataworks.com as well.

Loader.
Live Chat Icon For mobile
Up arrow icon