I have a data source as a DataTable [this will have a varying columns]. I want to bind this datatable to the mvc contrib's Grid in asp.net MVC2. I donot have a fixed model that can explain my data.
Is it possible to do this in MVC Contrib Grid?.
Details are available here also in CodePlex
Here is Reply from Jeremy, regarding use of MVCContrib Grid in ASP.NET MVC 2.0
It is only designed to work with strongly-typed objects with a fixed
number of columns - not dynamic objects and not datatables.
This post is closed
Related
Does anyone know any article or tutorial how to create nice grid for mvc with functions like columns sorting, paging and searching for items inside the grid?
Sorting, Filtering, and Paging with the Entity Framework in an ASP.NET MVC Application
Now the best option is Grid.MVC . which you can download from Nuget.
Website :https://gridmvc.codeplex.com/
Demo :http://gridmvc.azurewebsites.net/
Tutorial :http://www.codeproject.com/Tips/597253/Using-the-Grid-MVC-in-ASP-NET-MVC
I have an existing MVC site, built some years back, and I am now removing all my custom grid code with Telerik's MVC Grid.
I wish to utilise the ServerSide editing but the examples show the SourceCodeFile scaffolding on a single control actionresult reference by a single MVC grid in a single view.
My issue is that I have mulitple MVC grids called by renderpartial in a single view with a single controller actionresult. I cannot have multiple scaffolding on the single actionresult.
I therefore need some assistance on thinking this through as I only visit this project once in a while and I am not constantly building in MVC so do not totally know all my options.
Also posted on the Telerik forums at: http://www.telerik.com/community/forums/aspnet-mvc/grid/existing-mvc-website---integrating-telerik-mvc-grid-to-use-serversideediting.aspx
If you look here, you will see that for each grid, you can specify the action/controller to execute for each action (select, insert, update, delete). If I am understanding you correctly, you should then be able to manage editing of each grid server side, correct?
I have an entity which has a list of some object and I want to let the user to add as much as he want from that object so that I can put them in the list.
how can I create that in razor view? should I use Ajax and if yes how?
You may take a look at the following blog post. It was written for ASP.NET MVC 2, but it is very good and those notions still apply in ASP.NET MVC 3. Adapting it to Razor would be trivial.
I see that there is the Telerik Grid, jqGrid and WebHelper WebGrid as part of the framework. Am I missing any others?
Which one works best on a commercial application with thousands of rows and master/detail relationships for ASP.Net MVC 3?
I have used the Telerik MVC grid in production. Take a look at the grid at an online Diamond store. It works the same with even 50k+ rows as it only sends the current page to the browser + it has many cool features like Filters, Ajax binding etc.
No idea on the master details front. You could find more info about it on Telerik's Site
there is also grid supplied by mvccontrib. I personally use telerik grid having some cool features and scale for large data Q3 2010 has some good improvements such as inline editing etc. For MVC 3 grid i am waiting for rtm of mvc 3 coming in January
If you're using Telerik for a commercial project, then you will need to buy it. Check this link: http://www.telerik.com/products/aspnet-mvc/getting-started/licensing.aspx.
We're using the jQuery in our project, so the jqGrid is most suitable for us. It's powerfull, has a lot of plugins and completely free, but little bit more complicated in use than Telerik.
jqGrid usage example:
[view]
http://xenta.codeplex.com/SourceControl/changeset/view/11214#118453
[controller]
http://xenta.codeplex.com/SourceControl/changeset/view/11214#118416
how to get a gridview in model view control,how to edit,delete the gridview with source code
Telerik has a great grid that's free (open source) for MVC. You can view it here, and the download is on their web site.
http://demos.telerik.com/aspnet-mvc/grid
You don't have access to ASP.NET controls in ASP.NET MVC, well not with the postback and viewstate stuff atleast.
However, you can create a nice GridView with ajax edit/delete capabilities by using something like jqGrid and a little code. Here are a couple of blog posts to get you started :
Full Walkthrough of MvcContrib Grid with jQuery Data table
Using jQuery Grid With ASP.NET MVC
Hope that helps
Paginated List
Divides IQueryable source of any type on pages and returns items for current page. Useful for creating custom gridviews and pagers in C#, ASP.NET WebForms or MVC. Althought this code is used for pagnition, there is example on how to create Gridview with paging. Shouldn't be too hard to create CRUD actions from it.