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

Expanding all NestedViewTemplates when grouped client-side

3 Answers 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Condorito
Top achievements
Rank 1
Condorito asked on 05 May 2009, 03:34 PM
Hi,

I have a Rad Grid with a NestedViewTemplate that can be expanded/collapsed client-side.  One of the requirements for this grid is to also be able to expand/collapse all NestedViewTemplates in the Grid client-side with the event raised by an external control, which I can do easily with this code that I found here in an earlier thread:

function expandCollapseAll(expand) { 
                var grid = $find("<%=rgDomestic.ClientID %>"); 
                var table = grid.get_masterTableView(); 
 
                var rows = table.get_dataItems(); 
                for (var i = 0; i < rows.length; i++) { 
                    var Row = rows[i]; 
                    if (expand == true) { 
                        Row.set_expanded(true); 
                    } 
                    else { 
                        Row.set_expanded(false); 
                    } 
                } 
 
            } 
 

The problem is that I also have a requirement that the grid needs to have grouping-by-column ability (also done on the client-side).  However, when the grid is grouped by a column or columns, the code above no longer works and gives me the following error message when it hits the line below, 'title' is null or not an object:

if(_348.title==this._owner._hierarchySettings.ExpandTooltip) 

Is there any way I can expand or collapse all nestedviewtemplates with an external control client-side when the Rad Grid has been grouped by a column?  Thank you.

3 Answers, 1 is accepted

Sort by
0
Condorito
Top achievements
Rank 1
answered on 06 May 2009, 01:36 PM
Any thoughts on this?   Thanks...
0
Seth
Top achievements
Rank 1
answered on 06 May 2009, 08:38 PM
Yes, I too have a need for this functionality client-side.
0
Sebastian
Telerik team
answered on 08 May 2009, 12:26 PM
Hello guys,

I suggest you try out the approach presented in the sample project from this code library thread. It should be applicable for NestedView templates, too.

Best regards,
Sebastian
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.
Tags
Grid
Asked by
Condorito
Top achievements
Rank 1
Answers by
Condorito
Top achievements
Rank 1
Seth
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or