MSDN上讲解说在RowCreated事件中加入
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Retrieve the LinkButton control from the first column.
LinkButton LinkButton1 = (LinkButton)e.Row.FindControl("LinkButton1");
// Set the LinkButton's CommandArgument property with the row's index.
LinkButton1.CommandArgument = e.Row.RowIndex.ToString();
}
就不会出现“未将对象应用添加到对象的引用错误”,但是我加上了还是有错误。
希望高手能具体讲解一下怎么用GridView的RowCommand添加编辑行的处理。
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Retrieve the LinkButton control from the first column.
LinkButton LinkButton1 = (LinkButton)e.Row.FindControl("LinkButton1");
// Set the LinkButton's CommandArgument property with the row's index.
LinkButton1.CommandArgument = e.Row.RowIndex.ToString();
}
就不会出现“未将对象应用添加到对象的引用错误”,但是我加上了还是有错误。
希望高手能具体讲解一下怎么用GridView的RowCommand添加编辑行的处理。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货