1

I want to use telerik treeview in mvc, but i don't want to use kendo UI, and i can't fine any example of teleric treeview for mvc.

can any one help me or give me any example so i can learn and understand?

I want to use treeview with checkbox and list is like this...

{
pencil 
  *natraj
  *apsara
pen
  *bollpen
     >rotomak
     >add jel
  *Inkpen
Eraser
  *natraj
}

This type of list then how can i use teleriK treeview with mvc framework for insert and delete function?

it's relly need please give any example or sample code.

2
  • Why don't you want to use kendo ui according to telerik their mvc libary is obsolete and you should switch to kendo ui? Commented Mar 9, 2014 at 7:40
  • see i am using nopcommerce and in nopcommerce there is already Teleric UI so i think if i use kendo UI Then there is any issue is created, because Kendo UI and Teleric UI are both form same companies and for kendo UI i want to purces licence. Commented Mar 9, 2014 at 8:09

1 Answer 1

1

Sample code:

@model YourModelTree
     @(Html.Telerik().TreeView()
                  .Name("TelerikTree")
                  .ShowCheckBox(true)
                  .BindTo(Model, mappings =>
                  {
                      mappings.For<YourModelTree>
                          (binding => binding
                              .ItemDataBound((item, modelItem) =>
                              {
                                  item.Text = modelItem.Name;
                                  item.Value = modelItem.Id.ToString();
                                  item.Expanded = true;
                                  item.Checked = true;
                              }).Children(c => c.Children));
                  })))

Example of model Tree:

 public class ModelTree
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public IList<ModelTree>() Children {get;set;}
        public ModelTree Parent {get;set;}
    }

Also you can check telerik documentation .If you have any question please ask me.

Sign up to request clarification or add additional context in comments.

2 Comments

Can i use Telerik UI and Kendo UI both in same project? And Telerik UI Have Any Drag and Drop Control like kendo UI?
Yes you can but I will not recommend you to do this , I like more telerik ui than kendo and Telerik UI is for free .For draganddrop check .ShowCheckBox(true) .DragAndDrop(true)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.