Saturday, March 24, 2012

DropDownList in an AJAX modal popup window

We've developed a multicolumn dropdown listbox that works great on a standard Web form, but it's been giving me a lot of grief trying to get it to work in an AJAX modal popup window. For some reason, either the dropdownlist or the popup window's height ends up getting set to -2px, which causes the program to come to a screeching halt.

I don't have any such problem if I use a standard dropdown listbox, but I need to show both a code and a description in the dropdown and a standard dropdown comes with its own set of problems in that circumstance. To separate the description from the code and to evenly align the description, I modified the DataText property by setting it equal to the code plus a tab character plus the description thusly, ddList.DataText = "Code" + Chrw$(9) + "Description". Once it's rendered on the screen, I view the source and it shows all the codes and descriptions with the tab between them allowing the descriptions to be aligned properly. But the browser strips out the tab character and replaces it with a space.

I'm about to give up on this and was wondering if anyone has had any luck doing the same thing?

Allen A.

There is no tab in html. It will be replaced by (or non breaking space). You can add a definite number of non breaking space to format your listitems. Sorry not able to give simple solution.

No comments:

Post a Comment