Yes, the GridView.DataBinding event will be raised before the control binds. You can access the DataSource control in this case and make changes if you wish (for example, changing parameters).
protected void Grid_DataBinding(object sender, EventArgs e)
{
mySqlDataSource.SelectCommand = "Select * from Stars";
}
source
share