Re: disapearing gridlines in gridview

Tech-Archive recommends: Fix windows errors by optimizing your registry



That's how the browser renders a <td> that has no content. Often, an nbsp; is put in such a TD to get it to render the way you want it. So, depending on how you get your data or how you want to do it, you may want to consider replacing empty values with &nbsp;.

Notice what happens if you add this:
<style type="text/css">
table.Vinki td { height: 3em; border: 1px solid #000000; }
</style>

And give your GridView a CssClass="Vinki" property. Load this in IE and then in Firefox. It's all in how each browser decides to deal with things, and it's a pita!

Ray at work

"Vinki" <Vinki@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:AFABB5C2-8562-4602-A702-4BFC0599BB15@xxxxxxxxxxxxxxxx
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.


.



Relevant Pages

  • GridView RowCommand Not Firing
    ... I have a gridview that I bind to a Listat runtime. ... The gridview has a template column with an imagebutton whose commandname is ... however the RowCommand event does not fire. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: LinkButton Visited Link on ASP.NET Gridview Issue
    ... One of the columns of this Gridview is a template column (LinkButton). ... A given user clicks on the first row hyper link on the Grid on the first ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Gridview hyperlink column mailto event
    ... if you have added the template column in the GridView, ... intead of using the <asp:hyperlink, you can use the traditional HTML control ... > my mail client, but the selected addess is not transferred into the TO: ...
    (microsoft.public.dotnet.framework.aspnet)
  • varchar string not showing up in itemtemplate in a gridview
    ... I have your regular GridView with an SQL Data source behind it. ... colums is a varchar column that the user can edit. ... it's not a 100% solution and I need the column to be a template column ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)