Grid - Registered Users - Helpdesk
getting formula to work
Thread Starter: Rael Bauer Started: 6/25/2008 11:02 PM UTC
Replies: 5
getting formula to work
Hi,

 Profgrid1.CellByName('A1').Value := '$30';
 Profgrid1.CellByName('B1').Value := '8';
 Profgrid1.CellByName('C1').Formula := 'A1*B1';

C1 shows #Value!.

What do I need to do to get the formula to work (i.e. treat A1 as a number)? and can I even get it to show the '$'?

Thanks
Rael
Re: getting formula to work
Hi Rael:

Profgrid1.CellByName('A1').Value := CompToCurrency(30);
Profgrid1.CellByName('B1').Value := 8;
Profgrid1.CellByName('C1').Formula := 'A1*B1';


-Nicholas
Re: getting formula to work
Is there a way for the end user to achieve this (i.e. not via code)?

The user is able to set the format string.

Rael


"profgrid.com" <helpdesk@profgrid.com> wrote in message news:6d8c0b5b$24750096$2804@vlad...
Hi Rael:

Profgrid1.CellByName('A1').Value := CompToCurrency(30);
Profgrid1.CellByName('B1').Value := 8;
Profgrid1.CellByName('C1').Formula := 'A1*B1';


-Nicholas
Re: getting formula to work
The end user should simply enter a dollar sign along with the number in the inplace editor:
$30
or
30$


-Nicholas
Re: getting formula to work
The end user should simply enter a dollar sign along with the number in the inplace editor:
$30

This does not work for me:
In  a new project I add a profgrid, set SpreadsheetEnabled and Spreadsheet headers to true.
Then Run

I type in A1: "$30"
B1: "8"
C1: "=A1*B1"

C1 says #VALUE!

-Rael
Re: getting formula to work
If your regional and language options (in Control Panel) are set to South
Africa, then your currency symbol is R (not $). So either enter your native
currency symbol (which is R) or change the currency symbol in Control Panel
to dollar sign.


-Nicholas