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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Composite foreign keys/Data bound grid

Thread ID:





20359 Oct 14,2004 10:33 PM UTC Oct 15,2004 12:09 PM UTC WinForms 2
Tags: GridControl
Asked On October 14, 2004 10:33 PM UTC

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 04:53 AM UTC

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.

Replied On October 15, 2004 12:09 PM UTC

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?


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon