gridview: RowEditStyle being ignored

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BeemerBiker
    New Member
    • Jul 2008
    • 87

    gridview: RowEditStyle being ignored

    I am using veranda and x-small fonts everywhere. I even specified that font in "edit row style" and when that didnt work, anywhere I found an empty style. However, it is being ignored and a textbox appears that is too big and the font fits exactly in the text box which makes it too big also. The box is too wide also, even though I specified the width in <item style>

    All of my template columns are fine in edit or item mode. Just that single
    bound field that is read-write and not a templete. I assume at RowCommand I can lookup the (textbox) control and set the font size but that seems a kluge. I could also change the field to a templete but that is a pain.

    before edit:

    after edit:
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    You can use css class for the gridview.
    Please refer the following example :
    e.g.

    Code:
    <html >
    <head id="Head1" runat="server">
        <title>GridView Summary</title>
        <style type="text/css">
            TABLE.tabulardata {
    	        BACKGROUND-COLOR: #74aefa;
            }
            TABLE.tabulardata TR {
    	        BACKGROUND-COLOR: white;
            }
            TABLE.tabulardata TH {
    	        BACKGROUND-COLOR: blue;
    	        PADDING:4px;
            }
            TABLE.tabulardata TD {
    	        PADDING:4px;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:GridView runat="server" ID="gridView" 
                          CSSClass="tabulardata" CellSpacing="1" 
                          GridLines="None"/>
        </div>
        </form>
    </body>
    </html>

    Comment

    • BeemerBiker
      New Member
      • Jul 2008
      • 87

      #3
      I am already using
      Code:
      .fixedtable
      {
          table-layout: fixed;
      	margin-top: 0px;
      	left:0px;
      	width:99%; 
      	font-family:Verdana;
      	font-size:x-small;
      	border-style:none;
      	white-space:normal;
      	text-align:left;
      }
      I went and added
      .fixedtable TD, .fixedtable TH, .fixedtable TD
      to the above .fixedtable but nothing happened.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        It seems as if your edit template style is not being set correctly....ex cept that you mention that the text box is not in the edit template? It's just a bound TextBox?


        What are you doing to apply a style to it?

        Comment

        • BeemerBiker
          New Member
          • Jul 2008
          • 87

          #5
          Originally posted by Frinavale
          It seems as if your edit template style is not being set correctly....ex cept that you mention that the text box is not in the edit template? It's just a bound TextBox?
          Yea, but actually it is just whatever microsoft uses to edit a text field when you have boundtext and enable that builtin "edit" button. I need to switch to a templete as I have more control over formatting.

          What are you doing to apply a style to it?
          I am doing less than 0. I just discovered that the name of my stylesheet is case sensitive and it was not even being used when I thought it was. Once I get my stylesheet cleaned up maybe that edit will work. Right now my grids are all screwed up because they are finally getting access to the correct stylesheet.css and all the fixes I put in to correct for problems need to be removed as they have made things worse.

          What is strange is that intellisense listed the styles in "StyleSheet.css " but they were not actually used until I changed to href="Styleshee t.css" which was the correct case-sensitive name.

          Comment

          Working...