This is a migrated thread and some comments may be shown as answers.

[Solved] Currency defaults

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gareth
Top achievements
Rank 1
Gareth asked on 15 Jun 2011, 07:18 PM
Hi,

I've created a grid with batch in place editing with a currency column.

If I click in a cell in the currency column with no entry in it I get the edit box but, if I click out leaving the box empty, it changes to $0.00.

Is there any way of telling it to leave blank text boxes empty and not put $0.00 in there?

Thanks

Gareth

1 Answer, 1 is accepted

Sort by
0
Gareth
Top achievements
Rank 1
answered on 16 Jun 2011, 09:41 AM
I've sorted this myself - rather than using the currency datatype I've applied formatting using the ClientTemplate:

.ClientTemplate("<#=formatter(RRPIncVAT)#>")

where formatter is a custom javascript function:

function formatter(value) {
if (value) {
return '£' + $.telerik.formatString('{0:###,#0.00}', value);
} else {
return '';
}
}

I wasn't 100% sure about the formatString function - I can't find any documentation on it but it seems to work

Gareth
Tags
Grid
Asked by
Gareth
Top achievements
Rank 1
Answers by
Gareth
Top achievements
Rank 1
Share this question
or