C# 检查 Infragistics UltraGrid 中复选框的更改时会引发哪个事件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/314357/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Which event is raised on check change of checkbox in Infragistics UltraGrid?
提问by Nakul Chaudhary
I am using an Infragistics UltraGrid in a WinForms application.
Which event is raised on "check change" of checkbox in Infragistics UltraGrid?
我在 WinForms 应用程序中使用 Infragistics UltraGrid。
Infragistics UltraGrid 中复选框的“检查更改”会引发哪个事件?
采纳答案by Kevin Fairchild
The AfterUpdate event of the checkbox is what you'll want to use.
复选框的 AfterUpdate 事件是您要使用的。
If you're not able to trigger it, though, try adding this as well:
但是,如果您无法触发它,请尝试添加以下内容:
Private Sub YourGridcontrol_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles YourGridcontrol.MouseDown
YourGridcontrol.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode)
End Sub
Private Sub YourGridcontrol_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles YourGridcontrol.MouseUp
YourGridcontrol.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode)
End Sub
By default, just toggling the checkbox doesn't seem to trigger an Update. By making it enter/exit edit mode, the AfterUpdate should work as you want.
默认情况下,只是切换复选框似乎不会触发更新。通过使其进入/退出编辑模式,AfterUpdate 应该可以正常工作。
UPDATE: Or, like Vincent suggested, doing the PerformAction on the CellChange event should work, too. The gist is the same.
更新:或者,就像文森特建议的那样,对 CellChange 事件执行 PerformAction 也应该有效。要点是一样的。
回答by Vincent Van Den Berghe
Use the CellChange
event to raise the UltraGrid.PerformAction(UltraGridAction.ExitEditMode)
event. This will fire the AfterCellUpdate
event.
使用CellChange
事件来引发UltraGrid.PerformAction(UltraGridAction.ExitEditMode)
事件。这将触发AfterCellUpdate
事件。