Strange issue with a datagridview and a tabcontrol C#

柔情痞子 提交于 2019-11-28 11:49:20

This is because a data-bound control(dataGridView2) is not updated until the control is made visible. See this. You can refresh the binding, for example, by programmatically switching to TabPage2 and back to the first tab.

THe only thing I can se at the moment is that you are not doing this on tabpage 2

dataGridView1.Sort(dataGridView1.Columns[1], ListSortDirection.Ascending);

try

dataGridView2.Sort(dataGridView2.Columns[1], ListSortDirection.Ascending);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!