The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
ADAdministrator Syncfusion Team 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