Unable to cast object of type 'Obout.Grid.GridTemplate' to type 'System.Web.UI.WebControls.GridViewRow'. not resolving
问题 I want to disable gridview row on button click which is inside the gridview. So for that I have written the below code. protected void btnPayGenInvoice_Click(object sender, EventArgs e) { if (strMode == "M") { Button btn = (Button)sender; GridViewRow row = (GridViewRow)btn.Parent.Parent; row.Enabled = false; } } But I am getting error as Unable to cast object of type 'Obout.Grid.GridTemplate' to type 'System.Web.UI.WebControls.GridViewRow'. kindly let me know what is wrong here UPDATE Getting