<asp:GridView ID="gridPedido" runat="server" CssClass="miGrid" AutoGenerateColumns="false" DataKeyNames="CodProducto,Variante" onrowdeleting="gridPedido_RowDeleting" onrowcommand="gridPedido_RowCommand" OnSelectedIndexChanged="gridPedido_SelectedIndexChanged" > <Columns> <asp:BoundField DataField="Pedido" HeaderText="Pedido" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" ReadOnly="true" /> <asp:BoundField DataField="Linea" HeaderText="Linea" ItemStyle-HorizontalAlign="Left" ReadOnly="true" /> <asp:BoundField DataField="CodProducto" HeaderText="Tipo Contenedor" /> <asp:BoundField DataField="Producto" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" ReadOnly="true" /> <asp:BoundField DataField="Variante" HeaderText="Variante" ItemStyle-HorizontalAlign="Center" ReadOnly="true" /> <asp:BoundField DataField="Servicio" HeaderText="Servicio" ItemStyle-HorizontalAlign="Center" ReadOnly="true" /> <asp:CommandField ShowEditButton="false" EditText="Editar" UpdateText="Aceptar" CancelText="Cancelar" DeleteText="Borrar" ButtonType="Image" CancelImageUrl="~/resources/images/cancelar.png" EditImageUrl="~/resources/images/modificar.png" ShowSelectButton="true" SelectText="Seleccionar" SelectImageUrl="~/resources/images/modificar.png" UpdateImageUrl="~/resources/images/aceptar.png" ShowDeleteButton="true" DeleteImageUrl ="~/resources/images/basura.png"/> <asp:ButtonField Text="Añadir contenido" ImageUrl="~/resources/images/add.png" CommandName="AñadirContenido" ButtonType="Image" /> </Columns> <EmptyDataTemplate> <div style="text-align:center">No se han encontrado elementos</div> </EmptyDataTemplate> </asp:GridView>
protected void ActualizarGrid() { DataTable dtlineas = f.ObtenerLineasPedidoWeb(Session["Pedido"].ToString()); ViewState["Lineas"] = dtlineas; gridPedido.DataSource = null; gridPedido.DataBind(); gridPedido.DataSource = dtlineas; gridPedido.DataBind(); if (gridPedido.Rows.Count > 0) { pnl_Pedido.Visible = true; } }
DataTable dtlineas = f.ObtenerLineasPedidoWeb(Session["Pedido"].ToString()); gridPedido.DataSource = dtlineas; gridPedido.DataBind();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)