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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can't make DateTime fields not editable

Thread ID:

Created:

Updated:

Platform:

Replies:

128599 Jan 31,2017 01:17 PM UTC Feb 3,2017 10:09 AM UTC ASP.NET Core 4
loading
Tags: Grid
gojobu
Asked On January 31, 2017 01:17 PM UTC

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

gojobu
Replied On January 31, 2017 01:18 PM UTC

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

Venkatesh Ayothi Raman [Syncfusion]
Replied On 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. 


gojobu
Replied On 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

Venkatesh Ayothi Raman [Syncfusion]
Replied On 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. 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;