We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Giving Relation in Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

56836 Feb 21,2007 03:53 PM UTC Feb 22,2007 11:48 AM UTC Windows Forms 2
loading
Tags: GridControl
Kiran
Asked On February 21, 2007 03:53 PM UTC

I am using vs 2005. i have problem for giving relation in GridGroupingControl. I am using a datatable as my parentTable and want to use TableDescriptor as childTable(because i have to span columns in child table). so is there any way to give relation between those two. plz help me to get out of this problem.

Thanks,
Kiran

Administrator [Syncfusion]
Replied On February 21, 2007 07:59 PM UTC

Hi Kiran,

The Manual Relation-Masterdetails sample demonstrates how to manually specify the master-detail relations between three separate tables that have primary key and foreign key columns in common. You can manually specify relations in the grouping engine. The DataSet does not need to have any DataRelations. This is the same approach that should be used if you want to set up relationships between independent IList collections.

Here is a sample
RelatedMasterDetails.zip

Best regards,
Haneef

Kiran
Replied On February 22, 2007 11:48 AM UTC

Hi Haneef,
Thank you for giving reply for my message.
But my actual problem is this when i give any relation to its child it will not open within the parent.

my code is like

This will fill my YearTable with require field

DataTable YearTable = new DataTable();
YearTable = GetYearTable();
YearTable.Name = "YearTable";

And then this will give all the relation ship between DataTable and GridTableDescritor

GridTableDescriptor td = new GridTableDescriptor();
GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor();

td.Name = "FreqTable";
parentToChildRelationDescriptor.ChildTableName = td.Name;
parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;
parentToChildRelationDescriptor.RelationKeys.Add("Id", "ID");
parentToChildRelationDescriptor.Name = "ParentToChild";
this.gridGroupingControl1.TableDescriptor.Relations.Add(parentToChildRelationDescriptor);


this.gridGroupingControl1.Engine.SourceListSet.Add("YearTable", YearTable);

//Here td is my GridTableDescriptor in which i manually added some columns using gridcloumndescriptor and then span it using GridColumnSpanDescriptor
and then set it in a gridColumnSetDescriptor
atfer this i add this to td.

td = this.gridGroupingControl1.Engine.TableDescriptor.Relations["ParentToChild"].ChildTableDescriptor;
this.gridGroupingControl1.DataSource = YearTable;

but here its not comes the way i want. i just want a DataTable as a Parent Table and GridTableDescriptor as Child Table. To Achive This what i have to do? Plz guide me for this problem.

Thanks,
Kiran

CONFIRMATION

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.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;