0
지금 당장이 과제를 수행하고 있습니다.이 문제에 갇혀 있습니다. 제 이해에서, 제 gridview에 buttonfield를 추가해야합니다. 상태를 업데이트하고 내 데이터베이스에서 FabricStock을 줄입니다. 나는 이미 gridview를 가지고 있으며, 다른 모든 작업이 완료되었습니다. 이제 SQL 데이터를 buttonfield로 가져 와서 데이터를 검색 할 수 있습니다. 어떻게해야합니까? 데이터 행을 업데이트하는 것에 관한 많은 기사를 읽었지만 그 내용이 내가 원하는 바가 아니며 buttonfield에 대한 지식이 없습니다C# gridview buttonfield가 눌 렸을 때만 데이터 행을 업데이트하는 데 필요합니다.
이들은 내 gridview aspx 코드입니다.
<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>`
`