How to gray-out and italicize the listitem in dropdown

Posted by Arun.Padmanaban under VB.NET on 7/5/2012 | Points: 10 | Views : 2163 | Status : [Member] | Replies : 3
Hi all,
i have drop down listitem i am binding the data from database to dropdown .i need to add a value to listitem(0) dynamically.
so i have added dropdown.Items(0).Attributes.Add("style", "color:gray") .My questions is how to make dropdown.items(0) to italicize .i want both style gray and italicize




Responses

Posted by: Premalatha on: 7/5/2012 [Member] Starter | Points: 25

Up
0
Down
Look a once on this site you will get the Answer

http://forums.asp.net/t/1491104.aspx/1

Premalatha
Software Engineer

Arun.Padmanaban, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Arun.Padmanaban on: 7/6/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks,Nut i actually i can able to add the Data to dropdown .The Problem is i couldn't able to make the listitem(0) to italic.
dropdown.Items(0).Attributes.Add("style", "font-style:italic") i have using this code but it's not working .

Arun.Padmanaban, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Premalatha on: 7/8/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Arun,
You are doing it correctly however the styles available to apply to a standard select field and limited by browser type (i.e not all are crossbrowser) . See this article for more info http://www.electrictoolbox.com/style-select-optgroup-options-css/

Premalatha
Software Engineer

Arun.Padmanaban, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response