Foros del Web » Programando para Internet » ASPX (.net) »

Problema con alineacion de GridView

Estas en el tema de Problema con alineacion de GridView en el foro de ASPX (.net) en Foros del Web. Buenas tardes, Tengo un problema y no se donde puedo alinear el header text de mi gridview, ya probe dando Horizontal Align en el campo ...
  #1 (permalink)  
Antiguo 11/05/2009, 13:26
 
Fecha de Ingreso: agosto-2008
Ubicación: Medellín
Mensajes: 20
Antigüedad: 15 años, 8 meses
Puntos: 0
Problema con alineacion de GridView

Buenas tardes,

Tengo un problema y no se donde puedo alinear el header text de mi gridview, ya probe dando Horizontal Align en el campo header text de los template fields, si alguien me puede ayudar con esto se lo agradesco mucho, el codigo es el siguiente:

<div style="text-align: center; width: 697px;" align="center">
<asp:GridView ID="gdv" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
CellPadding="3" GridLines="Vertical" ShowFooter="True" Width="16px" Font-Names="Arial" Font-Size="Small" HorizontalAlign="Center">
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<EmptyDataTemplate>
<add:AgregarRegistro ID="AgregarRegistro1" runat="server"
OnAgregar="ibtAgregar_Click" />
</EmptyDataTemplate>
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<RowStyle BackColor="#EEEEEE" ForeColor="Black" HorizontalAlign="Center" />
<Columns>
<asp:TemplateField HeaderText="Código">
<FooterTemplate>
<asp:TextBox ID="txtCodigo" runat="server" Height="20px" Width="107px"
Wrap="False"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblCodigo" runat="server" Text='<%# Eval("colCodigo") %>'>
</asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Producto" >
<ItemTemplate>
<asp:Label ID="lblNombre" runat="server" Text='<%# Eval("colNombre") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="txtNombre" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource4" DataTextField="Nombre" DataValueField="IDCodigo"
Height="18px" onselectedindexchanged="txtNombre_SelectedIndexCha nged"
Width="154px" AppendDataBoundItems="True">
<asp:ListItem>[Seleccione]</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource4" runat="server"
ConnectionString="<%$ ConnectionStrings:SistemaFacturacionConnectionStri ng %>"
SelectCommand="SELECT * FROM [Productos]"></asp:SqlDataSource>
</FooterTemplate>
<ItemStyle HorizontalAlign="Center" Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Precio">
<ItemTemplate>
<asp:Label ID="lblApellidos" runat="server" Text='<%# Eval("colApellido") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtApellido" runat="server" />
</FooterTemplate>
<ItemStyle HorizontalAlign="Center" Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<FooterTemplate>
<asp:TextBox ID="txtCantidad" runat="server"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblCantidad" runat="server" Text='<%# Eval("colCantidad") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Subtotal">
<FooterTemplate>
<asp:Label ID="lblSubtotal1" runat="server" Text="$0,00"></asp:Label>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblSubtotal" runat="server" Text='<%# Eval("colSubtotal") %>'
Width="150px"></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="50px" Wrap="True" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField>
<FooterTemplate>
<asp:ImageButton ID="ibtAgregar" runat="server"
ImageUrl="~/imagenes/agregar.png" onclick="ibtAgregar_Click" />
&nbsp;
</FooterTemplate>
</asp:TemplateField>
<asp:CommandField ButtonType="Image" SelectImageUrl="~/imagenes/check2.gif"
ShowCancelButton="False" ShowSelectButton="True" />
</Columns>
<SelectedRowStyle BackColor="gray" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" HorizontalAlign ="Center" />
<AlternatingRowStyle BackColor="#DCDCDC" />
</asp:GridView>


</div>
  #2 (permalink)  
Antiguo 14/05/2009, 09:28
 
Fecha de Ingreso: mayo-2009
Mensajes: 10
Antigüedad: 15 años
Puntos: 1
Respuesta: Problema con alineacion de GridView

Yo coloque tu código en una pagina y sale centrado, a lo mejor la div esta contenida en algo que esta dañando la alineación.

Última edición por Emarlo; 14/05/2009 a las 09:37
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:29.