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

3 posts, 1 answers
  1. Igor
    Igor avatar
    19 posts
    Member since:
    Jun 2019

    Posted 14 Nov 2019 Link to this post

    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. Answer
    Eyup
    Admin
    Eyup avatar
    3988 posts

    Posted 19 Nov 2019 Link to this post

    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.
  3. Igor
    Igor avatar
    19 posts
    Member since:
    Jun 2019

    Posted 19 Nov 2019 in reply to Eyup Link to this post

    This works.
    Thank you very much.

Back to Top