Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shaped Entities
Message
 
À
24/12/2008 09:05:03
Tegron Tegron
Platinum Technologies
Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Versions des environnements
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01368835
Message ID:
01369648
Vues:
15
>The last solution actually works great. Thanks. The problem I was having was not fully understanding the entity object. Since I didn't have the fields defined in the default entity, I wasn't seeing the referenced fields. So I decided to standardize on adding a description field for each coded id in an entity. This way the value is null when I don't need it, and it will contain values when I use a different shaped entity.
>
>I am considering the possibility of maybe re-instantiating another instance of the business object using a different entity from the default for the object by maybe passing a value to override the creation of default entity and instead use the list entity.

Tegron,
I have also accomplished what you wanted without a separate dataset by changing the type of control on your grid from DataGridViewTextBoxColumn to DataGridViewComboBoxColumn for the fields that are foreign keys. You will have to add code to indicate the BindingSource, etc for the combo. For example, I have a foreign key into a table Relation from a grid named grdContactPersonal. The code to set that up is listed below:
            DataGridViewComboBoxColumn dgvccRelation = (DataGridViewComboBoxColumn)grdContactPersonal.Columns["RelationColumn"];
            dgvccRelation.DataSource = oRelation.GetCurrentDataSet().Tables["Relation"];
            dgvccRelation.ValueMember = "RelationCode";
            dgvccRelation.DisplayMember = "Description";
That way you still have your entity and you don't need extra to link the data between two datasets.
Linda Harmes
HiBit Technologies, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform