Hello,
I tried to conditional set Grid column Editable status at run time as below code but caused page error. Could anyone give me advice how to do it? Thanks in advance.
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.JobTitle).Editable("isEditable"); <---
model.Field(p => p.FirstName).Editable(true);
model.Field(p => p.LastName).Editable(true);
})
<script>
function isEditable(dataItem) {
return dataItem.Id !=3;
}
</script>
7 Answers, 1 is accepted
Hello,
To determine whether a column is editable run time, you have to use the column.Editable setting, not the model.field.Editable configuration.
e.g.
columns.Bound(p => p.JobTitle).Editable("isEditable")
Regards,
Georgi
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Thanks for your responding Georgi. If I add code as below my application throw the error.
columns.Bound(p => p.JobTitle).Editable("isEditable")
Error:
'Kendo.Mvc.UI.Fluent.GridBoundColumnBuilder<XXXXXX>' does not contain a definition for 'Editable' and no extension method 'Editable' accepting a first argument of type 'Kendo.Mvc.UI.Fluent.GridBoundColumnBuilder<XXXXX>' could be found .....
Hi,
Looking at the error message the type of the passed parameter to the Editable method is incorrect. The error message states that the type of the passed parameter is 'Kendo.Mvc.UI.Fluent.GridBoundColumnBuilder<XXXXX>', however, it should be a string.
Would it be possible to share the full configuration of your grid with us?
Regards,
Georgi
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Hi Georgi,
As I said before when I used column.Editable setting, I got following error:
error CS1061: 'Kendo.Mvc.UI.Fluent.GridBoundColumnBuilder< ManageTeam.Areas.Models.TeamMember>' does not contain a definition for 'Editable' and no extension method 'Editable' accepting a first argument of type 'Kendo.Mvc.UI.Fluent.GridBoundColumnBuilder< ManageTeam.Areas.Models.TeamMember>' could be found (are you missing a using directive or an assembly reference?)Source: System.WebStackTrace: at System.Web.Compilation.AssemblyBuilder.Compile() at ...
I attached Index file and related images inside zip file.
Thanks for your support.
Hi Daochuen,
I have investigated the provided code snippet and the declaration seems correct. However, I have noticed that the referenced version for this thread is 2020.3.915, can you confirm that you are using the latest version of the suite? I am asking due to the fact that the Editable option might be missing in certain older versions.
Make sure that the Kendo.Mvc.dll is using the latest version as well as the referenced client-side resources use the latest version.
Regards,
Tsvetomir
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Hi,
The issue with the Editable option is related to the version of the product that is used. Since the product is in active development with every release there are new features, enhancements, bug fixes, and new components. Therefore, there are versions under which specific features are not available.
It is recommended to always keep up-to-date with the latest versions of the suite.
Kind regards,
Tsvetomir
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.