How to clear all style attributes from GridView html

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stimp

    #1

    How to clear all style attributes from GridView html

    Hi all,

    I want to override the GridView control so that the only html output
    in the <tabledeclarati on is:

    <table id="tableID">

    I don't want the "border" or "rules" or "style" attributes to appear.

    I'd like to override the GridView control for my entire project, so I
    attempted to add a class to override the control and then added
    tagMapping to the web.config as follows...

    Public Class ClearGridView
    Inherits System.Web.UI.W ebControls.Grid View

    Public Overrides Property BorderWidth() As
    System.Web.UI.W ebControls.Unit
    Get
    If MyBase.BorderWi dth.IsEmpty Then
    Return Unit.Pixel(0)
    Else
    Return MyBase.BorderWi dth
    End If
    End Get
    Set(ByVal value As System.Web.UI.W ebControls.Unit )
    MyBase.BorderWi dth = value
    End Set
    End Property
    End Class

    and in the web.config ...

    <tagMapping>
    <add tagType="System .Web.UI.WebCont rols.GridView"
    mappedTagType=" myProject.Clear GridView"/>
    </tagMapping>


    I was hoping that might remove the "border-width:0px" part
    when I add "BorderWidt h=0" as a starting point but it seemed to
    have no effect.

    Anyone any tips on how I could achieve what I want to do?

    Thanks.

    --
    _______________ _______________ ________

    www.globenotes.com/member/peterforan/

  • Stimp

    #2
    Re: How to clear all style attributes from GridView html

    On Tue, 4 Nov 2008 Stimp <ren@spumco.com wrote:
    Hi all,
    >
    I want to override the GridView control so that the only html output
    in the <tabledeclarati on is:
    >
    ><table id="tableID">
    >
    I don't want the "border" or "rules" or "style" attributes to appear.
    ah never mind, I'll just stick GridLines="None " CellSpacing="-1"
    BorderWidth="0" into every gridview I add

    Although this isn't an ideal situation

    --
    _______________ _______________ __________
    www.globenotes.com/member/peterforan/

    Comment

    Working...