0

I m using a Kendo Date picker in inline Editing of a Kendo Grid.

IF I select a value, on click of update , the value selected is (selected value) +1. It happens only when I deploy the code to server. Not reproducible in my localhost

On click of update, I have the below code

public ActionResult Update([DataSourceRequest] DataSourceRequest request)
    {
        CompanyPrepaymentException PPEx = new CompanyPrepaymentException();
        try
        {

            TryUpdateModel(PPEx); // this gets value from current context, the selected data and other required properties

               //some logic


                if (ModelState.IsValid == true)
                {


                    if (prepayException != null)
                    {
                        prepayException.StartDate = PPEx.StartDate;
                        prepayException.EndDate = PPEx.EndDate;

                    }

                }
            }



        catch (Exception ex)
        {

           //catch block
        }

        return Json(new[] { prepayException }.ToDataSourceResult(request, ModelState));

    }
KeenUser
  • 5,305
  • 14
  • 41
  • 62

1 Answers1

0

I set culture info to default(en-US) and parsed date, it works fine

System.Globalization.CultureInfo cultureinfo =
     new System.Globalization.CultureInfo("en-US");
    prepayException.StartDate = DateTime.Parse(PPEx.StartDate.ToString(), cultureinfo);
 prepayException.EndDate = DateTime.Parse(PPEx.EndDate.ToString(), cultureinfo);
KeenUser
  • 5,305
  • 14
  • 41
  • 62