我有一个gridview,只有当它不是回发时才绑定它,但是我想在回发时调用函数RowDataBound。我怎样才能做到这一点
protected void gridview1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex == -1)
{
//Some logic
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadGridView();
}
else
{
gridview1_RowDataBound(null, null); // Object reference not set to an instance of an object
}
}
我怎么称呼它?