Infragistics WebDataGrid 上的 ValueChanging 事件
有谁知道为什么这不起作用或解决方法?
我正在尝试从 EditorProvider 内部使用 ValueChanging 事件
我已经定义了一个 EditProvider
<ig:TextEditorProvider ID="tepPercent">
<EditorControl HorizontalAlign="Right" ClientEvents-ValueChanging="validatePercent4Decimals"></EditorControl>
</ig:TextEditorProvider>
和一个 javascript 处理程序
function validatePercent4Decimals(sender, args) {
var oldfieldvalue = args.get_oldValue();
var newfieldvalue = args.get_value();
if (isNaN(newfieldvalue)) {
args.set_value(oldfieldvalue);
args.set_cancel(true);
}
}
我已经对其进行了调试并且可以看到它正在运行,如果我输入 34r,则 inNan 测试为 true 并且 set_value 和 set_cancel 为叫。但网格上的值与34r相比并没有变化……
这是怎么回事?
Does anyone have an idea why this doesn't work or a workaround?
I'm trying to use the ValueChanging event from inside an EditorProvider
I have defined an EditProvider
<ig:TextEditorProvider ID="tepPercent">
<EditorControl HorizontalAlign="Right" ClientEvents-ValueChanging="validatePercent4Decimals"></EditorControl>
</ig:TextEditorProvider>
And a javascript handler
function validatePercent4Decimals(sender, args) {
var oldfieldvalue = args.get_oldValue();
var newfieldvalue = args.get_value();
if (isNaN(newfieldvalue)) {
args.set_value(oldfieldvalue);
args.set_cancel(true);
}
}
I've debugged it and can see it is running, and if I enter 34r, the inNan tests true and the set_value and set_cancel are called. But the value on the grid does not change from the 34r...
What's going on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 Infragistics 论坛上的这篇文章,我相信您有一个数字列。如果是这种情况,那么您应该改用 NumbericEditorProvider。 Infragistics 帮助中提供了有关可用编辑器的更多详细信息:
http:// /help.infragistics.com/NetAdvantage/ASPNET/2011.1?page=WebDataGrid_Editor_Providers.html
From this post on the Infragistics forums I believe that you have a numeric column. If this is the case then you should use a NumbericEditorProvider instead. There are more details on the available editor provides in the Infragistics help:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1?page=WebDataGrid_Editor_Providers.html