Wednesday, March 28, 2012

ListBox and DragPanelExtender

ListBox is rendered last so z-index has no effect.

Can a use any (html) trick to get the object attach to the DragPanelExtender (asp:panel) moving over the ListBox?

Huh? [:^)]

My reading of thez-index documentation makes me think it would help here - you're saying it doesn't?


no z-index fails
On IE (at least) ListBox, TextBox, and ComboBox are actual windows controls placed by the browser. Since they are separate HWNDs ordered above the browsers rendering surface HWND< they can't be z-ordered under other elements, unfortuntately.
I am running into this right now. The DragPanelExtender is pretty much useless unless you don't have any controls with Hwnds on your page (which is very rare for me.) Granted I could leave it, but it does not look professional at all.

The frustrating thing is that the PopupControlExtender DOES get layered above all other controls. So I think it is an opportunity for the Atlas team to change the DragPanelExtender to have whatever it is the PopupControlExtender has that allows it to be on top.

If I come up with a solution, I will post it. I think there should be a way around this if the PopupControlExtender is able to show HTML content on top of an asp:DropDownList.

can i use css adapters to make z-index to work for DropDownList ...


I found another page have some hints to doing so, I think it should also implement to Modal Popup

http://dotnetjunkies.com/WebLog/jking/archive/2003/10/30/2975.aspx

<html>
<head>
<script>
function DivSetVisible(state)
{
var DivRef = document.getElementById('PopupDiv');
var IfrRef = document.getElementById('DivShim');
if(state)
{
DivRef.style.display = "block";
IfrRef.style.width = DivRef.offsetWidth;
IfrRef.style.height = DivRef.offsetHeight;
IfrRef.style.top = DivRef.style.top;
IfrRef.style.left = DivRef.style.left;
IfrRef.style.zIndex = DivRef.style.zIndex - 1;
IfrRef.style.display = "block";
}
else
{
DivRef.style.display = "none";
IfrRef.style.display = "none";
}
}
</script>
</head>
<body>
<form>
<select>
<option>A Select Box is Born ...</option>
</select>
</form>
<div
id="PopupDiv"
style="position:absolute; top:25px; left:50px; padding:4px; display:none; background-color:#000000; color:#ffffff; z-index:100">
... and a DIV can cover it up<br>through the help of an IFRAME.
</div>
<iframe
id="DivShim"
src="http://pics.10026.com/?src=javascript:false;"
scrolling="no"
frameborder="0"
style="position:absolute; top:0px; left:0px; display:none;">
</iframe>
<br>
<br>
<a href="http://links.10026.com/?link=#" onclick="DivSetVisible(true)">Click to show DIV.</a>
<br>
<br>
<a href="http://links.10026.com/?link=#" onclick="DivSetVisible(false)">Click to hide DIV.</a>
</body>
</html>

No comments:

Post a Comment