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

[Solved] NestedViewTemplate client side refresh bug

4 Answers 178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 14 Apr 2009, 12:13 AM
Hi folks
I think I have stumbled on a bug - wonder if you could advise....
I have set my grid to data bind on the client side using a WCF service. My grid has a nested view template which has a few labels in it. When the grid is re-bound, any nested rows which were visible seem to stay with the grid even after it is re-bound (so you end up with the new results + the previously visible nested rows). To repro the bug:
1.  Data bind the grid so that there are records in it.
2.  Expand a few of the nested rows and leave them visible.
3.  Force the grid to re-bind on the client side.
Notice now the visible nested rows haven't been removed.

Here is the code I am using to do the binding:
Grid settings:
            <ClientSettings>
                <DataBinding Location="~/Services/Anonymous/Reporting/OnDemandLatest.svc" SelectMethod="GetData"
                    SelectCountMethod="GetCount" EnableCaching="false" StartRowIndexParameterName="startIndex"
                    MaximumRowsParameterName="maxRowCount" />
                <ClientEvents OnDataBinding="Grid_DataBinding" OnRowDataBound="Grid_RowDataBound"
                    OnDataBound="Grid_DataBound" />
            </ClientSettings>

JS code (this is called on a button click)
            function Rebind() {
                 ShowLoadingPanel();
                 Grid().get_masterTableView().rebind();  // Note: Grid() is just a function which returns the grid.
            }

4 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 16 Apr 2009, 04:03 PM
Hello William,

I am afraid that RadGrid does not support client-side binding with NestedViewTemplates out of the box.
You can try collapse all items before bind on client or you should take care of populating controls in NestedViewTemplate manually.

Regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
William
Top achievements
Rank 1
answered on 19 Apr 2009, 10:43 PM
Hi Nikolay
Thanks for the reply. The problem is not to do with the population of the nested rows (I have got that bit working) - it is to do with the fact that expanded rows are not removed when the data is re-bound. This must be a bug - I can see no logical reason for why this happens.
0
Nikolay Rusev
Telerik team
answered on 23 Apr 2009, 10:31 AM
Hello William,

As I tried to explain in my previous post RadGrid with client-side data-binding does not support NestedViewTemplates. Thus there might be unexpected result when implementing this scenario.
If you open formal support ticket and send us runnable version of your application we will do our best to help you solve this problem.

All the best,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
William
Top achievements
Rank 1
answered on 28 Apr 2009, 11:42 PM
Hi. I've worked around it by collapsing all the rows before doing a data bind. This seems to work. Thanks
Tags
Grid
Asked by
William
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
William
Top achievements
Rank 1
Share this question
or