Solved

How Do I Create A Floating Panel

Posted on 2009-05-12
4
1,759 Views
Last Modified: 2013-11-07
I have a large ASPTable grid, 10 Columns by 50 Rows. When a user selects a cell, an ASPPanel appears with some controls in it for them to modify.  I currently have the ASPPanel appearing at the bottom of the ASPTable, but it's annoying because you have to scroll to the bottom of the page to modify the values in the ASPPanel if you are selecting a cell at the top of the ASPTable.  I would like to know if there is a way to get the Panel to float on the right side of the ASPTable at the top of the page and as you scroll down have the ASPPanel scroll with you so the ASPPanel is always at the top of the page and visible...?
0
Comment
Question by:Ben Santiardo
  • 2
  • 2
4 Comments
 
LVL 15

Assisted Solution

by:Walter Ritzel
Walter Ritzel earned 150 total points
ID: 24366027
My suggestion is that you take a look on this article:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=212&AspxAutoDetectCookieSupport=1

0
 

Author Comment

by:Ben Santiardo
ID: 24368010
Ok, I looked at what you supplied, and after a horribly undocumented installation process I finally got AJAX set up on my system.  Only to realize that the ModalPopup Control appears to function on off of a single control.  I have a grid where I would want the PopUp to appear if they click a cell.  In other words, I would need a way to "force popup" using JavaScript.  
Is that possible?  If not, then this won't be useful to me.
0
 
LVL 15

Expert Comment

by:Walter Ritzel
ID: 24369099
So, according to your post, you already have your solution of clicking on a cell and calling a panel with the controls working. With the article I provide, you should be able to change what you have working currently to open with a modal popup.
0
 

Accepted Solution

by:
Ben Santiardo earned 0 total points
ID: 24374522
Well, this ultimatly worked for my purposes thank you, although figuring it out was painful.  Ends up being that be default the AJAX control is activated by a single control as I stated in my previous post.  After exhaustive searches online, I found that I could "unregister" the control bound to the activation property of the AJAX control and "reregister" a new one (I will attach the code for anyone else interested).  This JavaScript allowed me to reregister the control with a new activating control and then cause a manual show.  I just added a call to this method inside each onClick event to the labels which I wanted to cause a popup to appear.
Note: On the actual "$create" command of the script attached, you need to replace it with your generated create command and then just modify the very last property "$get()" to use the StringID passed to the function.

function js_ShowPopupControl(p_strControlID)

{

    //************************************************************************

    // Procedure/Function: js_ShowPopupControl()

    // Author: Ben

    // Created On: 5/12/2009

    // Description:

    //      Reregisters the activating control for the ModalPopupExtender.

    //************************************************************************

    

    //***************************************

    // Initialize Variables

    //***************************************

    var strModalPopupExtenderID = 'ModalPopupExtender';

    

    //***************************************

    // Clear Currently Registered "Activator" Control

    //***************************************

    if($find(strModalPopupExtenderID)){$find(strModalPopupExtenderID).dispose();}

    

    //***************************************

    // Register New Control As Popup Activator

    //***************************************

    $create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modalPopup_Background","CancelControlID":"ctl00_MainContent_linkScoreBucket_Cancel","DropShadow":true,"OkControlID":"ctl00_MainContent_linkScoreBucket_Update","OnOkScript":"js_Show_BucketLabelForCurrentCell()","PopupControlID":"ctl00_MainContent_panelDescription","dynamicServicePath":"/RegentsWeb/ASP_Files/Manager_ScoreBucket.aspx","id":"ctl00_MainContent_ModalPopupExtender"}, null, null, $get(p_strControlID));

    

    //***************************************

    // Show Popup

    //***************************************

    $find(strModalPopupExtenderID).show();

}

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Split in Javascript 5 31
Close tabpage of custom control 9 23
Help with AsEnumerable(), LINQ 4 22
When should I use a controller? 3 16
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now