I currently have a gridview in my web form (restaurant) and im trying to make it so you can complete an order.
I have a gridview with a row of Buttons and I'm trying to get the row from where the button is pressed and then change the (row's) order to completed.
Does anyone understand how to do this, Thanks!
Current Code:
If you see any other problems with the code feel free to point them out! (Thanks agian)
I have a gridview with a row of Buttons and I'm trying to get the row from where the button is pressed and then change the (row's) order to completed.
Does anyone understand how to do this, Thanks!
Current Code:
C#:
protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
{
var index = Convert.ToInt32(e.CommandArgument);
//GridView2.Rows[index] (take object from the row and change it to completed)
}
HTML:
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
</asp:GridView>
<br />
<br />
<asp:GridView ID="GridView2" runat="server" OnSelectedIndexChanged="GridView2_SelectedIndexChanged">
<Columns>
<asp:ButtonField HeaderText="Completion" Text="Complete" />
</Columns>
</asp:GridView>
<br />
<br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Clear" />
<br />
<br />
</div>
</form>
If you see any other problems with the code feel free to point them out! (Thanks agian)