Solved

How to eliminate a line in a GridView ?

Posted on 2009-05-04
1
273 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
1 Comment
 
LVL 10

Accepted Solution

by:
ALaRiva earned 500 total points
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now