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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Foreign key reference

Thread ID:





28679 May 6,2005 03:46 PM UTC May 6,2005 04:42 PM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On May 6, 2005 03:46 PM UTC

I experience some strange behaviour with the grouping grid and foreing key reference. I have a main DataTable used as data source for the grid and foreign key DataTable used as the SourceListSet. As long as both tables are in the same DataSet, everything works fine. However, if the two DataTables are in different DataSets the foreign key doesn''t work anymore. (No drop down arrow and a null reference error if I try to enter anything in the joined column.) I set up the foreign key lookup like this: gridControl.Engine.SourceListSet.Add(lookupTable.TableName, lookupTable); GridRelationDescriptor grd = new GridRelationDescriptor(); grd.Name = lookupTable.TableName; grd.RelationKind = RelationKind.ForeignKeyReference; grd.ChildTableName = lookupTable.TableName; // SourceListSet name for lookup grd.RelationKeys.Add(mainTableKey, lookupTableKey); mainTableDescriptor.Relations.Add(grd); This works if lookupTable is in the same DataSet as the main DataTable but not otherwise. In fact it seems like the grid ignores the provided lookupTable and instead searches for a table with the provided name in the main DataSet. Is it not possible to use a lookupTable from a different DataSet? Am I missing something here?

Administrator [Syncfusion]
Replied On May 6, 2005 04:42 PM UTC

Here is a sample with the main table and the foreign key table in 2 different datasets. It seems to work OK. http://www.syncfusion.com/Support/user/uploads/GGC_ForeignKeyReference_a924c4a.zip


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