Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
620
Running Total
posted

Any help on this would be great. I have a collection bound to the grid that includes the sales for each day

Date                Net Sales
1/Nov/2009   10.00
2/Nov/2009   15.00
3/Nov/2009   50.00

I have added a template column called Sales To Date and I need to show the running totals in this column

Date                Net Sales    Sales To Date
1/Nov/2009   10.00              10.00
2/Nov/2009   15.00              25.00
3/Nov/2009   50.00              75.00

any thoughts on how to achive this without changing the underlying object.

Thanks

David

Parents
No Data
Reply
  • 6475
    posted

    Hi David,

    I'm not sure if you still need help with this, but one way to do this is using a converter to calculate the value for the given row. Attached is a quick sample that demonstrates it.

    Note that the "Sales To Date" column is not bound to a field in the data source. The attached sample uses 9.2 version of XamWebGrid. If you're using a newer version, you'll have to replace the TemplateColumn with UnboundColumn.

     

    Hope that helps,

    Sample.zip
Children
No Data