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

GetSummaryText when RecordValueChanged

Thread ID:

Created:

Updated:

Platform:

Replies:

72265 Mar 11,2008 10:22 AM UTC Mar 26,2008 10:03 PM UTC Windows Forms 2
loading
Tags: GridControl
laoxu
Asked On March 11, 2008 10:22 AM UTC

I have a self-referential table with "ID","NAME","COST" and "FID" fields.When the "COST" value changed at level n,I want to set the "COST" value at level n-1 as sum of "COST" value at level n,the "COST" value at level n-2 as sum of "COST" value at level n-1 ...,and so on.

My code is here.It dosn't work as what I want.What's wrong with me?
Private Sub GridGroupingControl1_RecordValueChanged(ByVal sender As Object, ByVal e As Syncfusion.Grouping.RecordValueChangedEventArgs) Handles GridGroupingControl1.RecordValueChanged
If e.Record.TableLevel <> -1 Then
If e.Column = "Cost" Then
If Not (e.Record.ParentChildTable.ParentDisplayElement.GetRecord Is Nothing) Then
Dim g As Group = CType(IIf(TypeOf e.Record.ParentGroup Is Group, e.Record.ParentGroup, Nothing), Group)
e.Record.ParentChildTable.ParentDisplayElement.GetRecord.SetValue("Cost", GridEngine.GetSummaryText(g, "SumR", "SumC"))
End If
End If
End If
End Sub


Regards,
LaoXu



Administrator [Syncfusion]
Replied On March 17, 2008 03:10 PM UTC

Hi laoxu,

we are working on the forum.. we will update you soon.. Thanks for your interest in syncfusion products..

regards,
Janagan


Administrator [Syncfusion]
Replied On March 26, 2008 10:03 PM UTC

Hi laxou,

You need to add the SummaryRowDescriptor for each self relation table in a GroupingGrid. Below are the codes that shows you "How to add the Count summary for SelfRelation table in GroupingGrid?".

private GridRelationDescriptor AddManualRelations( GridTableDescriptor parentgridTableDescriptor )
{
GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor( );
parentToChildRelationDescriptor.ChildTableName = "SelfReferencingTable"; // same as SourceListSetEntry.Name for childTable (see below)
parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;
parentToChildRelationDescriptor.RelationKeys.Add( "DEPTNO", "ADMRDEBT" );

// Add relation to ParentTable
parentgridTableDescriptor.Relations.Add( parentToChildRelationDescriptor );
parentgridTableDescriptor.AllowNew = false;
parentgridTableDescriptor.AllowEdit = false;
GridSummaryColumnDescriptor totalSum = new GridSummaryColumnDescriptor("CumBuyQty");
totalSum.SummaryType = SummaryType.Count;
totalSum.Style = GridSummaryStyle.Column;
totalSum.DataMember = "DEPTNO";
totalSum.DisplayColumn = "DEPTNO";
totalSum.Format = "{Count:#}";

GridSummaryRowDescriptor sRow = new GridSummaryRowDescriptor("Totals", totalSum);
parentToChildRelationDescriptor.ChildTableDescriptor.SummaryRows.Add(sRow);
return parentToChildRelationDescriptor;
}

Please refer to the attached sample for implementation and let me know if this helps.
http://websamples.syncfusion.com/samples/SelfRelations.zip

Best regards,
Haneef


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

;