Eliminar fila de Gridview
Publicado por Edward (17 intervenciones) el 24/06/2020 23:53:15
Tengo un gridview que lleno con atraves de un boton con datos de un producto, pero aun no se han guardado en la BD, porque si el cliente quiere eliminar un producto que cree se ha equivocado en agregar, esta es mi gridview:
Como puedo eliminar una fila que este ya agregada en el Gridview??
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<asp:GridView ID="detallecompra" runat="server" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#333333" GridLines="None" Height="87px" Width="968px" OnRowDeleting="detallecompra_RowDeleting">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:ButtonField ButtonType="Button" Text="Eliminar" CommandName="Delete" HeaderText="Eliminar" />
<asp:BoundField DataField="id_proveedor" HeaderText="ID" />
<asp:BoundField DataField="NombreProveedor" HeaderText="Proveedor"></asp:BoundField>
<asp:BoundField DataField="id_producto" HeaderText="ID" />
<asp:BoundField HeaderText="Producto" DataField="NombreProducto"/>
<asp:BoundField HeaderText="Precio" DataField="precio" />
<asp:BoundField HeaderText="Cantidad" DataField="cantidad" />
<asp:BoundField HeaderText="Subtotal" DataField="Subtotal" />
</Columns>
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
Valora esta pregunta


0