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
2745
Find Summary Value in grid
posted

Hello!

I have a grid that is filled with different types of products. One column in this grid is a cost price column.

I have added summaries to the grid and my idea was to get the total price of the products through the summary value that is based on the cost price column.

Another option could be to calculate the total price based on the datasource that populates the grid, but since I have enabled editing of the grid, it feels a bit wrong.

At the moment, I am setting the cost price in the summaryvaluechanged event, which then calculates the sales price. So we have:

summaryvaluechanged->costprice->salesprice.

The summaryValueChanged event fires many times, since I have groupbyrows. However, it works even if it is fired many times.

So far so good...

It is quite common that the users wants to override the sales price and create some sort of rounded value that is presented to the customer.

The problem that I get is when I export the data from the grid to excel. The grid seems to be re-generated when it is exported, so the summaryvaluechanged event fires a new round. This means that the cost price is calculated again, and so is the sales price. It gets overwritten which is not good. I ahve tried to lock down the event before i export the grid and to open it up again after it is exported. However, since the grid works async, I turn on the event before the summaryvaluechanged event has finished firing. So the value is overwritten...

I hope that someone can understand what I am trying to explain. I am not sure if I understand it myself ;-)

Any ideas?

/Henrik

 

Parents Reply Children
No Data