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. Image for the cookie policy date

Multiple data soruces

Using the grouping grid and CollectionBase datasources, is it possible to display a parent child type relationship as it is with DataSets? I''d be using a DataSet, except the performance is terrible at best. In any event, Class A has say 2 Col''s, A and B. Col B has 2 col''s, A and C. ( The A''s from each being the same data, Class A will hold a single record for each A, while class B will hold multiple records for each A value.

14 Replies

RK Randy Kennison July 24, 2004 08:25 PM

Excuse teh terrible syntax of the below, the default size of the Message input is about 20 characters and 3 lines on this PC for some unknown reason. Makes it very very difficult to type anything at all. >Using the grouping grid and CollectionBase datasources, is it possible to display a parent child type relationship as it is with DataSets? I''d be using a DataSet, except the performance is terrible at best. In any event, Class A has say 2 Col''s, A and B. Col B has 2 col''s, A and C. ( The A''s from each being the same data, Class A will hold a single record for each A, while class B will hold multiple records for each A value.


AD Administrator Syncfusion Team July 26, 2004 05:52 AM

Yes, you can define relations between primary and foreign key columns with any IList derived classes. They don''t need to be datasets. To do that, you have to manually add a GridRelationDescriptor to the groupingGrid.TableDescriptor.Relations collection. Stefan


AD Administrator Syncfusion Team July 26, 2004 06:32 AM

I forgot: You need to register the different lists with Engine.SourceListSet. Let me know if you need more help. Thanks, Stefan


RK RKennison August 19, 2004 08:05 PM

Actually yes.I''m having a hell of a time finding doc''s on this or samples. Basicly i have 2 classes. A , B let''s say each have members a and b. Both classes are derived from collection base. I am trying to set it so that class B''s data shows as a "sub" grid to the rows from class A. Been looking at GridRelationDescriptor. But i fail to see how to set the datasource for the secondary. I did add both with the set function already though. >I forgot: You need to register the different lists with Engine.SourceListSet. > >Let me know if you need more help. > >Thanks, >Stefan >


AD Administrator Syncfusion Team August 20, 2004 05:54 AM

Attached find a sample project that demonstrates how to manually specify master-details relations between three separate tables that primary keys and foreign key columns in common. ManualRelation_9189.zip Stefan


RK RKennison August 20, 2004 03:50 PM

You would think with an example..... I have the following in my code now after looking though your example. Thank you very much. But I still can''t get it to work, as a matter of fact, my root level data doesn''t show but one record when in this condition. Here is what i have before i


RK RKennison August 20, 2004 03:50 PM

( limited msg length? ) GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor(); parentToChildRelationDescriptor.ChildTableName = "EQSE_Atkrs"; // same as SourceListSetEntry.Name for childTable (see below) parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails; parentToChildRelationDescriptor.RelationKeys.Add("ID", "FightID"); this.eGrid.TableDescriptor.Relations.Add(parentToChildRelationDescriptor); this.eGrid.Engine.SourceListSet.Add( "EQSE_Fights" , e.eData.eFights ); this.eGrid.Engine.SourceListSet.Add( "EQSE_Atkrs" , e.eData.eAtkrs ); this.eGrid.DataSource = e.eData.eFights;


RK RKennison August 20, 2004 03:52 PM

Class fights is of collectionbase, as is atkrs. Is there something i have to do inside the fight/atkr classes to make this work? As it is, I bomb out somwhere inside of is_expanded function ( stack trace ).


RK RKennison August 20, 2004 04:26 PM

This has to be something I''m missing in the "key" part. If i Comment out the 2 lines .. RelationKey.. and the next where it "adds" the key, it works until I click on the + button to expand. I crash there. So I''m assuming there is something in my collectionbase class . that i''m missing. When the grouping engine is looking for data in the child / parent class based on the "key" fields specified.. how does it do this? I have a feeling it''s looking for something my classes that do not exist.


AD Administrator Syncfusion Team August 20, 2004 05:06 PM

Could it be you just have to switch the two? parentToChildRelationDescriptor.RelationKeys.Add("ID", "FightID"); to parentToChildRelationDescriptor.RelationKeys.Add("FightID", "ID"); The first parameter needs to be a valid field/column in the parent collection. The second paramter must be from the child table. Stefan


RK RKennison August 20, 2004 06:57 PM

Wow.... ID is in the parent table, fights. FightID is in the atkr table. Add''s doc''s show parent , child order. I switched them, and it no longer crashes, and actually opens a header line, no data is showing up though. I have manually verified it exists.. have to figure that one out. Is there anything special in my CollectionBase derived class that must be overridden to define a column? public long ID { get{ return lFightID; } set{ lFightID = value;} }


RK RKennison August 20, 2004 07:07 PM

Darn.. Actually , it works now, but I have to comment out the relationkind setting, and my "sub" grid, shows every record. I tried the other Kind values, none worked. But not specifiying one at least no longer blows up ;)


RK RKennison August 20, 2004 07:15 PM

I will pull my hair out.... it only doesn''t crash if that view is active when it''s drawn. if it''s drawn in the background it still fries...


RK RKennison August 20, 2004 09:29 PM

Here is one for the books.... DevPartner Studio. This was the problem. I compleltly removed it, and all is well now. Go Figure. Anyway thanks for the help. Your sample still showed me many a few things I was missing. If only DataSet''s had some speed to them....

Loader.
Live Chat Icon For mobile
Up arrow icon