Home Forums WinForms controls Xceed Grid for WinForms ValueRow cells have cell viewer managers? Reply To: ValueRow cells have cell viewer managers?

User (Old forums)
Post count: 23064

You need to set this on the TitleFormat property, not on the Value property, and decide on which side of the actual total (the result of the StatFunction) will it display.


( ( SummaryCell )summaryRow1.Cells[ “Quantity” ] ).StatFieldName = “Quantity”;
( ( SummaryCell )summaryRow1.Cells[ “Quantity” ] ).StatFunction = StatFunction.Sum;
( ( SummaryCell )summaryRow1.Cells[ “Quantity” ] ).TitleFormat = “Quantity”;
( ( SummaryCell )summaryRow1.Cells[ “Quantity” ] ).TitlePosition = TitlePosition.PreferablyLeft; //this is the default value

As for the second total, you have two choices. If the you can’t use the SummaryRow’s available <a href=”http://doc.xceedsoft.com/products/XceedGrid/Xceed.Grid~Xceed.Grid.StatFunction.html”>functions</a&gt; to make the calculation, you can use the adjacent cell to display it as a string. For example, you want to calculate the Quantity column, and there is the Description column to its left that does not have a calculation at the bottom, and calculatedValue is the result of your manual calculation :

( ( SummaryCell )summaryRow1.Cells[ “Description” ] ).StatFieldName = “Description”;
( ( SummaryCell )summaryRow1.Cells[ “Description” ] ).TitlePosition = TitlePosition.PreferablyRight;
( ( SummaryCell )summaryRow1.Cells[ “Description” ] ).TitleFormat = calculatedValue.ToString();

The other choice is to use the ValueRow, but redefine a CellEditorManager and CellViewerManager on the cells you need to display your results or texts, and use the type of editor you need (e.g a text editor for string, a numeric editor for a integer, etc.. )


WinTextBox textBox = new WinTextBox( EnhancedBorderStyle.None );
valueRow1.Cells[ “Applied to” ].CellEditorManager = new CellEditorManager( textBox, “Text”, true, true );
valueRow1.Cells[ “Applied to” ].CellViewerManager = new CellViewerManager( textBox, “Text” );

Then later in your code, you will be able to set the calculated value or the display text, once the ValueRow has been created by the grid.


valueRow1.Cells[ “Applied to” ].Value = “TOTAL”;

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