Reputation: 4920
I am trying to alternate background colors for items in radiobuttonlist using the below code, similar code is working on dropdownlist items
If color Then
rdBtnList.Items.FindByText(lstItem.Text).Attributes.CssStyle.Add("style", "background: white;")
rdBtnList.Items.FindByText(lstItem.Text).Attributes.CssStyle.Add("style", "background-color: white;")
Else
rdBtnList.Items.FindByText(lstItem.Text).Attributes.CssStyle.Add("style", "background-color: LightSlateGray;")
rdBtnList.Items.FindByText(lstItem.Text).Attributes.CssStyle.Add("style", "background: LightSlateGray;")
End If
color = Not color
Am I missing something?
Thanks
Upvotes: 0
Views: 1890
Reputation: 4920
that worked
rdBtnList.Items.FindByText(lstItem.Text).Attributes.Add("style", "color: black;font-weight:bold;")
Upvotes: 2