0

有谁知道为什么这不起作用或解决方法?

我正在尝试从 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改变......

这是怎么回事?

4

1 回答 1

0

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

于 2012-04-09T16:00:33.000 回答