This question is locked. New answers and comments are not allowed.
Hi
I am new to telerik control and MVC. Kindly bear with me i am having a very basic problem with the treeview control
Here is my view code
Here is my controller code
My view code couldn't recognize for in "mapping.for". I have checked the telerik dll its correct version is installed. I am using MVC 2
Any sample project with model binding is greatly appreciated
Regards
I am new to telerik control and MVC. Kindly bear with me i am having a very basic problem with the treeview control
Here is my view code
| <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<UserManagement.Models.SysPackage>>" %> |
| <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
| Home Page |
| </asp:Content> |
| <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
| <h2><%= Html.Encode(ViewData["Message"]) %></h2> |
| <p> |
| To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>. |
| </p> |
| <%= |
| Html.Telerik().TreeView() |
| .Name("TreeView") |
| .BindTo(Model, mappings => |
| { |
| mappings.For<UserManagement.Models.SysPackage>(binding => binding |
| .ItemDataBound((item, syspackage) => |
| { |
| item.Text = syspackage.PkgName; |
| }) |
| .Children(Syspackage => Syspackage.SysModules)); |
| mappings.For<UserManagement.Models.SysModules>(binding => binding |
| .ItemDataBound((item, sysModule) => |
| { |
| item.Text = sysModule.Modulename; |
| })); |
| }) |
| %> |
| </asp:Content> |
Here is my controller code
| umObjRightsRepository _umObjRightsRepository = new umObjRightsRepository(); |
| return View(_umObjRightsRepository.FindAllPackages()); |
My view code couldn't recognize for in "mapping.for". I have checked the telerik dll its correct version is installed. I am using MVC 2
Any sample project with model binding is greatly appreciated
Regards