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

How to allow edit only one row at a time?

5 Answers 1178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Regi
Top achievements
Rank 1
Regi asked on 13 Jul 2016, 03:05 PM
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.

5 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 15 Jul 2016, 08:33 AM

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.
 
0
Regi
Top achievements
Rank 1
answered on 22 Jul 2016, 11:49 AM

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. 

 

0
Dimiter Madjarov
Telerik team
answered on 25 Jul 2016, 08:42 AM

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.
 
0
Regi
Top achievements
Rank 1
answered on 25 Jul 2016, 10:52 AM

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

0
Dimiter Madjarov
Telerik team
answered on 26 Jul 2016, 07:47 AM

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.
 
Tags
Grid
Asked by
Regi
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Regi
Top achievements
Rank 1
Share this question
or