cxGrid 6 FocusedRecordChanged 想知道 FocusedItemChanged 是否
我将 GotToNextCellOnEnter 和 FocuscellOnCycle 属性设置为 true。当我在最后一个单元格上按 Enter 时,将触发 FocusedRecordChanged 事件,然后触发 FocusedItemChanged 事件。有没有办法检测 FocusedItemChanged 事件是由于 FocusRecordChanged 事件内部触发而导致的。我试图使用这些事件阻止用户关注特定的单元格。如果 FocusedItemChanged 事件将在 FocusedRecordChanged 事件之后触发,我想忽略 FocusedRecordChanged 事件。理想情况下,我想要的是 FocusedCellChanged 事件,但没有其中之一。
谢谢
I have the GotToNextCellOnEnter and the FocuscellOnCycle properties set to true. When I press enter on the last cell the FocusedRecordChanged event fires and then the FocusedItemChanged event fires. Is there a way of detecting that the FocusedItemChanged event is due to fire from within the FocusRecordChanged event. I am trying to use these events stop the user from focusing on specific cells. I want to ignore the FocusedRecordChanged event if the FocusedItemChanged event is going to fire just after it. Ideally what I want is a FocusedCellChanged event but there is not one of these.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 ExpressQuantumGrid Suite 6 的帮助中所述,OnFocusedRecordChanged
和 OnFocusedItemChanged
其中 Item 是一列。
这意味着(在您当前的配置下,即 GoToNextCellOnEnter 和 FocusCellOnCycle 设置为 true)每次您按 Enter 键离开记录的最后一列时,这两个事件始终都会触发因为您要移至下一条记录的第一项。
编辑:在使用向下键离开的情况下,OnFocusedItem 不会触发是绝对正常的,因为只有在更改列时它才会触发。你可以尝试夺取离开牢房的钥匙。我的猜测是 OnKeyDown 事件发生在这两个事件之前。
如果我正确理解您的需求,您将需要在事件处理程序中以不同的方式处理最后一列。
希望有帮助,
最好的问候
As stated in the help for the ExpressQuantumGrid Suite 6 the OnFocusedRecordChanged
and the OnFocusedItemChanged
where an Item is a column.
That means that (with your current configuration, i.e., GoToNextCellOnEnter and FocusCellOnCycle set to true) everytime you leave pressing the Enter key the last column of a record both events will always fire since you are moving to the first item of the next record.
EDIT: In the case of leaving with the Down key it is absolutely normal that the OnFocusedItem does not fire since it only does so if you change the column. You could try to capture the key used to leave the cell. My guess is that the OnKeyDown event occurs before any of these 2 events.
If I understood your needs right, you will need to treat the last column differently in your event handlers.
Hope that helps,
Best regards
我建议您禁用这两个选项并自己实现此逻辑。这是默认实现,您只需更改它即可满足您的自定义逻辑:
I would suggest that you disable both options and implement this logic yourself. Here is the default implementation, you should just change it so that it meet your custom logic: