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

[Solved] I want to display only the first child of a node in a Telerik TreeView mvc3

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.
Souna
Top achievements
Rank 1
Souna asked on 11 Apr 2012, 06:46 PM
I have a Telerik TreeView that has many node models and many children assigned to each node model.
I would like to only display the first child of the first node and hide the others upon loading the treeview.

something similar to

>nodemodel
       first child

does anyone can give me some hints or help on that.

Many Thanks,   

@(Html.Telerik().TreeView()
    .Name("TreeView")
    .BindTo(Model.ListModelName, mappings =>
    {
        mappings.For<ModelName>(binding => binding
            .ItemDataBound((item, ModelName) =>
            {
                item.Text = ModelName.Name;
                 
            })
            .Children(c => c.FieldEntries)
             
        );
        mappings.For<OtherModel>(binding => binding
            .ItemDataBound((obj, OtherModel) =>
            {
                                 
                obj.Text = OtherModel.Name + " : "  + OtherModel.Description;
            })
        );
    }).ExpandAll(true)
)
Tags
TreeView
Asked by
Souna
Top achievements
Rank 1
Share this question
or