Search code examples
htmlcssasp.netgridviewinternet-explorer-11

Strange "line" appears in GridView -- is it CSS or border or what?


I see a "strange line" in my gridview.
Here is the screen-shot of the "strange line" at the right-edge of the cyan-blue selected gridview row:

enter image description here

I have used F12-developer tool and there is no reference to this "line" as shown in the image, below.
F12 code related to the "strange line"

What is also strange is when I change the browser VIEW/ZOOM to 300%, the "strange line" moves down to the last row visible in the screen-shot image. Further, changing the VIEW/ZOOM to 200%, the "strange line" is no longer visible.

I have searched my code for underscores (2, 3 and 4 adjacent underscores) -- no finds.

I have searched for "border", not finding anything odd with those declarations.

I have searched my CSS for "-top" and "-bottom", nothing odd with those declarations.

I am seeking anyone's advice or solution. Thanks...John


Solution

  • It probably has something to do with the active or hover css, and the last cell not being empty. Put the hidden input in another cell and see if that helps.

    You could also do without the HiddenField by using DataKeyNames or even better, strongly typed GridView

    <asp:GridView ID="GridView1" runat="server" DataKeyNames="ID">
    

    Or strongly typed

    <asp:GridView ID="GridView1" runat="server" ItemType="Namespace.Class1.Class2">
    

    With the last one you have access to the originating class and have type safety everywhere. I recommend the last one

    https://www.sitepoint.com/asp-net-4-5-strongly-typed-data-controls-model-binding/