Text alignment in DropDownList

R

Russ

I'm trying to figure out how to cause the items in a DropDownList to
be right justified. This is a dynamically created list. Here is what
I have tried:

DropDownList List = new DropDownList ();
List.Style.Add ("Position", "Absolute");
List.Style.Add ("Left", "10px");
List.Style.Add ("Top", "320px");
List.Style.Add ("text-align", "right");

This does not work. I found some info that there is a bug in the
framework that causes this failure and to use the following instead:

List.DataSource = TextArray;
DedList.DataBind ();
foreach (ListItem item in List.Items)
{
item.Attributes.Add ("style", "text-align:right");
}

This does not work either. Can anyone tell me what to do?

Thanks, Russ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top