Hi Dan,
here are some code snippets from the HierarchyView sample that display a foreign key table in a dropdown list:
gridColumnDescriptor5.Appearance.AnyRecordFieldCell.CellType = "GridListControl";
gridColumnDescriptor5.Appearance.AnyRecordFieldCell.DataSource = this.shippersDataSet1.Shippers;
gridColumnDescriptor5.Appearance.AnyRecordFieldCell.DisplayMember = "CompanyName";
gridColumnDescriptor5.Appearance.AnyRecordFieldCell.ValueMember = "ShipperID";
gridColumnDescriptor5.Appearance.AnyRecordFieldCell.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Left;
gridColumnDescriptor5.MappingName = "ShipVia";
gridColumnDescriptor5.Width = 158;
gridRelationDescriptor1.ChildTableDescriptor.Columns.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor[] {
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("OrderID"),
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("CustomerID"),
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("EmployeeID"),
gridColumnDescriptor5,
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("Freight"),
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("ShipName"),
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("ShipAddress"),
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("ShipCity"),
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("ShipRegion"),
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("ShipPostalCode"),
new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor("ShipCountry")});
In that sample, the foreign key table is in a separate dataset which is the best way to do it.
There is also another alternative that is a bit more complicate and I am not sure how well that works for you. We will add support for foreign key relations in future, but the sample gives a first glimpse how this will look like. It is implemented using TableDescriptor_QueryValue and TableDescriptor_SaveValue. It shows data from a foreign table as columns in the records of the main table.
This is the sample:
ForeignKeyGrid_938.zip
Stefan