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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

2314 Jan 5,2003 08:44 AM Jan 19,2004 03:22 PM Windows Forms 7
loading
Tags: FAQ
Jerry Boutot
Asked On January 5, 2003 08:44 AM

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.

Iulian Ionescu
Replied On 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.

Isha
Replied On 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
Replied On September 5, 2003 02:29 PM

Ninguno funciona... :-(

Johnny Nguyen
Replied On 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.

Johnny Nguyen
Replied On 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. >

Maddus
Replied On October 20, 2003 06:37 AM

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

Mathieu
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;