Forum Moderators: open
cellspacing="0" rules="all" border="1" putting border="0" into the <asp:datagrid> just adds it to the table tag, like this:
<table cellspacing="0" rules="all" border="0" border="1" ... > ... and that's no good. those are duplicate attributes. With the code above, IE shows no borders. All the other browsers DO show the borders.
There has GOT to be a way I can change border="1" to border="0", and get rid of the "rules" attribute altogether. There just HAS to be.
help!
BorderStyle="none"
<table cellspacing="0" rules="all" border="1" id="Results" style="border-style:None;width:550px;border-collapse:collapse;">
and indeed that looks OK in IE. Hooray for styles.
Then I look at the same page in Opera and FireFox, and (!) the table tag does not have the style applied!
Why is it sending different output to different browsers? That's CLOAKING, that is.
in Op and FF, the table tag is rendered like this:
<table cellspacing="0" rules="all" border="1" id="Results" width="550">
Now that I see browsers are not cooperating, this is getting confusing. I thought ASP.NET was a server language, not some sneaky beast that sniffs up my browser and does whatever it pleases! This is not good.
I still have the "rules" attribute (which I want to kill) and border still = 1
Also, check the GridLines property. If you are using Visual Studio you can see all these properties easily...if not do a search in the help files...best place to look first.
The ASP.Net properties for the controls often do not correspond to the HTML ones...for a reason. So you border property is actually borderwidth.
I guess, though, its the price you pay for near drag/drop/display capabilities of the datagrid. I just find them way too inefficient compared to the Repeater or even the DataList. Yeah the built in 'stuff' is nice, but there certainly is an opportunity cost for those features.