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

On my side, if I set UIVirtualizationMode to None, it works fine, that is, all values update correctly in the ValueRow, except that I need to also have a one time Application.Idle event, since the SummaryRow values are calculated so late that it is the only way to get the SummaryRow to update the ValueRow.

e.g. :

private void Form1_Load( object sender, EventArgs e )

{

    gridControl1.UIVirtualizationMode =

UIVirtualizationMode.None;

    Application.Idle += new EventHandler( First_Application_Idle );

}

//This runs only once, after the grid as loaded

void First_Application_Idle( object sender, EventArgs e )

{

    Application.Idle -= new EventHandler( First_Application_Idle );

    foreach( Group group in gridControl1.Groups )

    {

        SummaryRow sumRow = group.FooterRows[ 0 ] as SummaryRow;

        ValueRow valueRow = group.FooterRows[ 1 ] as ValueRow;

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

        {

            valueRow.Cells[

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

        }

    }

    //Time to subscribe to the ValueChanged event, so we can update the ValueRow accordingly

    dataRowTemplate1.Cells[

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

}

However, I will investigate why the virtualization of cells brings this behavior of not updating all groups correctly.

 

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