We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can't make DateTime fields not editable

IsIdentity(true)
AllowEditing(false)
EditType(EditingType.String)

Tried multiple combinations of these but always it gives me an editable datepicker
Two of my columns show read only fields that are set by server and user should only see them I can't make them readonly

6 Replies

GO gojobu January 31, 2017 01:18 PM UTC

Field is col.Field(model => model.Date)


VA Venkatesh Ayothi Raman Syncfusion Team February 1, 2017 08:43 AM UTC

Hi Customer, 
Thanks for contacting Syncfusion support. 
This issue happens when we enable both AllowEditing(false) and EditType properties in Grid. This is not recommended way and we suggest you to disable the AllowEditing property for date column like as follows, 
Code example
@Grid  
  @(Html.EJ().Grid<object>("FlatGrid") 
         .Datasource((IEnumerable<object>)ViewBag.datasource) 
         . . . 
        .Columns(col => 
        { 
            .. . 
            col.Field("OrderDate").HeaderText("Order Date").AllowEditing(false).Format("{0:MM/dd/yyyy}").Add(); 
        })) 

Please refer to the Help documentation for more information, 

If you still face the same issue, then could you please provide following information? 
1)      Share the Grid code example. 
2)      Essential Studio version details. 
3)      Any script error thrown in console window while editing? 
Regards, 
Venkatesh Ayothiraman. 



GO gojobu February 1, 2017 02:28 PM UTC

 .Columns(col =>
        {
            col.Field(x => x.Id).IsPrimaryKey(true).IsIdentity(true).Add();
            col.Field(x => x.Name).Add();
            col.Field(x => x.Country).Add();
            col.Field(x => x.State).Add();
            col.Field(x => x.CreatedDate).AllowEditing(false).Add();
            col.Field(x => x.LastModifiedDate).AllowEditing(false).Add();
        })

CreatedDate is still editable


VA Venkatesh Ayothi Raman Syncfusion Team February 3, 2017 10:09 AM UTC

Hi Customer,  
  
We considered this requirement “AllowEditng property is not working correctly for Datetimepicker column” as bug and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.  
  
  
Regards,  
Venkatesh Ayothiraman. 
 



NS Nur Syahira Abd Wahab July 7, 2020 03:01 AM UTC

hi venkatesh, is there any update on this bugs? because i still can't allowEditing = false; for dateType. please share any solution. thank you


MP Manivannan Padmanaban Syncfusion Team July 8, 2020 01:05 PM UTC

Hi Nur Syahira, 

Greetings from Syncfusion Support. 

We have already fixed the reported issue and we suggest you upgrade the Essential Studio Version to minimum V15.1.0.33 Or maximum V18.2.0.44(latest version).  

Kindly get back to us, if you need further assistance. We will he happy to assist you. 

Regards, 
Manivannan Padmanaban 


Loader.
Up arrow icon