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.

Summary Text from GridEngine

Thread ID:

Created:

Updated:

Platform:

Replies:

65252 Jul 25,2007 12:27 PM Jul 26,2007 10:14 PM Windows Forms 3
loading
Tags: GridControl
Harshad
Asked On July 25, 2007 12:27 PM

Hi,

I am trying to read the Summarytext of the summary column for a specific group using
GridEngine.GetSummaryText(Group,SummaryColumnDescriptor);
I am able to get the SummaryText value but when user change the cell value and summary get recalculated then also i am getting old value by gridEngine.
In Grid summary cell i can see the new value which is set in querycellstyleinfo event.
I have to close and reopen the window to get the new value in GridEngine summaryText.
Please can you show me some pointer to get the latest value in gridEngine.
Thanks
Harshad

haneefm [Syncfusion]
Replied On July 25, 2007 03:50 PM

Hi Harshad,

By default, the summaries should be refreshed as you leave the row (not the cell). If you want the summaries updated as you leave the cell , you can add a CurrentRecordContextChange event handler, and trigger the actions there.

private void grid1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if(e.Action == CurrentRecordAction.CurrentFieldChanged
|| e.Action == CurrentRecordAction.EndEditComplete )
{
this.gridGroupingControl1.CurrencyManager.EndCurrentEdit();
this.gridGroupingControl1.Table.SummaryDirty = true;
this.gridGroupingControl1.Table.TableDirty = true;
this.gridGroupingControl1.Table.InvalidateSummary();
}
}

To update the summaries as you change the underlying datasource, Please refer to the below form thread.
http://www.syncfusion.com/support/Forums/message.aspx?MessageID=20247

Best Regards,
Haneef

Harshad
Replied On July 26, 2007 05:12 AM

Hi,
Thanks For reply,
Actually my problem is in the grid sumamry gets updated. but since these are the calculated column and value is calculated in queryCellStyleinfo. record value is not get updated in the underline datasource for these calculated columns and therfore summary value in gridEngine is not get updated even though i move from the row.
Please can you tell me how to refesh gridEngine ? is there any method or property to refresh this?

Saravanan A [Syncfusion]
Replied On July 26, 2007 10:14 PM

Hi Harshad,

If you are setting the summary value through QueryCellStyleInfo event, it will not get stored internally with the summary elements. So GridEngine.GetSummaryText and GetDisplayText methods will not return those values. In this case you can try getting the RowIndex and ColIndex of the summary cell and access the CellValue through the indexers of gridGroupingControl1.TableModel. This will trigger the QuerryCellStyleInfo event for that cell and then return the value.
Here is the code snippet.

int rowIndex = gridGroupingControl1.Table.NestedDisplayElements.IndexOf(summaryRow);
GridTableDescriptor tableDescriptor = null;
foreach (GridSummaryColumnDescriptor scd in summaryRow.SummaryRowDescriptor.SummaryColumns)
{
tableDescriptor = scd.TableDescriptor;
int fieldIndex = tableDescriptor.NameToField(scd.DataMember);
int colIndex = scd.TableDescriptor.FieldToColIndex(fieldIndex);

Console.WriteLine(gridGroupingControl1.TableModel[rowIndex, colIndex].CellValue);
}


Best Regards,
Saravanan

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.

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.

;