在 UltraGridCell 中设置值不触发事件
我有一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用哪个事件来确定单元格的值何时发生变化?如果您使用
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 theValue
property or theSetValue
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 theValue
property, it does not get added to the undo stack.