Hi
I've noticed with numeric editor providers when a user tries to enter char values it is disallowed. I've got an unbound field on a grid which I need to accept an integer value only. I've applied a numeric editor provider but I get an error when the page loads
System.Exception: Editor with ID: nepOrdinal cannot edit column with Key:OrdinalUnbound. The editor does not support the column type.
If I comment out the editor the page loads fine.
I can run the page without an editor provider but then I have to validate the input server side and its not as nice / slick if the editor allows text.
Hi Philip Brassington,
I was able to reproduce your issue. However, it seems that you probably did not define the data type of this unbound filed (at least this is how I reproduced it). If this is your case, be aware that grid will use default data type and that's why such error is thrown. Just add the following attribute to your unbound field
This should resolve the issue. Please let me know whether this is helpful for you!
Hi Petko
Thanks for the response, pointed me in the right direction.
If I make the unbound field DataType="system.int" then I get the same 'diesn't support this type' error. The solution is to make the field DataType=System.Decimal" and then change the editor provider to DataMode="int" then I get the result I need, namely an unbound field that I fill manually with int values, that accepts an int only on edit.
In case anyone is having a similar issue there's two snippets below.
<ig:UnboundField Key="OrdinalUnbound" DataType="System.Decimal" > <Header Text="Enter Ordinal" /> </ig:UnboundField>
<EditorProviders> <ig:NumericEditorProvider ID="nepOrdinal"> <EditorControl DataMode="Int" MaxValue="255" MinValue="0"></EditorControl> </ig:NumericEditorProvider> </EditorProviders>