>I know, it's :
> dropdownlist1.backcolor = ...
[quoted text clipped - 12 lines]
>> Thanks
>> Vincent
I use the following sub to set item styles.
Private Sub SetArtistStyle()
Dim i As Integer = 1
For i = 0 To ListOfArtists.Items.Count - 1
Dim li As ListItem = ListOfArtists.Items(i)
Select Case i Mod 2
Case 0
li.Attributes.Add("style",
"background-color:SkyBlue;color:Black")
Case 1
li.Attributes.Add("style",
"background-color:Silver;color:Black")
End Select
Next
End Sub
The code is executed after a DataBind on the dropdown. If you are not using
databinding then you can use this a version of the code in the above routine
after you create the dropdown item.
Hope this helps
Lloyd Sheen
Vincent - 07 Mar 2008 21:04 GMT
Thanks,
the error was the missing ADD:
z.Attributes.Add("style", "color:red")
>>I know, it's :
>> dropdownlist1.backcolor = ...
[quoted text clipped - 36 lines]
> Hope this helps
> Lloyd Sheen