I was working on asp.net GridView control. Now I need to edit some row data. For that I was using this code:
<asp:LinkButton ID="btnEdit" Text="Edit" runat="server" CommandName="QuickEdit" OnClick="btnEdit_Click"
CommandArgument ='<%# ((CheckBox)(((GridViewRow) Container).Cells[4].Controls[0])).Checked %>'/>
And the btnEdit_Click method is:
protected void btnEdit_Click(object sender,EventArgs e)
{
LinkButton btn = (LinkButton)sender;
switch (btn.CommandName)
{
case "QuickEdit":
EditPanel.Visible = true;
GridPanel.Visible = false;
CheckBox cbRequiresState = (CheckBox)EditPanel.FindControl("checkRequiresState");
if (btn.CommandArgument =="True")
{
cbRequiresState.Checked = true;
}
else
{
cbRequiresState.Checked = false;
}
break;
}
}
Now, I need to pass more than one argument as CommandArgument to that btnEdit_Click method. For that what I need to do?
And please suggest me a good way to utilize those arguments in that method.
OnRowCommandevent?