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
160
WebGrid calculate subtotal or Gross/Net Profit
posted

Not sure if this question should be in the WebGrid section.

I'm trying to create a Profit and Loss Statement type of presentation layout. The data rows will come from a dataset and there will be blank rows where Sub Totals, Gross Profit and Net Profit go.

From what I have seen so far, the WebCalcManager does calculations across the rows only? ie. such as 'add columns 1 and 2 and put it in column3'.

My question: How can I add data in certain rows in the same column ? For example, row 5 = rows 1 + 2 + 3, and row 15 = row 5 - row 12.

Can this be done with WebCalcManager? Or do I have to go for an accumulator type of solution - ie. where I have some arrays where I can accumulate selected values while looping through the dataset?

Also: I would prefer a solution which I can also use for a spreadsheet type of grid, so that the Sub Totals/Totals recalculate when a cell value is changed. I'm thinking, a recalc that triggers off on the client-side when a cell value is changed rather than a postback on the server-side, from a speed view point.

Thanks for reading, and thanks in advance for any ideas!

 

Parents
No Data
Reply
  • 160
    posted

    I had an idea.

    It will work if these things are possible.

    1. Can I 'name' a particular cell in a table in the UltraWebGrid? If so how? Say as RowNo and ColumnNo?
    2. Can I get a JavaScript function to fire-off on change of any editable cell in an AJAX enabled UltraWebGrid?

    If the above are possible I expect I can put the 2 together and get a JavaScript function to update the cells where the Sub Totals and Totals should go. Am I right?

    Or do the clever people here know of a better way with Infragistics?

    TIA

Children
No Data