DataGridView not updating in c# [duplicate]
Anyone got an explanation of what's going on? Changing code 1 to code 2 fixes the problem -although theoretically there should be no differ开发者_运维问答ence. (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
精彩评论