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

Batch Editing DataFormatString Problem

2 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 06 Aug 2014, 12:21 PM
Hi All,

A seemingly novice issue but I fail to figure out the solution. In my radgrid, I have cells with dataformatstring = "{0:p}", which give for example a value of 0.01 a value of 1% on the grid when batch editing. Problem occurs when I try to update the cells.

While the value includes a "%" sign, the update value then becomes string rather than decimal that is required by my data entry and returning error. I'm quite sure there should be a official work around, any advice will be much appreciated!

Best Regards.

2 Answers, 1 is accepted

Sort by
0
Tim
Top achievements
Rank 1
answered on 06 Aug 2014, 02:13 PM
Please kindly advise.
0
Konstantin Dikov
Telerik team
answered on 11 Aug 2014, 07:53 AM
Hello Tim,

Could you please refer to the answer in the support ticket that you have opened regarding this matter (Ticket ID: 847930).

For others convenience, here is the answer from the ticket:
"The requirement that you have, for displaying percentage values with Batch edit mode and pass only the numeric value for saving, could be achieved with GridNumericColumn and setting the NumericType of the column to Percent, and setting the DataFormatString to {0:p}.

When the server-side OnBatchEditCommand event fires, the NewValues collection will hold a numeric value, without the "%" sign.
"

Attached is the page with the example.

If any further questions arise, I suggest that we continue our conversation in the support ticket.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Tim
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or