Link to home
Start Free TrialLog in
Avatar of dimensionav
dimensionavFlag for Mexico

asked on

How to eliminate a line in a GridView ?

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
ASKER CERTIFIED SOLUTION
Avatar of ALaRiva
ALaRiva
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial