?
Solved

How to eliminate a line in a GridView ?

Posted on 2009-05-04
1
Medium Priority
?
279 Views
Last Modified: 2013-11-07
HI

I want to eliminate an empty line that appears at the top of a bounded GridView, how to do that?
Please notice the graphic at the top of the gridview and the empty space between them.

I have attached the code and an image for a better understanding.

Thanks
<asp:GridView runat="server" 
                ID="gvProductos"
                AutoGenerateColumns="False"
                RowStyle-CssClass="LineaDeContenidoCarrito" CellPadding="5"
                AllowSorting="True" 
                DataSourceID="odsCarrito" 
                DataKeyNames="Id_Producto" 
                OnRowDataBound="gvProductos_RowDataBound"
                ShowFooter="true">
                <columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:TextBox id="tbCantidad" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Cantidad") %>' Width="72"></asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateField>                
                    <asp:BoundField DataField="Codigo" ItemStyle-Wrap="false" ItemStyle-Width="68" ReadOnly="true"  ></asp:BoundField>
                    <asp:BoundField DataField="Titulo" ItemStyle-Wrap="false" ItemStyle-Width="206" ReadOnly="true"></asp:BoundField>
                    <asp:BoundField DataField="PrecioLista" ItemStyle-Wrap="false" ItemStyle-Width="97" ReadOnly="true" HtmlEncode="false" DataFormatString="{0:C2}" ItemStyle-HorizontalAlign="Right"></asp:BoundField>
 
                    <asp:TemplateField ItemStyle-Wrap="false" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right">
                        <ItemTemplate> 
                          <asp:Label ID="lbSubtotal" Runat="Server" 
                                     Text='<%# String.Format("{0:C2}", Eval("Cantidad") * Eval("PrecioLista")) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
 
                    <asp:CommandField ItemStyle-Wrap="false" ItemStyle-Width="35"
                        DeleteText="Delete"
                        ShowDeleteButton="True"/>
                    
                    <asp:TemplateField ItemStyle-Wrap="false" ItemStyle-Width="60" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate> 
                            <asp:LinkButton ID="lbActualizar" runat="server" text="Update" CommandName="Update"/>
                        </ItemTemplate>
                    </asp:TemplateField>
 
                </columns>
 
                <RowStyle CssClass="LineaDeContenidoCarrito" />
                <FooterStyle CssClass="LineaDeTotalesCarrito" />
                <EmptyDataTemplate>
                    <span class="AreaVaciaCarrito">
                        <% DeshabilitaLinks()%>
                        ¡ Empty Shopping Cart ! <br /><br /> 
                    </span>
              </EmptyDataTemplate>
  
            </asp:GridView>

Open in new window

-004.jpg
0
Comment
Question by:dimensionav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
ALaRiva earned 2000 total points
ID: 24300344
That is your header row.
You need to add the following attribute to your gridview code.

showHeader="false"

Put it after the showFooter="true" and you should be fine.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question