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

How to change cell after another cell been changed on Client.

2 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 14 Nov 2019, 03:28 PM

Hello 

I am using RadGrid, which is using BatchEditing.

The grid has columns: From, To and Hours.

I am updating on Client column Hours as a difference of From and To: (From: 6:00 To: 10:30 Hours: 4:30).

This change needs to be done when the column is changed.

I am using the event "ClientSettings-ClientEvents-OnBatchEditCellValueChanged" to check if columns in question were changed and to prepare the result. However, I cannot use batchEditingManager.changeCellValue() in this event, because the event of changing the cell is not done yet. I will get an exception. I am currently waiting to user click and updating cells in that event, which is not optimal. I tried more events but with similar problems.

I know how to get cells, how to change them etc.

I just need the correct event after a cell is done updating or update function which will not loop to an existing event.

Thank you.

2 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 19 Nov 2019, 06:55 AM

Hello Igor,

 

I want to commend you on your Knowledge for Batch editing. Your approach is correct and the OnBatchEditCellValueChanged is the right place to achieve this.

All you need to add is an setTimeout() delay in order to allow the initial chain to finish before changing the value of the other cell:
https://www.w3schools.com/jsref/met_win_settimeout.asp

Try wrapping the changeCellValue() logic inside a setTimeout function and the issue should be resolved.

I hope this will prove helpful. Let me know if I can assist with anything else.

 

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Igor
Top achievements
Rank 1
answered on 19 Nov 2019, 08:36 AM

This works.
Thank you very much.

Tags
Grid
Asked by
Igor
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Igor
Top achievements
Rank 1
Share this question
or