在 UltraGridCell 中设置值不触发事件

发布于 2024-09-27 10:53:30 字数 360 浏览 6 评论 0原文

我有一个 UltraGrid,其复选框位于一列中。我有一个事件,当单击其中一个复选框(选中或取消选中)时会触发该事件。

但是,我想稍后通过代码设置复选框的值。我想出了如何通过找到 UltraGridCell 并执行 cell.value = true;cell.value = false; 来做到这一点,但是这个没有触发我需要的事件。我还找到了 cell.SetValue(true,something),但我不确定将什么传递给 something。这些文档没有任何帮助,而且我找不到可以实现我想要的功能的示例。有什么想法吗?

I have an UltraGrid with checkboxes in one column. I have an event that is fired when one of the checkboxes is clicked (checked or unchecked).

However, I want to set the value of the checkbox through code at a later time. I figured out how to do this by finding the UltraGridCell and doing cell.value = true; or cell.value = false;, but this isn't firing the event, which I need. I also found cell.SetValue(true,something), but I am not sure what to pass into something. The docs are no help, and I can't find an example that does what I want. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤檠 2024-10-04 10:53:30

您使用哪个事件来确定单元格的值何时发生变化?如果您使用 UltraGrid.AfterCellUpdate,则当使用 Value 属性或 SetValue 方法以编程方式设置单元格值时,它将触发。您在 2 个参数重载中好奇的“东西”是一个布尔值,它指示值更改是否应该进入撤消堆栈。如果您传入 True,用户可以在网格上执行撤消操作,并且它将撤消您的编程更改。如果您只设置 Value 属性,它不会添加到撤消堆栈中。

Which event are you using to determine when the value of the cell changes? If you use UltraGrid.AfterCellUpdate, it will fire when the cell value is set programmatically, either with the Value property or the SetValue method. The "something" you're curious about in the 2 parameter overload is a boolean value which indicates whether the value change should go onto the undo stack. If you pass in True, the user can perform an undo on the grid and it will undo your programmatic change. If you just set the Value property, it does not get added to the undo stack.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文