PersianDatepicker problem by editing the GridInlineEdit?

Hi to all Friends I've got to run PersianDatePicker using the following method in GridInlineEdit: Index Code:
new Column { Bind = "MyDateTime",ClientFormat = ".EntDate", Header = "?????",Width = 130}
         .Mod(=> o.Inline("<input type='text' style='width: 110px' class='Date' name='MyDateTime' placeholder='?????'/>")),

<script>
    $(function () {
        $(document).on('aweinlineedit', function() {
            //usage
            $(".Date").persianDatepicker();
        });
    });
</script>
Controller Code:
private static object MapToGridModel(FactorDetails o)
{
    return
    new
    {
         o.Price,
         EntDate = DB.MiladiToShamsi(o.MyDateTime)
    }
[HttpPost]
public ActionResult Edit(FactorDetails input)
{
    if (ModelState.IsValid)
    {
        Factor factor = DB.GetFactorDetailsById(input.Id);
        
        factor.Price=input.Price;
        factor.MyDateTime = DB.ShamsiToMiladi(input.MyDateTime);
    }
Now my problem is that when the OnClick Edit date Is Not displayed. All fields were filled, but Date is not displayed in its own field. Please Guide Me.
owner
dear
asked at 29 Aug 2016
  • you need to have MyDateTime property present in the grid Model ( add it in the MapToGridModel ), and in your format put value='#Value' (inside o.Inline('<input ...
    at 04 Sep 2016 Omu

Answers 

please Sign In to leave an answer

By accessing this site, you agree to store cookies on your device and disclose information in accordance with our cookie policy and privacy policy .
contact us