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

Summary Text from GridEngine

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

3 Replies

HA haneefm Syncfusion Team July 25, 2007 07:50 PM UTC

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


HA Harshad July 26, 2007 09:12 AM UTC

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?


SA Saravanan A Syncfusion Team July 27, 2007 02:14 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon