5,699,997 members and growing! (20,783 online)
Email Password   helpLost your password?
Web Development » ASP.NET » General     Intermediate

Gridview with a single ModalPopupExtender/Panel for row editing

By TCartwright

Gridview with a single ModalPopupExtender/Panel for row editing
Javascript, XML, C# 2.0, C#Windows, .NET, .NET 2.0, Win2K, WinXP, Win2003, ASP.NET, WebForms, Ajax, VS2005, Visual Studio, Dev

Posted: 22 Feb 2007
Updated: 22 Feb 2007
Views: 79,544
Bookmarked: 87 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
25 votes for this Article.
Popularity: 6.01 Rating: 4.30 out of 5
1 vote, 4.0%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
2 votes, 8.0%
4
22 votes, 88.0%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article
A gridview

Screenshot - persongrid.jpg

The modal

Screenshot - personGridEditWindow.jpg

Introduction

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.

Requirements:

1) I wanted to be able to pop up an edit window for editing that disabled the background window. (or gave the appearance of being disabled)
2) I wanted to control the save and edit server side as I was using custom business objects that were bound to the grids through the ObjectDataSource control.
3) It needed to be asynchronous. I wanted functionality, but I wanted speed, and ease for the customer as well.

History

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.

Changes:

02/26/2007-Added an option to use xml as the data source. Will default to xml. Also added an email grid.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

TCartwright



Occupation: Web Developer
Location: United States United States

Other popular ASP.NET articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 47 (Total in Forum: 47) (Refresh)FirstPrevNext
GeneralWhat is SCRUB?memberdenniswong28816:14 28 Aug '08  
GeneralVery Helpfulmemberinetfly12311:44 19 Aug '08  
Newsquestion plz help on grid view problemmembervardhan.menta0:31 2 May '08  
Generalexcellent articlemembermancred17:50 19 Nov '07  
QuestionThe answer must be so close...memberAndoTheOptimal6:24 22 Oct '07  
GeneralProblem using the technique with formviewmembermhariri4:14 13 Oct '07  
AnswerRe: Problem using the technique with formviewmemberHenrique Duarte2:02 9 Nov '07  
GeneralMuch Thanksmemberairjasper15:06 20 Sep '07  
QuestionAppreciation and Questionmemberdetails@insidespirit.com8:55 17 Aug '07  
Questionsticky panelmemberdsmportal5:13 14 Aug '07  
QuestionQuestionmemberstormcandi10:09 11 Jun '07  
AnswerRe: QuestionmemberTorben713:13 6 Jul '07  
GeneralRe: Questionmemberstormcandi6:35 6 Jul '07  
Questiona problem!membervicqqq17:46 5 Jun '07  
QuestionPaging do not workmemberkcchenkd18:33 29 Apr '07  
AnswerRe: Paging do not workmemberBurak Donbay5:54 15 May '07  
GeneralRe: Paging do not workmemberdsmportal5:48 14 Aug '07  
GeneralRe: Paging do not workmemberdetails@insidespirit.com12:48 17 Aug '07  
GeneralGood IdeamemberVinay Yeluri18:08 17 Apr '07  
GeneralExcellentmemberJohn Maloney4:40 11 Apr '07  
GeneralNice idea, though no validation available.memberGary Noter12:03 9 Apr '07  
GeneralRe: Nice idea, though no validation available.memberTCartwright7:46 11 Apr '07  
GeneralRe: Nice idea, though no validation available.memberadman66619:02 9 Oct '07  
GeneralFirefox issuesmemberTCartwright8:57 28 Mar '07  
Generalexample does not work any morememberLeMoustique0:36 14 Mar '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 22 Feb 2007
Editor:
Copyright 2007 by TCartwright
Everything else Copyright © CodeProject, 1999-2008
Web11 | Advertise on the Code Project