Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am new to MVC development.

I have mostly worked on webforms.
I can display data from table in a tabular format in MVC view and wish to edit a row on that same page as in happens when we click edit in Gridview control.

What I thought for this was to keep textbox (visible false) with label and set them visible when edit link is clicked.
Is my approach in right direction?

Please let me know the logic.
Posted
Updated 13-Jan-11 23:05pm
v3
Comments
Dalek Dave 14-Jan-11 5:05am    
Edited for Readability.

Possibly have a look into the Telerik MVC controls, I'm really liking the presentation + fluent syntax

The controls are free and open source.


This demo looks like it will do exactly what you're after. The nice thing is you have to choice of either server side 'postback' behaviour or implementing AJAX editing

'Server Editing'
http://demos.telerik.com/aspnet-mvc/Grid/EditingServerSide/3?mode=InLine&type=Text&Grid-mode=edit[^]

'Ajax Editing'
http://demos.telerik.com/aspnet-mvc/grid/editingajax[^]



Quite a few people using them and some full walkthroughs out there

http://weblogs.asp.net/rashid/archive/2009/11/05/using-telerik-mvc-grid-in-crud-scenario.aspx[^]
 
Share this answer
 
v3
Comments
Wild-Programmer 15-Jan-11 7:06am    
Thanks Dylan, but as a developer I rely more on making my own controls. I will be glad if can make that functionality myself (I know I wont get Nobel prize for that) but just for self satisfaction ;)

I wish I could get the inside logic for the same.
Dylan Morley 16-Jan-11 8:47am    
Well, the controls are open source, so why not read the source code & see how they've implemented it? Then you can do something similar in your own code.
Dalek Dave 22-May-11 6:24am    
Good Answer
Give a look to my Mvc Controls toolkit : http://mvccontrolstoolkit.codeplex.com/[^]

see here a grid working: http://mvccontrolstoolkit.codeplex.com/wikipage?title=DataGrid%20and%20Pager%20Complete%20Example[^]

Here you can find also a lot of other useful controls like a treeview
 
Share this answer
 
Comments
Dalek Dave 22-May-11 6:24am    
Good links.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900