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.
based on the LINQToSQL sample provided with syncfusions essential grid I would like to implement a foreignkeyreference for a lookup table.
Therefore I took the ListItemRefernce part of the sample. Now I would like the CategoryID column behave like in the samples for ForeignKeyReference (i.e. have a dropdown box to chose the values from).
But I can't figure out how to do it. Can anyone give me some hints?
OK, maybe my cenario is not clear enough. This is what I want to do:
From the NorthWind database I take the tables "Products" and "Categories" which have a foreign key relationship defined on the fields Products.CategoryID and Categories.CategoryID
Now I want to use a GroupingGridControl with a ForeignKeyRefernce, but I can't get it work.
This is what I have so far in my form1_load event:
ggcProducts is of type GridGroupingControl bsProducts is of type BindingSource
Dim productsTD As GridTableDescriptor = ggcProducts.TableDescriptor
Dim categoryRD As New GridRelationDescriptor categoryRD.Name = "Category" categoryRD.MappingName = "Categories" categoryRD.RelationKind = RelationKind.ForeignKeyReference categoryRD.RelationKeys.Add("CategoryID", "CategoryID")
productsTD.Relations.Add(categoryRD)
ggcProducts.DataSource = bsProducts Dim query = From p In dcNorthWind.Products Select p bsProducts.DataSource = query
All I get is a Grid with all the columns of the products table, but the CategoryID column is a standard text column with no drop down to chose the values from.
Can anyone give me some hints what I'm doing wrong?
BTW I'm using LINQtoSQL; which is a must for the project I'm evaluating the GroupingGridControl
Yours Detlef
ADAdministrator Syncfusion Team August 29, 2008 01:22 PM UTC
Hi Detlef,
Thanks for your interest in Syncfusion products.
You can refer our shipped browser sample that implements the LINQ to SQL feature of 3.5 .NET Framework with our Essential Grouping Grid Control. It generates language-integrated queries for data retrieval, which means that the relational data is represented as objects in these queries. These queries will then be translated into sql queries that interact with the database. The tabular results are then translated back into the objects the user defines. These objects can then be manipulated in our applications, for example they can be bound to a grid control for display.
By using these Language-Integrated Queries, we can get more benefits as of the languages like compile time verification and design time features like IntelliSense.
You can refer the ListItemReference relation browser sample which shows the relationkind of ListItemReference. It is an object reference relation for looking up values from a strong typed collection.