GridView and HTML attributes

P

peter.moss

Right, I thought the idiots at MS had sorted this one out in 2.0 but
alas - no such bloomin' luck.

If I reset the style on my GridView control and just give it a CssClass
(trying to be all nice, modern XHTML 2.0, pure CSS, no HTML styling -
you know the stuff that's been rammed down web developers necks by the
W3C for the last 5 years) and the damn thing keeps outputting:

cellspacing="0" rules="all" border="1"
style="border-collapse:collapse;"

What are these attributes doing there? They are nothing to do with me
- I DON'T WANT THEM NEVER NEVER NEVER NEVER IN MY NICE CLEAN
HTML!!!!!!!!! They are evil horrible, pollutants required by idoits
who have no understanding of CSS. GET RID OF THEM!!!!

So how do I do it? - my blood is boiling over here. Seeing the HTML
elements have the last word on style it keeps mucking up my pages and I
have to go in and manually set all of the GridView controls to the
correct properties - compleletly nuking all the usefulness of style
sheets in one foul swoop.

So can I get GridView to ditch the attributes or am I going to have to
ditch GridView and throw it in the bin with all the other controls MS
have made useless by not following standards?
 
Joined
May 10, 2006
Messages
1
Reaction score
0
I have the same problem...

Peter,

Did you ever figure out how to remove the style="border-collapse:collapse" attribute from the GridView's HTML? This is driving me nuts too.

Tom Castiglia
Hershey Technologies
 
Joined
Jul 22, 2010
Messages
2
Reaction score
0
Syed

Hi,
You can remove the border tag by selecting the Auto Format under the common control tasks of Gridview.

Go to design view of Gridview-> Click on GridView tasks->
Auto Format->Select Professional

and you no more see the border o the GridView. To change the Colors of Professional for RowStyle and AlternatingRowStyle. Go to the HTML view and change the colors accordingly.

Hope it helps.
 

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top