Hier ist mein GridView-Code, ich weiß nicht, wie es geht. Wie kann ich eine Zeile aktualisieren, wenn das Kontrollkästchen aktiviert ist? Wenn das Kontrollkästchen aktiviert ist, ändert sich der "Status" der ausgewählten Zeile in "Genehmigt", wenn auf "btnGetSelected" geklickt wird. Vielen Dank!Aktualisieren Sie eine Zeile mit Kontrollkästchen in der Gridview ASP.NET
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" CellPadding="4" AllowPaging="true" PageIndex="2" OnPageIndexChanging="GridView1_PageIndexChanging" HeaderStyle-BackColor ="CornflowerBlue" BorderWidth="5" BorderColor="CornflowerBlue" Width="100%" CssClass="table-hover" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" AutoPostBack="true" OnCheckedChanged="chkSelect_CheckedChanged" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Transaction Number" HeaderStyle-ForeColor="White">
<ItemTemplate>
<asp:Label ID ="lblmosID" runat="server" Text='<%#Bind ("TransactionID") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="30px" Font-Size="15px" Font-Names="Calibri" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Date" HeaderStyle-ForeColor="White">
<ItemTemplate>
<asp:Label ID ="lblDate" runat="server" Text='<%#Bind ("DateFiled") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="130px" Font-Names="Calibri" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Name" HeaderStyle-ForeColor="White">
<ItemTemplate>
<asp:Label ID ="lblName" runat="server" Text='<%#Bind ("ReqName") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Names="Calibri" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Company" HeaderStyle-ForeColor="White">
<ItemTemplate>
<asp:Label ID ="lblComp" runat="server" Text='<%#Bind ("ReqCompany") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Names="Calibri" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Branch" HeaderStyle-ForeColor="White">
<ItemTemplate>
<asp:Label ID ="lblBranch" runat="server" Text='<%#Bind ("ReqBranch") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Names ="Calibri" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Business Unit" HeaderStyle-ForeColor="White">
<ItemTemplate>
<asp:Label ID ="lblBU" runat="server" Text='<%#Bind ("ReqBU") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Names="Calibri" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Department" HeaderStyle-ForeColor="White">
<ItemTemplate>
<asp:Label ID ="lblDept" runat="server" Text='<%#Bind ("ReqDept") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Names="Calibri" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Section" HeaderStyle-ForeColor="White">
<ItemTemplate>
<asp:Label ID ="lblsection" runat="server" Text='<%#Bind ("ReqSection") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Names="Calibri" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Status" HeaderStyle-ForeColor="White">
<ItemTemplate>
<asp:Label ID ="lblStatus" runat="server" Text='<%#Bind ("TransStatus") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Font-Names="Calibri" />
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton ID ="lnkEdit" runat="server" Text="View" PostBackUrl='<%# "Details.aspx?Id=" + Eval("TransactionID") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="CornflowerBlue" />
</asp:GridView>
<br />
<asp:Button ID="btnGetSelected" runat="server" Text="Approve selected" OnClick="btnGetSelected_Click" CssClass="btn btn-primary" Width="10%" />
<br />