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

[Solved] How to present multiple charts in a tab?

2 Answers 116 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Craig
Top achievements
Rank 1
Craig asked on 21 Nov 2011, 08:13 PM
Hi,
I have a tabstrip into which I am loading a chart (pie) via LoadContentFrom. That works great.

I now want to extend this and display multiple charts (pies again) in the same tab but this is where I am stuck.

Currently, each partial view is associated with a controller and model and each works individually if I substitute the partial view name in the LoadContentFrom call. Query parameters are passed in the LoadContentFrom RouteValueDictionary argument and work ok for each chart when displayed on their own. Note the models for each are different.

I've tried using another partial view in which these are loaded via multiple @Html.Partial statements but the arguments passed with the LoadContentFrom in the RouteValueDictionary do not seem to be passed automatically so I end up with three empty charts.

Any suggestions how to get the arguments passed to the inner partial views please?

Also, any comments welcome regarding my approach.
 
Thanks
Craig

2 Answers, 1 is accepted

Sort by
0
Craig
Top achievements
Rank 1
answered on 22 Nov 2011, 01:22 PM
I'm making some progress. I have restructured the design and can now display the charts with the different data sources by using the splitter and panes.
This is with a single level of nesting. I want to add another level of nesting so I can create a basic grid of x rows * y columns. I have created a helper for the next level but cannot add it to the splitter pane content. 

Here's a simplified extract of the code starting at  tabstrip .content. 

        .Content(@<text>
 @(Html.Telerik().Splitter().Name("Splitter1")
       .Orientation(SplitterOrientation.Vertical)      
       .Panes(vPanes =>      
       {
           vPanes.Add()
               .Scrollable(false)
               .Collapsible(true)
               .                                                 <<<< I want the helper added to the pane
       }))      
                </text>

What is the required code to add the helper to the panes content? Do I use .Content( some args) or LoadContentFrom(some args)?

Thanks
Craig
0
Craig
Top achievements
Rank 1
answered on 22 Nov 2011, 03:34 PM
I have resolved it. I had to factor out another level into a second helper and use the following code in Content to use it:

   .Content(@<text>
                           @myHelper1()
                    </text>);

Craig
Tags
TabStrip
Asked by
Craig
Top achievements
Rank 1
Answers by
Craig
Top achievements
Rank 1
Share this question
or