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
close icon

Composite foreign keys/Data bound grid

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?

2 Replies

AD Administrator Syncfusion Team 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.


JO Josh 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?

Loader.
Live Chat Icon For mobile
Up arrow icon