Disable cell using inline edit

2 Answers 35 Views
Grid
Eric
Top achievements
Rank 1
Iron
Iron
Iron
Eric asked on 25 May 2022, 11:20 AM

Hi

 

I have a grid using Inline edit, but in some circimstances some cells must be disabled.

How can i do this?

 

Eric

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 26 May 2022, 06:21 PM

Hello Eric,

You can set the Editable parameter of their column to false.

Alternatively, you can use the OnEdit event and cancel it dynamically based on runtime conditions.

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Eric
Top achievements
Rank 1
Iron
Iron
Iron
commented on 30 May 2022, 08:42 AM | edited

Hi

 

Both is not what i need,  not the whole column should not be editable just for some records.  The cell should not be editable, shown to user in disabled color.

So also using the OnEdit is not the solution

See example here, first column

 

Eric

 

0
Nadezhda Tacheva
Telerik team
answered on 02 Jun 2022, 07:58 AM

Hi Eric,

I am stepping in the discussion as my colleague, Marin, is currently out of office.

In general, the idea for setting the Editable parameter to false is to actually perform that dynamically based on the specific cells you want to disable the editing for. You can handle the OnEdit event which provides details for the item the user initiated editing for. In the handler, include your business logic, depending on which the desired cells for this certain item will be disabled. In other words, with the suggested approach, you will be setting the Editable parameter to false for specific item and not for the whole column.

To better illustrate how it can be achieved, I prepared this runnable sample: https://blazorrepl.telerik.com/mmuAOGOL57C4UM5H10.

It showcases disabling the edit of the Name cell for the items with ID less than 4.

I hope this will help you move forward with your application. Please let us know if any further questions are raised.

Regards,
Nadezhda Tacheva
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Eric
Top achievements
Rank 1
Iron
Iron
Iron
commented on 02 Jun 2022, 08:49 AM

Love it!

Thanks

Eric

Tags
Grid
Asked by
Eric
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Marin Bratanov
Telerik team
Nadezhda Tacheva
Telerik team
Share this question
or