Have a grid w/ in-place editing enabled. One of the fields stores a dollar amount (unit price) which is databound to my sql database via an sqldatasource, decimal(10,2) field. The column definition is as follows:
Let's take an item with a unit price of $110.00 from the database.
When the grid initially loads, the column properly displays the amount as $110.00
If I click edit, my in-place editing form appears and the input box for the unit price appears as:
$11,0__.00
Suffice to say, this is clearly incorrect. There are other editable columns in the grid... if the user intends to edit a different field (such as description) they also have to "correct" the incorrect unit price -- each and every time they perform an edit operation -- otherwise if they attempt to update w/o correcting it, they receive a "Exception Details: System.FormatException: Input string was not in a correct format." error when trying to update. This is very annoying to the user community.
Why is the masked control displaying the data incorrectly for edit, and how can I correct it so the value is properly displayed on the edit form to avoid this issue?
<telerik:GridMaskedColumn DataField="UnitPrice" DisplayMask="" HeaderText="Unit Price" Mask="$##,###.##" UniqueName="Unit Price" DataFormatString="{0:C2}"> <HeaderStyle HorizontalAlign="Center" Width="100px" /> <ItemStyle HorizontalAlign="Center" Width="100px" /> </telerik:GridMaskedColumn> Let's take an item with a unit price of $110.00 from the database.
When the grid initially loads, the column properly displays the amount as $110.00
If I click edit, my in-place editing form appears and the input box for the unit price appears as:
$11,0__.00
Suffice to say, this is clearly incorrect. There are other editable columns in the grid... if the user intends to edit a different field (such as description) they also have to "correct" the incorrect unit price -- each and every time they perform an edit operation -- otherwise if they attempt to update w/o correcting it, they receive a "Exception Details: System.FormatException: Input string was not in a correct format." error when trying to update. This is very annoying to the user community.
Why is the masked control displaying the data incorrectly for edit, and how can I correct it so the value is properly displayed on the edit form to avoid this issue?