Font size in DropdownList

T

tshad

How can I set the size of text in the dropdown list:

<asp:DropDownList ID="ddlQuestionType" runat="server">
<asp:ListItem Value="MS" Text="Multiple Single" />
<asp:ListItem Value="MM" Text="Multiple Multiple" />
<asp:ListItem Value="TF" Text="True/False" />
</asp:DropDownList>

The problem is the text is so much larger than the other text and I tried
inline style as well as using a class and it doesn't seem to change the text
at all.

Thanks,

Tom.
 
C

Chad Devine

You can change it like this:
<asp:DropDownList ID="ddlQuestionType" Font-Size="8" runat="server">
<asp:ListItem Value="MS" Text="Multiple Single" />
<asp:ListItem Value="MM" Text="Multiple Multiple" />
<asp:ListItem Value="TF" Text="True/False" />
</asp:DropDownList>
 
T

tshad

Chad Devine said:
You can change it like this:
<asp:DropDownList ID="ddlQuestionType" Font-Size="8" runat="server">
<asp:ListItem Value="MS" Text="Multiple Single" />
<asp:ListItem Value="MM" Text="Multiple Multiple" />
<asp:ListItem Value="TF" Text="True/False" />
</asp:DropDownList>

Doesn't work for me.

No matter which size I choose, the text in the box and drop downs is always
the same size.

Tom.
 
C

Chad Devine

That's strange, it works fine in my asp.net page.

Here's my code... make sure you don't have any style sheets that are
over riding these font size preferences. Since, I have had problems
with that in the past.

<asp:DropDownList
ID="dropListOptions"
AutoPostBack="True"
OnSelectedIndexChanged="dropListOptions_SelectedIndexChanged"
font-size="20"
Runat="Server" >
<asp:ListItem id="Default" Text="Default" Value="25" />
<asp:ListItem Text="50" Value="50" />
<asp:ListItem Text="75" Value="75" />
<asp:ListItem Text="100" Value="100" />
</asp:DropDownList>

With that at 20 it makes the text huge, and rather annoying, but it
definately works. You should check around in your code, or elsewhere
and make sure something's not effecting that font-size.
 
T

tshad

Chad Devine said:
That's strange, it works fine in my asp.net page.

Here's my code... make sure you don't have any style sheets that are
over riding these font size preferences. Since, I have had problems
with that in the past.

<asp:DropDownList
ID="dropListOptions"
AutoPostBack="True"
OnSelectedIndexChanged="dropListOptions_SelectedIndexChanged"
font-size="20"
Runat="Server" >
<asp:ListItem id="Default" Text="Default" Value="25" />
<asp:ListItem Text="50" Value="50" />
<asp:ListItem Text="75" Value="75" />
<asp:ListItem Text="100" Value="100" />
</asp:DropDownList>

With that at 20 it makes the text huge, and rather annoying, but it
definately works. You should check around in your code, or elsewhere
and make sure something's not effecting that font-size.

Something might be.

I will check it out.

But here is my code (part of it which is a datalist):

*****************************************************
<EditItemTemplate>
<table border="1" width="100%" CellPadding="0" CellSpacing="0"
style="margin:0">
<tr>
<td>
<asp:ImageButton ID="ExpandButton" runat="server" Font-Size="2"
ImageUrl="../images/expand.gif" Width="16" Height="16" CommandName="Select"
AlternateText="Click here to see details"></asp:ImageButton>
</td>
<td>
<asp:ImageButton ID="CollapseButton" visible="false"
runat="server" Font-Size="2" ImageUrl="../images/collapse.gif" Width="16"
Height="16" CommandName="Select" AlternateText="Click here to see
details"></asp:ImageButton>
<asp:label id="PositionID" Visible="false" runat="server"
Text='<%# DataBinder.Eval(Container.DataItem, "PositionID") %>' />
<asp:label id="QuestionUnique" Visible="false" runat="server"
Text='<%# DataBinder.Eval(Container.DataItem, "QuestionUnique") %>' />
</td>
<td>
<asp:label id="QuestionType" Visible="false" runat="server"
Text='<%# DataBinder.Eval(Container.DataItem, "QuestionType") %>' />
</td>
<td>
<asp:DropDownList ID="ddlQuestionType" font-size="30"
SelectedValue='<%# DataBinder.Eval(Container.DataItem, "QuestionType") %>'
runat="server" >
<asp:ListItem Value="MS" Text="Multiple Single" />
<asp:ListItem Value="MM" Text="Multiple Multiple" />
<asp:ListItem Value="TF" Text="True/False" />
</asp:DropDownList>
</td>
***********************************************************************************

Here is the rendered code:
********************************************************************************
<td>
<input type="image" name="DataList1:_ctl0:ExpandButton"
id="DataList1__ctl0_ExpandButton" src="../images/expand.gif" alt="Click here
to see details" border="0" />
</td>
<td>
</td>
<td>
</td>
<td>
<select name="DataList1:_ctl0:ddlQuestionType"
id="DataList1__ctl0_ddlQuestionType">
<option value="MS">Multiple Single</option>
<option selected="selected" value="MM">Multiple Multiple</option>
<option value="TF">True/False</option>
</select>
********************************************************************************

As you can see there is no size begin set on the select statement. Some of
the asp.net objects are not there as they are not visible.

Thanks,

Tom
 
C

Chad Devine

That's really strange how it's not showing anything for you. We can
rule out style sheets then because here is my rendered source:
<select name="dropListOptions"
onchange="__doPostBack('dropListOptions','')" language="javascript"
id="dropListOptions" style="font-size:10pt;">

Hm, I wonder why your's isn't rendering. I see you have other font-size
tags, are those not rendering either?
 

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

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top