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

[Solved] PanelBar in TreeView

0 Answers 22 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
habich
Top achievements
Rank 1
habich asked on 04 Aug 2010, 02:21 PM
Hallo

I try to create a TreeView where every ChildNode is an PanelBar the Content of the PanelBar is a PartialView.

The Problem im facing is that i cant find an example for using Mapping.For<> (dynamic binding) with content that
loads on demand and gets values from these mapping.

SomeThing like :

01.<%var data = new MVCTEstDummy.Models.AddressMeterPointFactory(new Guid("3A936419-8E8E-4611-9334-2CAE9E7E786C")); %>
02.  
03.  
04.    <%Html.Telerik().TreeView().ShowLines(true).Name("TreeView").ShowCheckBox(true)
05.          .BindTo(data.amp, mappings =>
06.          {
07.              mappings.For<MVCTEstDummy.Models.A_MP.AddressMeterPoint>(binding => binding
08.                  .ItemDataBound((item, root) =>
09.                      {
10.                          item.Value = root.Address_ID.ToString();
11.                          item.Text = root.AddressName;                          
12.                          item.Content = () =>
13.                          {
14.                             Html.Telerik().PanelBar().Name("Panel").
15.                             BindTo( (root.MeterPoints), mappings2 =>
16.                             {
17.                                 mappings.For<MVCTEstDummy.Models.A_MP.MP>(binding2 => binding2
18.                                     .ItemDataBound((SubItem, msl) =>
19.                                     {
20.                                         SubItem.Text = "Text";//msl.Description;
21.                                         SubItem.Content = () => 
22.                                         { Html.RenderAction("UsageOfMeterPoint", "Home", new { id = msl.MP_ID}); };
23.                                     }) 
24.                                 );
25.                             }).Render();
26.                          };          
27.                      })
28.             );
29.          }).Render();   
30. %>


Im getting an exception that the root.MeterPoints contains no elements

Every help would be appreciated

MfG

P.S. how can i make a ticket for opensource MVC Extensions
Tags
TreeView
Asked by
habich
Top achievements
Rank 1
Share this question
or