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

Hierarchy Grids, have the change function in the detailed(sub) grid update a column on the main table.

4 Answers 537 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 21 Mar 2013, 09:08 PM
I have a total score field in the master table that I need to update from the detail(sub) table. 

I think this would be achieved in the detailed(sub) table, every change I calculate the full total score and need to update the row that the sub table belongs to. I tried the set command on the top object , but it hasn't worked for me yet. 

Any ideas would be appreciated?

Thanks

-Andrew

4 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 22 Mar 2013, 07:22 AM
I figured out how to set the data in the master from the child BUT, the
whole table collapses the child grids when anything is updated, this is a
very annoying behavior, is there anyway I can just update a field in
the master table without it collapsing all the child elements?
(basically, update the column, no mass table update)
0
Alexander Valchev
Telerik team
answered on 25 Mar 2013, 02:15 PM
Hi Andrew,

I am afraid that this behaviour cannot be prevented. When data changes, DataSource will throw its change event which will force the Grid to rebind. As a result the detail rows will collapse.

One possible workaround is to remember expanded child elements and reopen them at dataBound of the Grid.
Similar approach is used in this demo.
dataBound: function() {
    this.expandRow(this.tbody.find("tr.k-master-row").first());
},

Refreshing a single column or row is not supported.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
jon
Top achievements
Rank 1
answered on 26 Sep 2014, 12:41 AM
I just need to add my two cents. This is such a common requirement, and the solution here is an absolute hack. I don't believe this work-around is a good solution.
0
Kiril Nikolov
Telerik team
answered on 29 Sep 2014, 04:12 PM
Hi Jon,

I am afraid that at the moment this is the only solution available, as the grid rebind on data change cannot be prevented. I think that saving the expanded row and then expand it again on dataBound is the most viable workaround that can be offered at the moment.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Alexander Valchev
Telerik team
jon
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Share this question
or