Anyone got an explanation of what's going on? Changing code 1 to code 2 fixes the problem -although theoretically there should be no difference. (Theory hits practice like a pumpkin hitting a brick wall).
Code 1:
OutputDataGridView.DataSource = myList;
Code 2:
OutputDataGridView.DataSource = null;
OutputDataGridView.DataSource = myList;
protected void btnWhateverClick(object sender, EventArgs e)
{
myGridView.DataSourceID = String.Empty;
myGridView.DataSource = new int[0];
myGridView.DataBind();
}
and you're done.
For Ref DataSource in gridview
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With