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
1104
Calculating in a grid cell
posted

Hi,

can WinGrid do some simple cell calculation like Excel? E.g. in Excel you write "=3+4" in a cell and get the value 7.

I just wanted to ask if there is a ready-to-use method in the grid to do this, or if I have to implement it by myself.

Thanks,

Regards

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    Do you mean you want to apply a calculation like this to a cell in code?

    Or do you mean you want the user to be able to enter a formula into a cell?

    For the former, you could do this in a couple of ways. You could use UltraCalcManager and apply a Formula to a column, or you could use the InitializeRow event to set the Value of a cell in code based on the other values of cells in that row.

    For the latter, there's no built-in way to do this. But once again, if you are using CalcManager, you could allow users to enter formulas using the FormulaBuilder. This is the same dialog that comes up when you edit a formula Visual Studio. There's a sample demonstrating this included in the NetAdvantage samples.

    ...\2010.3\Samples\WinCalcManager\

     

     

Children