How to allow edit only one row at a time?

6 posts, 0 answers
  1. Regi
    Regi avatar
    5 posts
    Member since:
    Sep 2014

    Posted 13 Jul Link to this post

    Is there an option to allow user to edit only one grid row at a time? Currently user can click Edit on first row, then row 1 appears in edit mode, at the same time he can click on Edit command in row 2 which causes odd UI behavior for me. All the column width settings lost and every columns are cornering to the left side.
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 15 Jul Link to this post

    Hello Regi,

    I am unable to reproduce the mentioned behavior on our demos page. Could you modify it in order to demonstrate the case?

    Generally speaking, the current requirement is the default behavior - only one row can be edited at a time.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. Regi
    Regi avatar
    5 posts
    Member since:
    Sep 2014

    Posted 22 Jul in reply to Dimiter Madjarov Link to this post

    We have this issue in a master/detail grid where detail grid is hidden for some rows. We are displaying the detail part only if there is data. Edit option is provided only on master rows. Do you have any example of this kind (master/detail grid with edit on master row)? If we click on second row edit button when another row edit is in progress the whole grid shrink to left. 

     

  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 25 Jul Link to this post

    Hello Regi,

    Here is an example, in which I combined our InLine editing and Hierarchy demos. Let us know if this is the desired behavior in this case.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  6. Regi
    Regi avatar
    5 posts
    Member since:
    Sep 2014

    Posted 25 Jul in reply to Dimiter Madjarov Link to this post

    Thanks. Our grid have the following change,

    We were hiding the first column k-hierarchy-cell in dataBound event because not all rows had detail data and we are keeping all the detail grids as expanded.

    function DataboundColumns()
        {
            var grid =  $('#grid').data("kendoGrid");
            grid.table.find("tr[role='row']").each(function ()
            {
                grid.expandRow(this);
            });
            $(".k-hierarchy-cell").remove();
            $(".k-hierarchy-col").remove();
        }

    In this case when we click on the next master row edit button when another row is in edit mode, the first one changes to view mode with the 'k-hierarchy-cell' visible. I made this change to your example and got the same behavior.

    A short term fix is to call   $(".k-hierarchy-cell").remove(); in edit event of grid.  Is there any better approach to solve this issue? Our requirements are as follows:-

    1. Do not show the first column which displays the arrow.

    2. Display the detail grid always expanded.

    3. Edit/Update action is only on master row.

    Regi

  7. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 26 Jul Link to this post

    Hello Regi,

    Removing the first column is not supported, but as a workaround I would suggest to just remove the expand icons (arrows) for the rows that don't have data (or all of the arrows) instead. The rest of the requirements will not cause an issue.

    Let me know if this helps or I could assist further.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready