![]() |
Web Development »
ASP.NET »
General
Intermediate
Gridview with a single ModalPopupExtender/Panel for row editingBy TCartwrightGridview with a single ModalPopupExtender/Panel for row editing |
Javascript, XML, C# 2.0.NET 2.0, Win2K, WinXP, Win2003, ASP.NET, WebForms, Ajax, VS2005, Dev
|
||||||||
|
Advanced Search |
|
|
|
||||||||||||||||


I am not a huge fan of the inline row editing that is provided with most asp.net grids. So, recently I went about trying to implement a pop up edit window for editing the values contained within a grids row. To make it even more interesting I wanted it use Asynchronous javascript callbacks to do this. Since I was already using Ajax.net, and the Ajax Toolkit I went about trying to figure out which control to use, and if any they provided would suit me.
The ModalPopup
I first looked at the modal popup extender as it seemed to be exactly what I needed. However, there were a couple issues with how I wanted to use it.
1) The TargetControlID property is required. So if I wanted to use it how it was designed then I would have to embed a ModalPopup into a ItemTemplate column in the grid with an associated button. This did not appeal to me at all. The same issue occurs for the PopupControlID.
2) Getting the values into the fields contained in the pop up panel. Again I could have embedded the panel into the ItemTemplate column, and bind the fields using standard binding. This REALLY did not appeal to me. HTML bloat anyone?
The PopupControl
I quickly abandoned this one, as it had even more issues than the modal pop up for what I was trying to do.
Raj Kaimal - Master Details using AJAX and the UpdatePanelPopupExtender
I have to say this one looked awesome, and ran quite well. The only issue I ran into is that it flaked out sometimes when doing custom data binding. The other issue, was support. I would have hated to wait on Raj to have to update his code for the next version of Ajax. Considering their track record so far with breaking changes to the design of Ajax.net from the beta's to 1.0 I was not overly enthusiastic about this prospect. Nicely done control though. Would love to see something similar embedded into Ajax.net so the work around I found would be obsolete.
Frustrated, I was about to give up when I read Dynamically-Created-ModalPopupExtender. Which led me back to the use of the ModalPopupExtender. All of the example code is included in the zip. Along with an example showing multiple grids embedded inside an Asp.net Ajax tab. You will need VS.Net 2k5, and version 1.0 of the ASP.NET AJAX framework. The images are courtesy of Michael Hoskins.
02/26/2007-Added an option to use xml as the data source. Will default to xml. Also added an email grid.
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 22 Feb 2007 Editor: |
Copyright 2007 by TCartwright Everything else Copyright © CodeProject, 1999-2009 Web13 | Advertise on the Code Project |