我想获取 bindingSource 的 CurrentRow 实例并将其分配给私有(private)变量。
类似于:
MatDataSet.KorisnikRow currentRow;
currentRow = (MatDataSet.KorisnikRow)((DataRowView)korisnikBindingSource.Current).Row;
当然,应该首先创建 currentRow 变量,否则会弹出 Object reference not set to an object
错误。但我不知道如何或知道任何解决方法,所以请帮忙。
抱歉技术语言不好。
最佳答案
您可以检查 BindingSource 是否不为 null。
if (bindingSource.Current != null)
// your conversion
关于c# - 获取 bindingSource 的 CurrentRow 的实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29695627/