Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
13338 | Apr 27,2004 02:53 AM UTC | Apr 27,2004 09:18 PM UTC | WinForms | 4 |
![]() |
Tags: Grouping |
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
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.