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

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

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 04 Apr 2019, 10:00 AM
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.

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 08 Apr 2019, 06:47 AM
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.
Tags
Grid
Asked by
Nick
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or