Connect with me
Search
Twitter Feed
Navigation
« Enable your incompatible extensions in Firefox 3.1 betas | Main | Reserved.ReportViewerWebControl.axd not found »
Thursday
Dec112008

Dynamic Data - Enable Inline Editing

I had a question from last night’s user group after the presentation regarding supporting inline editing. You can roll your own solution by creating your own page template with support for inline editing or you can change the routing and use the one built in with Dynamic Data.

To do this, in the Global.asax file, just comment out the default route and uncomment the second one that routes everything to the ListDetails template.


            // The following statement supports separate-page mode, where the List, Detail, Insert, and 
            // Update tasks are performed by using separate pages. To enable this mode, uncomment the following 
            // route definition, and comment out the route definitions in the combined-page mode section that follows.
            //routes.Add(new DynamicDataRoute("{table}/{action}.aspx")
            //{
            //    Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
            //    Model = model
            //});

            // The following statements support combined-page mode, where the List, Detail, Insert, and
            // Update tasks are performed by using the same page. To enable this mode, uncomment the
            // following routes and comment out the route definition in the separate-page mode section above.
            routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {
                Action = PageAction.List,
                ViewName = "ListDetails",
                Model = model
            });

            routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {
                Action = PageAction.Details,
                ViewName = "ListDetails",
                Model = model
            });

P.S. PPT and Video will be up shortly

Reader Comments (2)

Thanks!

20 March 2010 | Unregistered Commenterkam

And what about inserting new line?

20 March 2010 | Unregistered CommenterPetr

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>