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

Telerik Grid for MVC2

6 Answers 141 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alan
Top achievements
Rank 1
Alan asked on 09 Feb 2011, 05:56 AM
Hi,

I have been struggling in looking for a gridview like control using in my MVC 2 project.
What I need is to display about 3000 records (either paging or not) and let the user can select 1 record. No need to add/edit/delete records.

This project will be used in-house only, ie. for our staff's use.

Can I download the Telerik extension for that purpose?

And any sample project so that I can get started? I would use a model that is populated with data and fill up the grid if possible.

Thanks

6 Answers, 1 is accepted

Sort by
0
Alan
Top achievements
Rank 1
answered on 09 Feb 2011, 11:41 PM
Hi,

VWD 2010 Express, MVC 2.
I have installed the Extensions for ASP.NET MVC Q3 2010.
Added the Telerik.Web.Mvc into my project's References.

Modified the web.config:
<pages>
     <namespaces>
       <add namespace="System.Web.Mvc" />
       <add namespace="System.Web.Mvc.Ajax" />
       <add namespace="System.Web.Mvc.Html" />
       <add namespace="System.Web.Routing" />
       <add namespace="Telerik.Web.Mvc" />
     </namespaces>
   </pages>


Added into the controller unit:
using Telerik.Web;
using Telerik;


When run my application, the error occurred in the view:
 <% Html.Telerik().Grid<ManagerBusiness>()
                 .Name("MyGrid")
                 .Columns(

It looks like does not recognise HTML.Telerik.

Many thanks.

0
Alan
Top achievements
Rank 1
answered on 10 Feb 2011, 01:14 AM
Hi,

This is the updated of my view:

In the view, I changed the inherits:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MyApplication.Models.Category>>" %>

and also

<% Html.Telerik().Grid<MyApplication.Models.Category>()

Then run and get the error message:

Compiler Error Message: CS1061:

'System.Web.Mvc.HtmlHelper<System.Collections.Generic.IEnumerable<MyApplication.Models.Category>>' does not contain a definition for 'Telerik' and no extension method 'Telerik' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<System.Collections.Generic.IEnumerable<MyApplication.Models.Category>>' could be found (are you missing a using directive or an assembly reference?)

Why it does not know my class "Category"?

Please help.
0
Alan
Top achievements
Rank 1
answered on 15 Feb 2011, 04:51 AM
Hi,

Anyone here can help me please?

Or to get me started would like a very simple code to populate the Grid first? No need to bind to a table or JQuery something like that, just a for loop to populate the grid is enough to get started.
0
Michael
Top achievements
Rank 1
answered on 16 Feb 2011, 10:27 PM
I think the easiest thing to do is use the telerik template mvc2 project within VS, and then look at the online examples and the help guide....
0
James
Top achievements
Rank 1
answered on 05 Nov 2011, 06:16 AM
I have the same issue. Anyone? Michael your "non answer" is helping no one. Please only post if you can contribute. 
0
Georgi Tunev
Telerik team
answered on 07 Nov 2011, 02:08 PM
Hi guys,

 I cannot tell what might be the exact reason for the original problem but Michael have a point. As he suggested, make sure that you've followed all steps from the corresponding documentation article, or use the Wizard from the VS extensions.

As for a simple project that show how to bind the Grid, you can choose one from our Code Library section - like, for example, this one.


All the best,
Georgi Tunev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
General Discussions
Asked by
Alan
Top achievements
Rank 1
Answers by
Alan
Top achievements
Rank 1
Michael
Top achievements
Rank 1
James
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or