Grid Relationship Descriptor Help

Hi,
Please can you help with my problem. I have looked at the ForeignKeyReference and RelatedMasterDetail examples, but cannot quite understand how to do the following.

I have two dataTables where the respective records in each are as follows:

Table1: Entity_One(id, name)
Table2: Entity_Two(id, symbol, formula, price)

Where the primary key for Entity_One is {id}, and for Entity_Two it is {id, formula}. id is a foreign key in Entity_Two from Entity_One.

The relationship is such that for each entry in Entity_One, there are multiple entries in Entity_Two with matching ids.

I would like to display this info in two separate grid grouping controls, with relationships set up so that my 'parent' grid shows Entity_One entries plus the related formula's from Entity_Two in a drop down list, and the price associated with the currently selected formula.

The 'child' grid should show all of the entries from Entity_Two, for the currently selected id in the 'parent' grid.

Please can you explain how relationship descriptors can be used to accomplish this?


Thanks for you help.

Chris

3 Replies

AD Administrator Syncfusion Team February 9, 2007 09:43 PM UTC

Hi Chris,

You can refer the ForeignKeyKeyWordsRelation browser sample (\Grid.Grouping.Windows\Samples\RelationsAndHierarchy\ForeignKeyKeyWords) that demonstrates a unique relation kind called ForeignKeyKeyWords, that exists between the tables in a dataset. This is a foreign key relation where matching keys in the columns of the parent and child table, define a relationship between the two tables. This is a m:n relation. Field summaries of the related child table can be referenced using a . dot in the FieldDescriptor.MappingName of the main table.

Here is a path.
[install drive]\Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Grouping.Windows\Samples\RelationsAndHierarchy\ForeignKeyKeyWords\

Sample : ForeignKeyKeyWords.zip

Best regards,
Haneef


AD Administrator Syncfusion Team February 13, 2007 03:31 PM UTC

Hi,

This is ok as a start but does not really help me with my problem. The example displays all of the possible values in the second datatable while I would like to be able to specify which columns to show and how.

If it is not too much trouble, please can you provide a more suitable example?


AD Administrator Syncfusion Team February 14, 2007 12:42 AM UTC

Hi Chris,

You can use the VisibleColumns property of the GridTableDescriptor to show / hide / move the columns in the grid. Below is a code snippet

//For hide the "Col0" column
this.grid.TableDescriptor.VisibleColumns.Remove("ColumnName");

//For show the "Col0" column
this.grid.TableDescriptor.VisibleColumns.Add("ColName");

Here is a forum thread that discuss with simillar issue.
http://www.syncfusion.com/support/forums/message.aspx?MessageID=55885

Best regards,
Haneef

Loader.
Up arrow icon