I am having a gridview and I am binding it only if it is Not POSTBACK, But I want to call the function RowDataBound when it is postback. How can I do that
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
}
}
How can I call it ?