Grid edit/add mode

2 posts, 0 answers
  1. Jason
    Jason avatar
    2 posts
    Member since:
    Jun 2012

    Posted 02 Aug 2016 Link to this post

    Any ideas on how to either specify a field is editable if only a edit, and not a new record being added to the grid.  Either inline or popup.  What 'm trying to do is have a field required to be entered on new, but not editable afterwards.

    Ideally, a way in the future to specify which editortemplate view to use on new or edit would be extremely helpful. Since it looks like I'll have inline editing, but can't use the grid create, instead it will just be a button with a custom window and form.
  2. Eyup
    Eyup avatar
    3937 posts

    Posted 04 Aug 2016 Link to this post

    Hello Jason,

    Generally, to distinguish between the insert and update modes, you can use the isNew method in conbination with the edit event handler of the grid:

    Here is a basic sample:
    Copy Code
    Copy Code
    .Events(events => events.Edit("onEdit"))
    Copy Code
    Copy Code
    Copy Code
    Copy Code
    function onEdit(args) {
        if (args.model.isNew() == false) {
                // textbox
                $("#ShipName").attr("readonly", true);
                // dropdownlist
                var kendoDdl = $("#ShipCountry").data("kendoDropDownList");

    You can also log this idea to our public portal:

    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top