如何获取绑定源中选定的行
如何获取绑定源中选定的行。 我认为这就是解决方案:
DataRow row = ((DataRowView)bindingSource1.Current).Row;
但我仍然得到整个 datagridview 如果我站在“行”上,在运行应用程序时打开树,我可以选择 Itemarray 并查看所选数据。但不知道如何改变这条线
DataRow row = ((DataRowView)bindingSource1.Current).Row;
有人能帮我解决这个问题吗?
How to fetch the selected row in a bindingsource.
I thought this was the solution:
DataRow row = ((DataRowView)bindingSource1.Current).Row;
But I still get the whole datagridview
If I stand on 'row' open the tree while I'm running my application I can select the Itemarray and see the selected data. but dont know how the change this line
DataRow row = ((DataRowView)bindingSource1.Current).Row;
Could somebody help me solve this problem ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
i
是列索引i
is the column index没关系,我是这样解决的
对象[] obj = ((DataRowView)bindingSource1.Current).Row.ItemArray;
Never mind, I solved it like this
object[] obj = ((DataRowView)bindingSource1.Current).Row.ItemArray;