PC Review


Reply
Thread Tools Rate Thread

AllowAddNew datagrid property in .NET

 
 
Li Pang
Guest
Posts: n/a
 
      2nd Sep 2003
Hi,

Is anyone knows the equivalence of VB6 datagrid
property "AllowAddNew" in VB.NET?

Thanks

Li
 
Reply With Quote
 
 
 
 
Ken Tucker
Guest
Posts: n/a
 
      2nd Sep 2003
Hi,

There is not an allowaddnew property in the datagrid. The closest
thing is readonly. That allows you to edit or add new cells.

Ken
--------------
"Li Pang" <(E-Mail Removed)> wrote in message
news:098601c3714f$b6104320$(E-Mail Removed)...
> Hi,
>
> Is anyone knows the equivalence of VB6 datagrid
> property "AllowAddNew" in VB.NET?
>
> Thanks
>
> Li



 
Reply With Quote
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      2nd Sep 2003
Li,
As Ken stated, the VB.NET DataGrid itself does not have an AllowNew
property.

However the DataView object that the DataGrid ultimately gets bound to does
support an AllowNew property.

When you bind a DataGrid to a Dataset & table name (or to a DataTable) the
DataGrid uses the DataTable.DefaultView property to actually bind to.

Instead of binding to a DataSet & table name I would recommend binding to a
DataView. Associate this DataView with your DataTable from your DataSet,
then set the AllowNew property on this DataView to false. Alternatively you
may be able to change the DataView returned from DataTable.DefaultView, but
remember to change it back when you want to allow adding records...

DataView is in the System.Data namespace along with DataSet & DataTable.

Hope this helps
Jay

"Li Pang" <(E-Mail Removed)> wrote in message
news:098601c3714f$b6104320$(E-Mail Removed)...
> Hi,
>
> Is anyone knows the equivalence of VB6 datagrid
> property "AllowAddNew" in VB.NET?
>
> Thanks
>
> Li



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid AllowSorting property Carl Tribble Microsoft VB .NET 2 9th Oct 2004 08:37 PM
Re: currentcell property of datagrid Sijin Joseph Microsoft Dot NET Framework Forms 0 4th Aug 2004 01:32 PM
Using DataGrid in a form makes the TopMost property invalid -- DataGrid bug? Sajjadul Hakim Microsoft C# .NET 0 5th Apr 2004 03:26 PM
Readonly property in DataGrid James Wong Microsoft Dot NET Compact Framework 1 3rd Feb 2004 12:15 AM
Readonly property in DataGrid James Wong Microsoft Dot NET Compact Framework 1 20th Jan 2004 10:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:13 AM.