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

[Solved] Problem with treeview

2 Answers 160 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.
narayana
Top achievements
Rank 1
narayana asked on 13 Aug 2010, 12:18 PM
Hi I am trying to use Telerik Treeview for Dsplaying the dynamic data.
By binding model to tree view when i am trying to write treeview its showing the following error any one help me.

<%

 

= Html.Telerik().TreeView().Name("TreeView").BindTo(Model, mappings =>

 

{

mappings.For<

 

EntityData>(binding => binding.)

 

})%>


its showing error at mappings.for Stating
error:
Telerik.web.Mvc.UI.TreeView Item does not contain defination for 'For' and no Extension method 'For' accepting  a first argument of type Telerik.web.Mvc.UI.TreeView are u missing reference or directive?

I have Registered the script and also included js file in the View.

any one help?

2 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 1
answered on 09 Sep 2010, 08:36 PM
I had this same problem.  Fome some reason VS 2010 doesnt recognize that what you are binding to is an IEnumerable so you have to cast your model like so:

<%

 

= Html.Telerik().TreeView()

 

    .Name(

 

"TopicsTree")

 

    .BindTo((

 

IEnumerable) Model.Topics, mappings =>

 


that is what fixed it for me.  Let me know if this works for you

Kevin
0
Alexandre Jobin
Top achievements
Rank 1
answered on 18 Oct 2010, 05:06 PM
i had the same issue with Visual Studio 2010 and this trick have solved the problem.

im curious to know what is the bug exactly. Is it on Telerik side or Microsoft side?

alex
Tags
TreeView
Asked by
narayana
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 1
Alexandre Jobin
Top achievements
Rank 1
Share this question
or