User409696431 posted
In the GridView DataBound event (not RowDataBound), you'd count the GridView rows, and conditionally disable the button. You'd find the button using FindControl the same way you'd find any other control on the page, if it is nested inside other controls.
Depending on your page layout, it may be directly available in the GridView DataBound event without using FindControl.
In a simple example with a GridView1, and a Button1 right below that, both inside the Form tag and not nested in anything else, the C# code is simply:
protected void GridView1_DataBound(object sender, EventArgs e)
{
if (GridView1.Rows.Count <= 0)
{
Button1.Enabled = false;
}
}