This is a migrated thread and some comments may be shown as answers.

How to refresh non-editable fields after inline edit.

1 Answer 375 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gerald
Top achievements
Rank 1
Gerald asked on 14 Apr 2016, 02:41 PM

I have a Gird which has a number of editable fields as well as some standardized auditing fields (LastUpdatedBy, LastUpdatedOn).

 

The later are intended to be read only.  So they are marked as Editable(false)

            model.Field(a => a.LastModifiedBy).Editable(false);
            model.Field(a => a.LastModifiedOn).Editable(false);

For the inline edit I am doing an Ajax call to controller action which processes the edit, updates the modified fields and passes the updated record back to the grid.  The grid displays the editable changes however I assume because they are non-editable the modified fields are not updated.  Doing a refresh of the page displays correct information but that is not desirable.

How can the behavior of Grid be override so that it will update the display of all model fields even the ones marked non-editable after an update?

 

 

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 18 Apr 2016, 08:42 AM

Hello Gerald,

My suggestion in this case is to avoid setting Editable(false); for both fields, because this does not allow modifying of the records at all. 

Instead you can use the edit event of the Kendo UI Grid and make both input elements read-only. This can be achieved by using e.container element and find the input elements using jQuery. 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Gerald
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or