我正在使用GridView
绑定到 a 的 a List<Customer>
。当RowCommand
被某个按钮触发时,我希望能够从 中检索当前行的Customer
对象e.CommandArgument
,如下所示:
protected void GridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
Customer customer = (Customer)e.CommandArgument;
DoSomething(customer);
}
如何在触发事件之前将Customer
对象分配给?CommandArgument