GridView.GetRowSummaryItem(Int32, GridColumn) Method

Returns a key-and-value pair representing the summary item and its value calculated for a particular group footer cell.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

public virtual DictionaryEntry GetRowSummaryItem(
    int rowHandle,
    GridColumn column
)
Public Overridable Function GetRowSummaryItem(
    rowHandle As Integer,
    column As GridColumn
) As DictionaryEntry

Parameters

Name Type Description
rowHandle Int32

An integer value specifying a group row handle. This identifies the group whose footer contains the desired cell.

column GridColumn

A GridColumn object (or descendant) representing the column where the desired cell resides.

Returns

Type Description
DictionaryEntry

A DictionaryEntry object whose key is the summary item and value is the summary value. An empty dictionary entry if the specified row footer cell doesn't have the corresponding summary item.

Remarks

The returned dictionary entry is an element of the hashtable returned by the GridView.GetGroupSummaryValues method. The entry's key is a GridGroupSummaryItem object representing the summary item. The value is an object holding the calculated summary value.

To obtain the summary text displayed within a particular row footer cell, use the GridView.GetRowFooterCellText method.

Please refer to the Working with Summaries in Code. Custom Summaries topic for additional information.

NOTE

Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the GetRowSummaryItem member must not be invoked for these Views. The GetRowSummaryItem member can only be used with real Views that are displayed within the Grid Control. The real Views with which an end-user interacts at runtime can be accessed using the following methods.

Examples

The following code demonstrates how to use the GridView.GetRowSummaryItem method to obtain a summary displayed in a specific cell of the group footer corresponding to the focused group row.

using DevExpress.XtraGrid.Views.Base;

private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e) {
    GridView currentView = sender as GridView;            
    // Obtain the summary item displayed in the focused column 
    // within the focused group row's footer   
    DictionaryEntry ent = currentView.GetRowSummaryItem(e.FocusedRowHandle, 
      currentView.FocusedColumn);
    // Determine whether the summary item for the specified row and 
    // column is successfully obtained
    if(ent.Key != null) {
        GridGroupSummaryItem si = (GridGroupSummaryItem)ent.Key;
        // Obtain the summary item's text
        this.Text = si.GetDisplayText(ent.Value, true);
    } else {
        this.Text = "There is no summary for this row and column";
    }
}
See Also