GridGrouping Issue

Hi folks,

I'm using Essential Studio Enterprise 2010 vol 2.
I adapted the sample code from one of the grouping demos to work in my project. I got one parentTable and one childTable and tried to join. Unfortunately with no success.
In single step debugging I checked that both datasource containing data and also RelationKeys do matching.
All I get is the correct row from the parent table, a "+" in front of the row, but no childdata.

Can you help me? Thanks a lot and sorry for my bad english.
Jan

patienttreatment and patientdialyzer are classes with public string fields containing my data:

public class patientdialyzer
{
private string _fkPatientTreatment;

public string fkPatientTreatment
{
get { return _fkPatientTreatment; }
set { _fkPatientTreatment = value; }
}
...

public class patienttreatment
{
private string _idPatientTreatment;

public string idPatientTreatment
{
get { return _idPatientTreatment; }
set { _idPatientTreatment = value; }
}
...

private void LoadTreatment(string id)
{
patienttreatment[] parentTable = db.GetPatientTreatment("fkPatientMasterdata = " + id);
patientdialyzer[] childTable = db.GetPatientDialyzer("fkPatientMasterdata = " + id);
// I checked that parentTable and childTable are containing valid data.
this.gridGroupingControl1.Engine.SourceListSet.Add("Treatments", parentTable);
this.gridGroupingControl1.Engine.SourceListSet.Add("Dialyzer", childTable);

GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor();
parentToChildRelationDescriptor.ChildTableName = "Dialyzer"; // should be same as SourceListSetEntry.Name.
parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;
parentToChildRelationDescriptor.RelationKeys.Add("idPatientTreatment", "fkPatientTreatment");
gridGroupingControl1.TableDescriptor.Relations.Add(parentToChildRelationDescriptor);

this.gridGroupingControl1.DataSource = parentTable;

this.gridGroupingControl1.TableOptions.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Office2007Blue;
this.gridGroupingControl1.TableOptions.GridLineBorder = new Syncfusion.Windows.Forms.Grid.GridBorder(GridBorderStyle.Solid, Color.FromArgb(208, 215, 229), GridBorderWeight.Thin);
this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.gridGroupingControl1.TopLevelGroupOptions.ShowCaption = false;
this.gridGroupingControl1.Appearance.AnyCell.Font.Facename = "Verdana";
this.gridGroupingControl1.Appearance.AnyCell.TextColor = Color.MidnightBlue;
this.BackColor = Color.FromArgb(223, 227, 239);

}

2 Replies

JL Jan Leimbach June 19, 2010 05:03 PM UTC

Screenshot of parenttable and childtable in debug view.



Desktop_f79484ec.zip


JJ Jisha Joy Syncfusion Team June 23, 2010 08:48 AM UTC

Hi Jan,

Your incident 69169 for the same query is updated. Please follow up with it.

Regards,
Jisha

Loader.
Up arrow icon