Infragistics UltraWinGrid 删除确认
默认情况下,ultraWinGrid 对于任何行删除都会弹出一个删除确认框。 我如何关闭该功能?
如果我在代码中删除,那没问题:
myUltraGrid.DeleteSelectedRows(False)
但我不知道当用户按下删除键时如何应用它。
By default the ultraWinGrid pops up a delete confirmation box for any row deletions. How do I turn that feature off?
If I'm deleting in the code, it's no problem:
myUltraGrid.DeleteSelectedRows(False)
But I don't know how to apply that when the user presses the delete key.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以检测到他们何时按下您所在行上的删除键。 使用类似 BeforeRowsDeleted 事件的东西。 该事件公开 BeforeRowsDeletedEventArgs 对象,该对象具有可供您使用的 e.DisplayPromptMsg 属性。
You can detect when they press the delete key on your row. Use something like the BeforeRowsDeleted event. That event exposes the BeforeRowsDeletedEventArgs object which has the e.DisplayPromptMsg property available to you.
auujay 拿到了。 它不会导致无限循环,因为无论选择和删除多少行,它都只运行一次。 这一切所做的就是关闭通用消息框。 我们使用它来显示预删除的自定义消息,例如“您真的、真的确定吗?”
如果没有,请使用
e.cancel=true
。auujay has it. It will not cause an endless loop because it only runs once no matter how many rows are selected and deleted. All this does is turn off the generic message box. We use it so we can display custom messages pre-delete like "Are you really, really sure?"
Use
e.cancel=true
if no.根据 文档
According to the documentation
有一个更好的办法:
There is a better way:
最好的解决方案是使用
UltraGridRow.Delete(displayPrompt As Boolean)
所以
如果您想要消息:
UltraGridRow.Delete(True)
如果您不想要该消息:
UltraGridRow.Delete(False)
The best solution is to use
UltraGridRow.Delete(displayPrompt As Boolean)
so
if you want the message :
UltraGridRow.Delete(True)
if you dont want the message :
UltraGridRow.Delete(False)