This question is locked. New answers and comments are not allowed.
I followed the instructions in the Help file for creating a Grid with Server binding using the VS 2008 MVC Project Template . Next I configured the application as per the Help file instructions (added a reference to the Telerik.Web.Mvc.dll, etc) Then I dropped the Northwind Order table on the Linq to SQL design surface. Then I modified the Home Controller to return the results of the query on the Orders table. The Home Controller now looks like this:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using NorthwindOrder.Models; namespace NorthwindOrder.Controllers { [HandleError] public class HomeController : Controller { public ActionResult Index() { ViewData["Message"] = "Welcome to ASP.NET MVC!"; return View(GetOrders()); } private IEnumerable<Order> GetOrders() { NorthwindDataContext northwind = new NorthwindDataContext(); return northwind.Orders; } public ActionResult About() { return View(); } } } Next I modified Index.aspx as per the Help file sample. See below:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Order>>" %> <asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server"> Home Page </asp:Content> <asp:Content ID="indexContent" 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().Grid<Order>() .Name("Orders") .BindTo((IEnumerable<Order>)ViewData["orders"]) .Pagealbe() .Sortable() %> </asp:Content> Unfortunately I get a run time error which says "The type or namespace name 'Order' could not be found
(are you missing a using directive or an assembly reference?)
Any suggestions on how to resolve this error would be appreciated. Phiip