Sunday, March 11, 2012

DropDownExtender - align dropdown panel to left instead of right?

Have you tried reversing the settings in dropdown.css? Did that work?

Thanks for the response... as far as I can tell, the only css file that is referenced in the sample website is in the App_Themes/DropDownTheme directory, and is called Menu.ContextMenu.css. The contents of that file are:

.ContextMenuPanel {border:1px solid #868686;z-index:1000;background: url(images/menu-bg.gif) repeat-y0 0 #FAFAFA;cursor: default;padding:1px1px0px1px;font-size:11px;}.ContextMenuBreak{margin:1px1px1px32px;padding:0;height:1px;overflow:hidden;display:block;border-top:1px solid #C5C5C5;}a.ContextMenuItem{margin:1px0 1px0;display: block;color: #003399;text-decoration: none;cursor: pointer;padding:4px19px4px33px;}a.ContextMenuItem-Selected{font-weight: bold;}a.ContextMenuItem:hover{background-color: #FFE6A0;color: #003399;border:1px solid #D2B47A;padding:3px18px3px32px;}

I don't see anything in there that has any kind of "float:right" or absolute positioning that would make it show up there, so I don't know how it's working. If you have any ideas, I'd love to hear them. Maybe there's another CSS file that I'm missing? Thanks.


Seems like a good feature - pleaseopen a work item to request it. Thank you!

I think I figured it out. In the AjaxControlToolkit folder from the downloads, there is a file called DropDown\DropDownBehavior.js. There's a line around #212 that has the following code:

var dropPopupPopupBehavior = this._dropPopupPopupBehavior = $create(AjaxControlToolkit.PopupBehavior,
{ positioningMode :AjaxControlToolkit.PositioningMode.BottomRight, parentElement : elt, reparent : true, y : -1 },
{ }, null, this._dropDownControl);

If you change the bolded part to

AjaxControlToolkit.PositioningMode.BottomLeft
then rebuild the project and copy the AjaxControlToolkit.dll into your own project, it works. Now the next step is to make that a configurable property...


Done... I was able to kludge a solution to this to meet my own needs, so I know it's possible, but I'm sure the team could do a much better job.

No comments:

Post a Comment