gpt4 book ai didi

c# - 如何在 C# 中检索 BindingNavigator.PositionItem 的值?

转载 作者:行者123 更新时间:2023-11-30 23:31:49 26 4
gpt4 key购买 nike

如何将 BindingNavigator.PositionItem 的值检索到变量中?

例如

int rowindex = bindingNavigator.PositionItem.Text or value ?

enter image description here

我已经知道如何检索 Datagridview 索引,但我想检索这个值,这可能吗?

最佳答案

只需查看 BindingNavigator.PositionItem 属性 documentation :

The current position calculated by obtaining the Position property of the BindingSource, and adding 1 to transform the position into a 1-based count.

但我猜你只想获取当前行索引,它可以直接从 BindingSource 组件或通过 BindingNavigator.BindingSource 属性获取,如下所示

int rowindex = bindingNavigator.BindingSource.Position;

关于c# - 如何在 C# 中检索 BindingNavigator.PositionItem 的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34472408/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com