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 am having problems figuring out the relations to use in order to generate a Lookup dropdown in the GGC. I was able to figure out how to do the Parent/Child relationship using the UniformChildList, but the other relationship types don''t seem to work unless binding to a DataSet.
Has anyone done this before? I can post sample code if what I''m looking for is unclear.
Thank you.
Jay
STstanleyj Syncfusion Team January 31, 2006 10:02 AM UTC
Hi Jay,
Please refer the sample in \Syncfusion\Essential Studio\4.1.0.51\windows\Grid.Grouping.Windows\Samples\StrongTypedCollection folder.
Best regards,
Stanley
JMJay MooneyJanuary 31, 2006 02:28 PM UTC
Hi Stanley,
I did refer to that sample. The sample shows you how to setup a Master/Detail relationship. But it doesn''t show you how to do a Lookup relationship.
Any other suggestions?
JMJay MooneyJanuary 31, 2006 02:33 PM UTC
Specifically I''m looking for how to use
ListItemReference or ForeignKeyReference with my business objects.
JMJay MooneyJanuary 31, 2006 03:39 PM UTC
I figured it out. Here''s my solution in case anyone else can benefit from it:
_countries is a BindingList
Country has some public fields, and a "UserId" column that is a reference to the _users collection.
_users is a BindingList
User has 2 fields Id and Name
Step 1: Add both collections as sourceListset items for the GGC
gridGroupingControl1.SourceListSet.Add(new SourceListSetEntry("COUNTRIES", _countries));
gridGroupingControl1.Engine.SourceListSet.Add(new SourceListSetEntry("USERS", _users));
Step 2: Define the GridRelationDescriptor, using a ForeignKeyReference, and setting the RelationKeys appropriately for the _users and _countries collections.
GridRelationDescriptor rdLookup = new GridRelationDescriptor();
rdLookup.Name = "UsersFKLookup";
rdLookup.MappingName = "Users";
rdLookup.ChildTableName = "USERS";
rdLookup.RelationKind = RelationKind.ForeignKeyReference;
rdLookup.RelationKeys.Add("UserId", "Id");
rdLookup.ChildTableDescriptor.VisibleColumns.Add("Name");
rdLookup.ChildTableDescriptor.SortedColumns.Add("Name");
rdLookup.ChildTableDescriptor.AllowEdit = false;
rdLookup.ChildTableDescriptor.AllowNew = false;
Step 3: Add the relation descriptor to the table''s relations.
gridGroupingControl1.TableDescriptor.Relations.Add(rdLookup);
Step 4: Associate the _countries collection with the GGC''s DataSource. gridGroupingControl1.DataSource = _countries;