Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Equivalent of AllowAddNew property in VFP to .Net grid
Message
De
31/08/2005 01:11:07
 
 
À
30/08/2005 23:51:09
Rene Lovino
Bigfoot Global Solutions, Inc
Cebu, Philippines
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 1.1
OS:
Windows 2000
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01045089
Message ID:
01045388
Vues:
29
Rene,

And is your grid's datasource set like this:
this.MyGrid.DataSource = dsCustomers1.Tables["Customer"];
If so, that AllowNew setting should work.

My guess is that your DataSource is a different DataView based on the Customer table. If that's the case, then you need to set the AllowNew on that view:
DataView MyView = new DataView(dsCustomers1.Tables["Customer"]);
MyView.AllowNew = false;
this.MyGrid.DataSource = MyView;
~~Bonnie




>Hi Kevin,
>
>I have tried using the following code:
>dsCustomers1.Tables["Customer"].DefaultView.AllowNew = false;
>
>But still it allows to add data using arrow down key.
>
>
>Rene
>
>>Hi, Rene,
>>
>>For the datatable bound to the grid, you'll need to do the following:
>>
>>
MyTable.DefaultView.AllowNew = false
>>
>>Let me know if that helps
>>Kevin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform