Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上,我想要实现的是设置 BindingSource 的位置,以指向主键是一些预先计算的值的行。
例子:
我有一个存储类的数据库表。DataGridView 绑定到该表的绑定源。用户从组合框中选择一个类名,系统查找哪一行具有选定的类名,并且绑定源位置设置为绑定源中该行的索引。
有任何想法吗?
谢谢。
BindingSource.Position = BindingSource.Find("CLASS_NAME", value);
其中 CLASS_NAME 是在 db 中存储类名的列的名称,value 是您要搜索的值。希望有帮助