GridView and HTML attributes

Discussion in 'ASP .Net' started by peter.moss@gmail.com, Mar 13, 2006.

  1. Guest

    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?
     
    , Mar 13, 2006
    #1
    1. Advertising

  2. TomCastiglia

    Joined:
    May 10, 2006
    Messages:
    1
    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
     
    TomCastiglia, May 10, 2006
    #2
    1. Advertising

  3. SyedAhamed

    Joined:
    Jul 22, 2010
    Messages:
    2
    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.
     
    SyedAhamed, Jul 22, 2010
    #3
  4. SyedAhamed

    Joined:
    Jul 22, 2010
    Messages:
    2
    Try this

    GridLines="None" inside the GridView tag
     
    SyedAhamed, Jul 22, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Max
    Replies:
    1
    Views:
    515
    Joe Kesselman
    Sep 22, 2006
  2. P4trykx
    Replies:
    2
    Views:
    1,890
    bruce barker
    Jan 31, 2007
  3. james_027

    class attributes & data attributes

    james_027, Jun 20, 2007, in forum: Python
    Replies:
    2
    Views:
    412
    Bruno Desthuilliers
    Jun 20, 2007
  4. Phillip Gawlowski
    Replies:
    0
    Views:
    125
    Phillip Gawlowski
    Apr 16, 2007
  5. Kyle Schmitt
    Replies:
    3
    Views:
    225
    Kyle Schmitt
    Jul 24, 2007
Loading...

Share This Page