0

I'm doing this assignment right now, and I'm stuck at this problem, from my understand, i have to add a buttonfield to my gridview and when pressed, it updates the status, and reduce FabricStock in my data base. i already have the gridview, everything else is done, i can retrieve data from my sql, now left with the buttonfield, how should i start doing this? i've read a lot of other articles about updating rows of data, but appearently those are not what I wanted and my knowledge on buttonfield is o

These are my gridview aspx codes.

<asp:GridView ID="gvFabrics" runat="server" CellPadding="3" GridLines="None" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellSpacing="1" Font-Names="Lao UI" AutoGenerateColumns="False" Width="976px" AllowPaging="True" OnPageIndexChanging="gvFabrics_PageIndexChanging" PageSize="5">
        <Columns>
        <asp:BoundField DataField="ProductionPlanID" HeaderText="Production Plan ID" />
            <asp:BoundField DataField="FashionStyleID" HeaderText="Fashion Style ID" />
            <asp:BoundField DataField="FabricID" HeaderText="Fabric ID" />
            <asp:BoundField DataField="WarehouseID" HeaderText="Warehouse ID" />
            <asp:BoundField DataField="PPStatus" HeaderText="Status" />
            <asp:BoundField DataField="PPFabricReqd" HeaderText="PP Fabric Reqd" />
            <asp:BoundField DataField="PPFabricIssued" HeaderText="PP Fabric Issued" />
            <asp:ButtonField ButtonType="Button" HeaderText="Update Fabric" Text="Update" />
        </Columns>
        <FooterStyle BackColor="#C6C3C6" Font-Bold="True" ForeColor="Black" />
        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
        <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
        <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
        <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#594B9C" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#33276A" />
    </asp:GridView>`

`

gkrishy
  • 756
  • 1
  • 8
  • 33
Zilis
  • 1
  • 3

1 Answers1

0

Edit Update and delete in side gridview. This could help

Harsha KN
  • 93
  • 10