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

Foreign keys

Hi, I need to show 2 tables joined by a foreign key, within one grouping grid. Both the datatables are part of 1 dataset. They are joined together using GridRelationDescriptor. I am facing 3 issues 1. The master table does not show a default record, this has no entries in child table. 2. Only the relation column from the master table is visible on the grouping grid. 3. When i use the drop down, I see a complete list of records in the child table. The list in the drop down needs to be driven off of the value in COlumn1 of parent table. Any help will be greatly appreciated. Regards, Rishi

3 Replies

AD Administrator Syncfusion Team April 11, 2005 09:46 PM UTC

Hi Rishi, I am not sure I understood your questions. But let me try. If you think I misunderstood pleae post more details. 1. Check out the ForeignKeyReference example. In the first row is an AddNew row. You can drop data from the related foreign table and add a row to the master table. How is this different in your case? 2. You can define the appearance of the related table using the GridRelationDescriptor.ChildTableDescriptor. You can add and remove columns. You can also modify the default set of columns that should be visible with Engine.ShowRelationFields. Try setting Engine.ShowRelationFields = ShowRelationFields.ShowAllRelatedFields; 3. I think you are referring here to a multiple foreign key scenario. Check out the MultipleColumnForeignKeys example. If you add multiple relation keys then the dropdown will be dependant on the first column in that table, e.g. GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor(); parentToChildRelationDescriptor.Name = "Child"; parentToChildRelationDescriptor.ChildTableName = "MyChildTable"; // same as SourceListSetEntry.Name for childTable (see below) parentToChildRelationDescriptor.RelationKind = RelationKind.ForeignKeyReference; parentToChildRelationDescriptor.RelationKeys.Add("ForeignCategoryID", "CategoryID"); parentToChildRelationDescriptor.RelationKeys.Add("ForeignInsideCategoryID", "InsideCategoryID"); Stefan >Hi, > >I need to show 2 tables joined by a foreign key, within one grouping grid. >Both the datatables are part of 1 dataset. They are joined together using GridRelationDescriptor. >I am facing 3 issues >1. The master table does not show a default record, this has no entries in child table. >2. Only the relation column from the master table is visible on the grouping grid. >3. When i use the drop down, I see a complete list of records in the child table. The list in the drop down needs to be driven off of the value in COlumn1 of parent table. > >Any help will be greatly appreciated. > >Regards, >Rishi >


RT Rishi Tandon April 12, 2005 05:14 AM UTC

Hi Stefan, Please could you pass on the examples, you mention, to me. Thanks, Rishi


AD Administrator Syncfusion Team April 12, 2005 02:09 PM UTC

Hi Rishi, you can find these samples in the following location of your Essential Suite 3.x installation: C:\Program Files\Syncfusion\Essential Suite\3.0.1.0\Windows\Grid.Windows\Samples\Grouping\ForeignKeyReference and C:\Program Files\Syncfusion\Essential Suite\3.0.1.0\Windows\Grid.Windows\Samples\Grouping\MultipleColumnForeignKeys Stefan >Hi Stefan, > >Please could you pass on the examples, you mention, to me. > >Thanks, >Rishi

Loader.
Live Chat Icon For mobile
Up arrow icon