ValueChanging event on Infragistics WebDataGrid

2.9k Views Asked by At

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?

1

There are 1 best solutions below

0
On

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