Home Forums WinForms controls Xceed Grid for WinForms SummaryCell or ValueCell – Need text and calc in cell Reply To: SummaryCell or ValueCell – Need text and calc in cell

User (Old forums)
Member
Post count: 23064

This is not possible with the SummaryRow.  What you can do is, as you first suggested, to use a ValueRow do display the text and statistics you want, but still use the SummaryRow to feed the data in the ValueRow.   Simply hide the SummaryRow, so it does not show up in the grid.  Note that the statistics in the SummaryRow are calculated very late in the process, so the only way to get the updated value once a cell has changed in the grid is to use the Application.Idle event.

e.g. :

//assuming a SummaryRow and ValueRow have been added in the FixedFooterRows in the designer 

private void Form1_Load( object sender, EventArgs e )

{

    gridControl1.FixedFooterRows[ 0 ].Visible =

false;

    dataRowTemplate1.Cells[

“Price” ].ValueChanged += new EventHandler( Form1_ValueChanged );

}

void Form1_ValueChanged( object sender, EventArgs e )

{

    Application.Idle += new EventHandler( Application_Idle );

}

void Application_Idle( object sender, EventArgs e )

{

    Application.Idle -= new EventHandler( Application_Idle );

    SummaryRow sumRow = gridControl1.FixedFooterRows[ 0 ] as SummaryRow;

    ValueRow valueRow = gridControl1.FixedFooterRows[ 1 ] as ValueRow;

    if( sumRow != null && valueRow != null )

    {

        valueRow.Cells[

“Price” ].Value = sumRow.Cells[ “Price” ].Value;

    }

}

 

Imported from legacy forums. Posted by André (had 507 views)