DGV控件,根据选取行的不同激发事件,如果用SelectionChanged比如一下
dgvParent.DataSource = dt;//数据绑定
this.dgvParent.SelectionChanged += new System.EventHandler(this.dgvParent_SelectionChanged);//注册事件
这样做后,DATAGridView绑定数据后,首先要执行两次SelectionChanged事件。很麻烦,还没有好的解决办法。
本文探讨了使用DGV控件时遇到的问题:当数据绑定到DataGridView后,首次选择行时会触发两次SelectionChanged事件。这是一个困扰开发者的问题,目前尚未找到理想的解决方案。
DGV控件,根据选取行的不同激发事件,如果用SelectionChanged比如一下
dgvParent.DataSource = dt;//数据绑定
this.dgvParent.SelectionChanged += new System.EventHandler(this.dgvParent_SelectionChanged);//注册事件
这样做后,DATAGridView绑定数据后,首先要执行两次SelectionChanged事件。很麻烦,还没有好的解决办法。
1258

被折叠的 条评论
为什么被折叠?