0

I need to know how to style the gray box in a asp.net C# checkboxlist, not the whole item, only the gray box, anyone know how to do that?

    <asp:CheckBoxList ID="cbl" runat="server"></asp:CheckBoxList>
TaW
  • 53,122
  • 8
  • 69
  • 111
RKR100110
  • 1
  • 1

2 Answers2

0

there's a built in property: BackColor. (hit spacebar after "server" and it should show up.)

wazz
  • 4,953
  • 5
  • 20
  • 34
0

If, by "the gray box", you mean the checkbox itself, I am afraid that you cannot do it easily (see How to style checkbox using CSS?). In order to try to replace the checkbox element with your own, you would have to use the CssClass property:

<asp:CheckBoxList ID="cbl" runat="server" CssClass="chkList">

<style type="text/css">
    .chkList input
    {
        // Use CSS to replace the checkbox element
    }
</style>
Community
  • 1
  • 1
ConnorsFan
  • 70,558
  • 13
  • 122
  • 146