473,662 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

format text in dropdownlist

Hi,

Is it possible to get the text in a dropdown list to be bold or italic?
Some entries I want to have bold others normal and others italic.
I cant figure out how to do this.

tia
Jul 27 '06 #1
3 6974
hi, you can test this yourself easily. Here is a basic test below.

<asp:DropDownLi st style="font-weight: bold;" ID="DropDownLis t1"
runat="server">
<asp:ListItem style="font-color:
red;background-color:green">a</asp:ListItem>
<asp:ListItem style="color: red">b</asp:ListItem>
<asp:ListItem style="font-family: Verdana; font-size: 16px"
Value="c">c</asp:ListItem>
</asp:DropDownLis t>

In the above test, note how the font-weight is being applied in the
dropdownlist(se lect element) itself and not on the listitem. Applying it on
the list item has no effect in IE. Only Firefox seems to support this. The
same for font-family and font-size. Cant be applied individually on the
listitem(option element).

You can try other options whereas to using font-weight. Try color or
background-color, those work at the listitem level, cross browser.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

"Klaas" <No****@klaas.c omha scritto nel messaggio
news:u6******** ******@TK2MSFTN GP03.phx.gbl...
Hi,

Is it possible to get the text in a dropdown list to be bold or italic?
Some entries I want to have bold others normal and others italic.
I cant figure out how to do this.

tia

Jul 27 '06 #2
Thanks for the answer. So it's not possible for IE...:-(
To bad.

"Alessandro Zifiglio" <AlessandroZifi glio @ -h-o-t-m-a-i-l-c-o-mschreef in
bericht news:eN******** ******@TK2MSFTN GP03.phx.gbl...
hi, you can test this yourself easily. Here is a basic test below.

<asp:DropDownLi st style="font-weight: bold;" ID="DropDownLis t1"
runat="server">
<asp:ListItem style="font-color:
red;background-color:green">a</asp:ListItem>
<asp:ListItem style="color: red">b</asp:ListItem>
<asp:ListItem style="font-family: Verdana; font-size: 16px"
Value="c">c</asp:ListItem>
</asp:DropDownLis t>

In the above test, note how the font-weight is being applied in the
dropdownlist(se lect element) itself and not on the listitem. Applying it
on the list item has no effect in IE. Only Firefox seems to support this.
The same for font-family and font-size. Cant be applied individually on
the listitem(option element).

You can try other options whereas to using font-weight. Try color or
background-color, those work at the listitem level, cross browser.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

"Klaas" <No****@klaas.c omha scritto nel messaggio
news:u6******** ******@TK2MSFTN GP03.phx.gbl...
>Hi,

Is it possible to get the text in a dropdown list to be bold or italic?
Some entries I want to have bold others normal and others italic.
I cant figure out how to do this.

tia


Jul 27 '06 #3
Your welcome. Yes, from that small test you can see that font-weight is
ignored on the listitem and cannot be applied individually in IE. Only
firefox seems to have this working :|

So your left with specifying font-weight on the dropdownlist itself but this
will apply to all listitems and wont set individually.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

"Klaas" <No****@klaas.c omha scritto nel messaggio
news:ez******** ******@TK2MSFTN GP02.phx.gbl...
Thanks for the answer. So it's not possible for IE...:-(
To bad.

"Alessandro Zifiglio" <AlessandroZifi glio @ -h-o-t-m-a-i-l-c-o-mschreef
in bericht news:eN******** ******@TK2MSFTN GP03.phx.gbl...
>hi, you can test this yourself easily. Here is a basic test below.

<asp:DropDownL ist style="font-weight: bold;" ID="DropDownLis t1"
runat="server" >
<asp:ListItem style="font-color:
red;backgrou nd-color:green">a</asp:ListItem>
<asp:ListItem style="color: red">b</asp:ListItem>
<asp:ListItem style="font-family: Verdana; font-size: 16px"
Value="c">c</asp:ListItem>
</asp:DropDownLis t>

In the above test, note how the font-weight is being applied in the
dropdownlist(s elect element) itself and not on the listitem. Applying it
on the list item has no effect in IE. Only Firefox seems to support this.
The same for font-family and font-size. Cant be applied individually on
the listitem(option element).

You can try other options whereas to using font-weight. Try color or
background-color, those work at the listitem level, cross browser.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

"Klaas" <No****@klaas.c omha scritto nel messaggio
news:u6******* *******@TK2MSFT NGP03.phx.gbl.. .
>>Hi,

Is it possible to get the text in a dropdown list to be bold or italic?
Some entries I want to have bold others normal and others italic.
I cant figure out how to do this.

tia



Jul 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2748
by: Newgene | last post by:
Hi, group, I have python2.3 installed on win2k. I noticed that when I open a dos format text file (eol is '\r\n'), readline() always returns a line ending with '\n' only, not '\r\n'. While I read the same file on unix, it returns a line ending with '\r\n' correctly. This makes me difficult to determine the format of a text file, dos or unix. Is this a bug or intended behavior? If not a bug, then how to determine the format of a text...
2
5660
by: ezelasky | last post by:
We are using the bcp utility (via APIs) to export data from a SQL table in a fixed format text file. BCP is inserting spaces for a field if the field contains a NULL. This is fine with us except at the end of the line, there are no spaces for that field just the end-of-row terminator prematurely, so it looks like that field is not present and messes up another piece of software we pump the text file into down stream. Example -- The...
3
1474
by: Rigga | last post by:
Hi all, Firstly, sorry for the simple question, as i'm sure i'm missing something obvious. I have a text field (varchar) I am reading from an SQL db, into a string variable, in .NET I am then assigning this string variable to an HTML control, either Label or Textbox, depending on the edit situation.
2
1292
by: Jimmy | last post by:
How can i format text, so that user input such as, 01062004 would be formatted as 01/06/2004. I've tried several user-defined number and date formats, but I seem to be missing something. Thank you.
1
1542
by: cr113 | last post by:
How do I format text in datagrid column? I have a column of currency values and I want them all to display with 2 decimal points (XXX.XX). I figured out how to set the width and alignment as follows: DataGrid1.TableStyles(0).GridColumnStyles(0).Width = 140 DataGrid1.TableStyles(0).GridColumnStyles(1).Width = 125 DataGrid1.TableStyles(0).GridColumnStyles(0).Alignment = 0 DataGrid1.TableStyles(0).GridColumnStyles(1).Alignment = 1
3
1675
by: dennist685 | last post by:
Format text as a heading I'm progressing through a walkthrough on DetailsView control Early on it says Type Edit Employees, select the text, and then format the text as a heading. I clicked format, then styles, but nowhere found how to make selected text a heading.
2
9263
by: Rich | last post by:
Hello, I need to send an automated email message from my application (vb2005) - using system.net.mail. What I need to do to the message is to format the text, like underlining, bolding, changing font colors. I can send the message OK with the default font senttings. But how can I customize the fonts/Text? Thanks, Rich
2
3999
by: =?Utf-8?B?am9obmFicmFoYW0xMDE=?= | last post by:
hello, I'm trying to write a some text to a text file using WriteAllText method. This method works fine but I don't understand how can I use format specifiers to format the text as we use in C i.e "\n" for newline, "\t" for tab,...etc. bye
13
3235
by: Neil Cerutti | last post by:
Many of the file formats I have to work with are so-called fixed-format records, where every line in the file is a record, and every field in a record takes up a specific amount of space. For example, one of my older Python programs contains the following to create a fixed-format text record for a batch of new students: new = file("new.dat", "w") if not new:
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.