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.

Composite foreign keys/Data bound grid

Thread ID:

Created:

Updated:

Platform:

Replies:

20359 Oct 14,2004 06:33 PM Oct 15,2004 08:09 AM Windows Forms 2
loading
Tags: GridControl
Josh
Asked On October 14, 2004 06:33 PM

How do you bind the data bound grid to a dataset that contains a following schema structure such as: OrderDetails(OrderID, CustomerID, ProductID, Price....) OrderID AND CustomerID are a composite foreign key into the Orders table Orders(OrderID, CustomerID......) OrderID AND CustomerID together make up the primary key of this table The MappingName property only seems to support one column - how do you bind it to support a composite foreign key structure such as what is listed above?

Administrator [Syncfusion]
Replied On October 15, 2004 12:53 AM

If I understand what you are describing (main table having multiple foreign key columns, and you want to display a particular value from the foreign table instead of the foreign), you can do this using ComboBox columns. Set the style.DataSource to the foriegn table, set the style.DisplayMember and style.ValueMember from the columns of the foreign table as well. The ValueMember should also match the value from the main table. If you do not want to see the combo button, als set grid.ShowsButtons = GridShowButtons.None.

Josh
Replied On October 15, 2004 08:09 AM

Correct, except in this case, the foreign key in the main table is TWO columns - one foreign key composed of two columns, not one. How do you set up the relationships in this case?

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.

;