How to add a new record in the grid without refresh entire grid

2 posts, 0 answers
  1. Nick
    Nick avatar
    9 posts
    Member since:
    Oct 2018

    Posted 04 Apr Link to this post

    I have detail grid for every row in the master grid, all expanded detail grids will be destoryed when add a new record, how to prevent refreshing entire grid when add a new record in the master grid.
  2. Tsvetomir
    Admin
    Tsvetomir avatar
    270 posts

    Posted 08 Apr Link to this post

    Hi Nick,

    When the Hierarchy functionality is used in combination with the Editing, a few prerequisites have to be taken into account. At the time the user adds a new record, the row will be collapsed. From here, there are two options which might be undertaken:

    1. Set default value to the field which makes the connection between the master and child grids. This would ensure that if the user tries to expand the newly created record, the child grid will be populated with a preset selection of data items.

    dataSource: {
       schema:{
         model:{
           id: "EmployeeID",
           fields: {
             EmployeeID: { editable: false, defaultValue: 5 }
           }
         }
       }
     }

    2. Leave the default value not set. However, if the user expands the newly created record, the child grid would perform a "read" request. When there is not a value for the field that indicates with which subset the grid has to be populated, the child grid will be left empty. 

    When the editing has taken place, the grid is refreshed, the DataBound event handler is triggered. However, this should not affect the hierarchy rendering at all. In the following Dojo, the lifecycle of the hierarchy binding could be observed:

    https://dojo.telerik.com/OCUQEFEG

    In case the issue persists, let me know.


    Kind regards,
    Tsvetomir
    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.
Back to Top