This is a migrated thread and some comments may be shown as answers.
Incorrect indenting, when bind to hierarchical model
1 Answer 46 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kan
Top achievements
Rank 1
Kan asked on 03 Sep 2010, 11:11 PM

MVC 2 on .NET 4, Telerik Extensions for ASP.NET MVC (2010_2_713)

Here is model:

 

 

 

 

public class MenuItem
{
   public string Id { get; set; }
   public string Name { get; set; }
   public List<MenuItem> ChildItems { get; set; }
   public string Url { get; set; }
}


Here is how model binds to PanelBar

 

Html.Telerik().PanelBar()
.Name("SportNav")
.BindTo(Model, mappings => 
{
    mappings.For<MenuItem>(binding => binding
            .ItemDataBound((item, sports) =>
            {
                item.Text = sports.Name;
            })
            .Children(sports => sports.ChildItems));
})

There are multiple levels of MenuItem object in the model, all levels are bound correctly, except it loses indentation, starting from the 3rd level. It looks like:

Level 1
   Level 2
      Level 3
      Level 4
      ......

Are there anything missing? Thanks

Regards

K Wu

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 06 Sep 2010, 08:32 AM
Hi Kan,

 You can add the following CSS rule to indent the 4th level of items:

   <style>
    .t-panelbar .t-group .t-group .t-group .t-link
    {
        padding-left: 3em;
    }
   </style>

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
PanelBar
Asked by
Kan
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or