|
-
Dec 3rd, 2010, 06:10 AM
#1
Thread Starter
Addicted Member
GridView behaviour in MVC
Hi, I'm working on MVC2 based web solution where it have HTMLHelpers to render various kinds of controls over the view. But in the ASP Web Form based solutions there is one of the good control GridView which facilitates user with numerous kinds of things in addition to display the records i.e. add/delete/edit the record, paging and so on. Is this possible in MVC2 or MVC3? or is there any alternative that facilitate some behavior not same but like this with most required things within same location.
-
Dec 3rd, 2010, 07:49 AM
#2
Re: GridView behaviour in MVC
The GridView is an ASP.NET server control. Server controls get processed by ASP.NET and replaced with the appropriate HTML. In MVC, there are no server controls. It's up to you to generate the appropriate HTML. You can write your own methods to output the exact same HTML code as a GridView if you want, but it's up to you to do it.
You may want to consider using a jQuery grid instead of doing it all in HTML yourself.
http://www.trirand.com/blog/
-
Dec 4th, 2010, 02:12 AM
#3
Hyperactive Member
Re: GridView behaviour in MVC
yep, you got to let go with the things webforms spoiled you with.
ideally you want to build your own (it's just a table of records with paging for the most cases anyhow)
You do have a few other options though (Those I know from the top of my head, just google it)
MvcContrib Grid
Telerik
jQuery Grid
-
Dec 21st, 2010, 06:25 AM
#4
Re: GridView behaviour in MVC
It's worth noting that the new MVC3 (currently at RC2) includes a WebGrid class that can be used, via a helper method, to build what is essentially the equivalent of a WebForms GridView. There is also jqGrid, which is a free jQuery plugin that provides a very functional grid that is easy to use in an MVC app.
Last edited by jmcilhinney; Dec 21st, 2010 at 07:04 AM.
Reason: Changed DataGrid to GridView
-
Dec 21st, 2010, 06:39 AM
#5
Hyperactive Member
Re: GridView behaviour in MVC
 Originally Posted by jmcilhinney
It's worth noting that the new MVC3 (currently at RC2) includes a WebGrid class that can be used, via a helper method, to build what is essentially the equivalent of a WebForms DataGrid.
Cool. Just started out with MVC3 and did not notice that.
-
Dec 22nd, 2010, 02:33 AM
#6
Thread Starter
Addicted Member
Re: GridView behaviour in MVC
 Originally Posted by jmcilhinney
It's worth noting that the new MVC3 (currently at RC2) includes a WebGrid class that can be used, via a helper method, to build what is essentially the equivalent of a WebForms GridView. There is also jqGrid, which is a free jQuery plugin that provides a very functional grid that is easy to use in an MVC app.
Hi, Thank you jmcilhinney, thats greate......I'll go through WebGrid. Have you any good link containing discussion about this helper method to grasp this quickly.
-
Dec 22nd, 2010, 04:24 AM
#7
Re: GridView behaviour in MVC
 Originally Posted by jivangoyal
Hi, Thank you jmcilhinney, thats greate......I'll go through WebGrid. Have you any good link containing discussion about this helper method to grasp this quickly.
Unfortunately there isn't a lot around at the moment. Everything I found was for MVC3 beta and some things have changed a little in the RC. I just searched, read what I could and experimented a bit. I also opened the relevant assembly in .NET Reflector to get a clear idea of exactly what functionality was available.
-
Dec 22nd, 2010, 04:35 AM
#8
Hyperactive Member
Re: GridView behaviour in MVC
 Originally Posted by jmcilhinney
I just searched, read what I could and experimented a bit. I also opened the relevant assembly in .NET Reflector to get a clear idea of exactly what functionality was available.
Prodding around in the MVC3 Source code also helps. (Though it seems only MVC 3 Beta source code are available.)
What I like to do is add the source code to my project, and reference that project instead of Mvc dll's. Rather not do that with the MVC3 site I'm building now though. Not sure what changed between Beta and RC2
-
Jan 18th, 2011, 12:53 PM
#9
Re: GridView behaviour in MVC
The best thing about MVC3 is RAZOR engine support, its so much cleaner than WebForms engine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|