This question is locked. New answers and comments are not allowed.
I have an MVC3 Telerik Grid that does In Cell batch editing. The columns RealForecast and RealActual are values are showing correctly formatted. For example, the value is shown as "$0.00" before editing, "0" while editing, and "0" with a red carrot showing the value is changed when I click out of edit mode.
How do I get the value to not show it has change when it hasn't and how to I reapply the formatting?
Here is my grid markup:
Here is my model (RealForecast is the property I am binding to which is Forecast divided by 100:
How do I get the value to not show it has change when it hasn't and how to I reapply the formatting?
Here is my grid markup:
@(Html.Telerik().Grid(Model.spendDetail).Name("spendGrid") .ClientEvents(clientEvents => clientEvents.OnDataBinding("dataBinding")) .DataKeys(keys => { keys.Add(p => p.SpendVendorID); }) .ToolBar(commands => { commands.SubmitChanges(); }) .Columns(columns => { columns.Bound(o => o.SpendDate).Format("{0:dd-MMM}"); columns.Bound(o => o.SpendDate).Format("{0:ddd}"); columns.Bound(o => o.RealForecast).Format("{0:C}"); columns.Bound(o => o.RealActual).Format("{0:C}"); }) .DataBinding(data => data.Ajax().Enabled(true) .Select("_SpendDetailSelect", "SpendDetail") .Update("_SaveBatchEditing", "SpendDetail") ) .Editable(editing => editing.Mode(GridEditMode.InCell)) .Sortable() .Scrollable() .Pageable() .Footer(true))Here is my model (RealForecast is the property I am binding to which is Forecast divided by 100:
[Required]public int Forecast { get; set; }[DisplayName("Forecast")][DataType(DataType.Currency)]public decimal RealForecast { get { return Convert.ToDecimal(Forecast) / (decimal)100.0; } set { Forecast = Convert.ToInt32(value * (decimal)100.0); }}