disappearing gridlines in gridview

Discussion in 'ASP .Net Web Controls' started by Vinki, Apr 26, 2007.

  1. Vinki

    Vinki Guest

    Hello Everyone,

    I have a gridview. I am using template columns inside the gridview.
    When I display the gridview on the web page and if there is no value in a
    particular cell, gridline disappaers around that cell.I want the grid lines
    to appear all the time even if the cell is empty. Can anyone tell me what am
    I doing wrong. Below is my gridview. I am showing only one template column. I
    have around 14 template column in the gridview.


    <asp:GridView ID="dgAgentActivity" runat="server"
    AutoGenerateColumns="false" CellPadding="0" CellSpacing="1"
    BackColor="AliceBlue" OnRowCreated="dgAgentActivity_RowCreated"
    ShowFooter="true" >
    <Columns>

    <asp:templatefield headertext="SwitchTime" >

    <itemtemplate>
    <%#Eval("SwitchTime")%>
    </itemtemplate>
    <footertemplate>
    <asp:label id="SwitchTime" runat="server"/>
    </footertemplate>
    </asp:templatefield>
    <columns>

    Thanks.
     
    Vinki, Apr 26, 2007
    #1
    1. Advertising

  2. Vinki

    KyleK Guest

    Use <EmptyItemTemplate>. You might have to put a space in it

    Hope this helps

    --
    Kyle Kelin
    ..NET Developer
    www.dotnetmafia.com


    "Vinki" wrote:

    > Hello Everyone,
    >
    > I have a gridview. I am using template columns inside the gridview.
    > When I display the gridview on the web page and if there is no value in a
    > particular cell, gridline disappaers around that cell.I want the grid lines
    > to appear all the time even if the cell is empty. Can anyone tell me what am
    > I doing wrong. Below is my gridview. I am showing only one template column. I
    > have around 14 template column in the gridview.
    >
    >
    > <asp:GridView ID="dgAgentActivity" runat="server"
    > AutoGenerateColumns="false" CellPadding="0" CellSpacing="1"
    > BackColor="AliceBlue" OnRowCreated="dgAgentActivity_RowCreated"
    > ShowFooter="true" >
    > <Columns>
    >
    > <asp:templatefield headertext="SwitchTime" >
    >
    > <itemtemplate>
    > <%#Eval("SwitchTime")%>
    > </itemtemplate>
    > <footertemplate>
    > <asp:label id="SwitchTime" runat="server"/>
    > </footertemplate>
    > </asp:templatefield>
    > <columns>
    >
    > Thanks.
    >
     
    KyleK, May 17, 2007
    #2
    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. Shreyas Madwanna

    Hiding Gridlines of a word document

    Shreyas Madwanna, Jan 21, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    368
    Shreyas Madwanna
    Jan 21, 2004
  2. Mike P

    GridView Gridlines

    Mike P, Apr 26, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    958
    Mike P
    Apr 26, 2006
  3. =?Utf-8?B?Vmlua2k=?=

    disapearing gridlines in gridview

    =?Utf-8?B?Vmlua2k=?=, Apr 26, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    713
    Ray Costanzo
    Apr 27, 2007
  4. tshad

    Gridview Gridlines color

    tshad, Jan 19, 2010, in forum: ASP .Net
    Replies:
    2
    Views:
    3,401
    tshad
    Jan 20, 2010
  5. Magnus Blomberg

    GridView -> Excel = no gridlines

    Magnus Blomberg, Oct 21, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    227
    Magnus Blomberg
    Oct 21, 2005
Loading...

Share This Page