How to change font of selected item in RadioButtonList

Discussion in 'ASP .Net Web Controls' started by Peter Afonin, Feb 22, 2004.

  1. Peter Afonin

    Peter Afonin Guest

    Hello:

    Is it posiible to change somehow the font or background of selected item in
    RadioButtonList? I just want to make it more visible - to make font bold, or
    just highlight the background. Cannot figure out how to do this.

    Thank you,
     
    Peter Afonin, Feb 22, 2004
    #1
    1. Advertisements

  2. the radiobutton exposes the font and bordercolor properties. have a look at
    them.
     
    Alvin Bruney [MVP], Feb 22, 2004
    #2
    1. Advertisements

  3. Peter Afonin

    Peter Afonin Guest

    Thank you.

    I'm not talking about the radiobutton, I'm talking about the radiobuttonlist
    control. It has all these properties, but not for the selected item.

    Peter

     
    Peter Afonin, Feb 22, 2004
    #3
  4. Sorry,
    you may be able to do this by adding an attribute to the selected item. for
    example
    RadioButtonList1.Items[RadioButtonList1.selectedindex].Attributes.Add("font"
    ,"tahoma");


    --
    Regards,
    Alvin Bruney [ASP.NET MVP]
    Got tidbits? Get it here...
    http://tinyurl.com/3he3b
     
    Alvin Bruney [MVP], Feb 22, 2004
    #4
  5. Peter Afonin

    Peter Afonin Guest

    Thank you, Alvin.

    I tried this - didn't work. I tried

    Me.rblHosting.Items(Me.rblHosting.SelectedIndex).Attributes.Add("bgcolor",
    "red")
    Me.rblHosting.Items(Me.rblHosting.SelectedIndex).Attributes.Add("Font",
    "Bold") etc.

    Perhaps I'm missing something.

    Peter

     
    Peter Afonin, Feb 23, 2004
    #5
  6. You got me on this one. I couldn't make it work either. Turns out it is a
    bug. There is a workaround here if you follow this link.

    http://support.microsoft.com/default.aspx?scid=kb;en-us;Q309338

    --
    Regards,
    Alvin Bruney [ASP.NET MVP]
    Got tidbits? Get it here...
    http://tinyurl.com/3he3b
     
    Alvin Bruney [MVP], Feb 23, 2004
    #6
  7. Peter Afonin

    Peter Afonin Guest

    Thank you, Alvin. I'll try it.

    Peter

     
    Peter Afonin, Feb 23, 2004
    #7
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.