?
Solved

Remove border on checkbox in datalist

Posted on 2005-02-24
10
Medium Priority
?
2,706 Views
Last Modified: 2008-01-09
This has to be simple but I can't remove the border or set the background color in a checkbox or radio button created in a datalist. The class , border etc ends up in the surrounding span tag.

Any Ideas?

Glorfindal
0
Comment
Question by:glorfindal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 15

Expert Comment

by:praneetha
ID: 13396173
you get a border around it...i don't get any border around checkbox i tried in datalist
0
 

Author Comment

by:glorfindal
ID: 13396205
I'm getting a dark border and background around them and can't seem to get rid of it
0
 

Author Comment

by:glorfindal
ID: 13396231
Actually theres no dark background and the border looks like the sunken effect. Almost like having a checkbox inside a checkbox. I've never seen this before
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:praneetha
ID: 13396268
is it checkboxlist or checkbox..

if u dra and drop a checkbox on aspx page..and then if u have a checkbox in datalist

u r saying they both look different...

r u using any css class

and if you can post the <Asp:datalist code
0
 

Author Comment

by:glorfindal
ID: 13396384
Changed it to a repeater still the same
It's a checkbox


<asp:Repeater ID="UpsShippingList" Runat=server  OnItemDataBound="UpsShippingList_ItemDataBound">
  <ItemTemplate>                                                      
    <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="eeeeee">
      <tr>
          <td width="15"><IMG height="1" alt="" src="common/images/transpix.gif" width="1" border="0"></td>
          <td width="20"><asp:CheckBox Name="ShipSelect" ID="ShipSelect" runat=server BorderStyle=None></asp:CheckBox></td>
         <td width="15"><IMG height="1" alt="" src="common/images/transpix.gif" width="1" border="0"></td>
         <td width="300"><asp:LinkButton ID="Select" CommandName="Select" Text='<%#  DataBinder.Eval(Container.DataItem, "ShipmentType") %>' Runat="server"></asp:LinkButton></td>
          <td width="150"><%#  DataBinder.Eval(Container.DataItem, "Cost") %><asp:Label ID="ShippingCost" runat=server text='<%# DataBinder.Eval(Container.DataItem, "Cost", "{0:c}") %>'></asp:Label></td>
    </tr>
</table>
</ItemTemplate>
</asp:Repeater>
0
 
LVL 15

Expert Comment

by:praneetha
ID: 13396509
hey did u try adding checkbox on normal page..and see if both r looking diff...

may be they r not
0
 

Author Comment

by:glorfindal
ID: 13396867
I changed it to a "HtmlInputCheckBox" and the borders gone. Looked at a plain aspx page and the asp checkbox still has a border must be some Style somewhere causing the problem. I would think I could change the border to none in the <asp:CheckBox> tag and override anything else.
0
 

Author Comment

by:glorfindal
ID: 13425003
I've never seen style="border:none ! important" before. I'll have to remeber that but it did'nt work either. The problem is when the checkbox is created in the datalist the style is placed in a span tag surrounding the checkbox. I've have also tried adding the style as an attribute in the datalist ItemDataBound event. the strange thing is I am also adding a javascript OnClick event which attaches to the CheckBox while the style attaches to the span Tag. The Checkbox ends up as an html input type="checkbox" inside the Span tag. If I use a style on "input" the border goes away unfortunatly so does the border on all my text boxes. Ive got it working by using a "HtmlInputCheckBox" which dosn't have the border. This was a quick fix but isn't really the answer. I still would like to know how to add a style in the datalist as I can see this being a possible issue in the future. I am leaving this open to see if any one has the answer.
0
 
LVL 5

Accepted Solution

by:
aspmaestro earned 2000 total points
ID: 13426210
>>If I use a style on "input" the border goes away unfortunatly so does the border on all my text boxes...

you can create a class for the style you wanna apply to your checkbox....like this

(place it between <head> and </head>)
<STYLE type="text/css">
 input.chkBox{border:none}
</STYLE>

now inside the checkbox tag, add this attribute :
class="chkBox"

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question