Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shaped Entities
Message
From
25/12/2008 12:17:35
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Environment versions
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01368835
Message ID:
01369717
Views:
18
>>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.

Good Point Linda and there is an example of this exact method in the Jump Starts with Employee and Shipper. They both display a combo box with joined biz obj and display the currently linked record.
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform