User (Old forums)MemberMay 25, 2007 at 3:36 pmPost count: 23064
How can I make cells in the foot value rows not use the column’s cell viewer manager ?
I have a grid like this:
| Merchant | Applied To | Amount |
| Taco Bell | Interest | $20 |
| Wendy’s | Credit | ($50)|
| _______ |______ TOTAL | ($30)|
The “Applied To” column has a ComboBoxViewer for the viewer manager. It converts “Applied To” codes to descriptions such as “Interest” or “Credit”.
The last row is a value row added to the footer rows. It contains cell values that’s manually set from code and doesn’t come from the grid’s data source.
Right now the word “TOTAL” doesn’t show up because it is not a “Applied To” value, so the combo box viewer just displays a blank.
How do I get the word “TOTAL” to show up?
ps: the spaces aren’t showing up for the chart above.
Imported from legacy forums. Posted by hao_jiang (had 3433 views)User (Old forums)MemberMay 28, 2007 at 1:57 pmPost count: 23064
You can use a SummaryRow instead of a ValueRow. You will be able to display the TOTAL and it will calculate the Amount automatically. Simply set the SummaryCell StatFunction to Sum, and set its TitleFormat to TOTAL.
Imported from legacy forums. Posted by André (had 356 views)User (Old forums)MemberMay 30, 2007 at 10:50 amPost count: 23064
I tried to use a Summary row. When I tried to put the word “TOTAL” in the cell, I got an error saying “The value is automatically calculated and is not modifiable”. So I guess a summary row won’t work if I want to put some text there.
Also, actually I have two value rows with two different totals. The other total is not a simple sum and has to be calculated manually.
Imported from legacy forums. Posted by hao_jiang (had 490 views)User (Old forums)MemberMay 30, 2007 at 3:57 pmPost 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> 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)
- You must be logged in to reply to this topic.