Hi all,
In my application, I have a grid with some cells disabled for editing and some cells with allow editing. I wan to make these editable cells to accept only numeric entries. There is a way to handle the key down event of grid and only accept the numeric keys. Is there some other way to do this. During my R&D I came to know a property "Editor" of cell which accept "Infragistics.Win.EmbeddableEditorBase" object. Is this helpful in this regard and what will be the way?
Thanks
Habib Ahmad
Hi Habib,
If you want to mask the input of a cell, you could use an Editor, but that's the complicated way to do it. A much easier way is to set the Style property of the column. There are styles that only allow numeric values. If none of the styles suit your needs, then another way to do it would be top use the InputMask (or maybe it's MaskInput, I always get them mixed up) property of the column.
Hi Mike,
Thanks for reply.
The actual problem is that my grid have some rows to be shown as heading. And rows below a heading will have editable numeric cells. Now heading can have Alpha numeric values in cells where as data rows will only have numeric values. If I change the style property of cell to use some numeric style or use input mask for numeric input, then heading rows does not work for alphanumeric data. I think the final solution is to use an editor. I just need some sample code that how to use UltraNumericEditor in grid cell.
Again, you could do this using an editor, but there is an easier way. Simply set the Style property on the Cell instead of the Column. Or... set it on the column and then override the column setting by setting it again on individual cells.
There's really no reason to use an UltraNumericEditor for this. The grid already has numeric editing capability built-in. But if you really feel that you must use an editor, then all you do is put an UltraNumericEditor on the form and set the properties you want on it, then assign the EditorControl of the column or cell to the UltraNumericEditor control.
Hi Luc,
That makes sense. Editor overrides EditorComponent. :)
Indeed, it has effect, but only when there is no editor attached to the column. This was the problem. After removing the column editor, it works.
Thanks and regards,
Luc
Assigning an EditorComponent to a column certainly does have an effect on the cell. But what kind of effect are you trying to achieve?
The UltraNumericEditor can not be assigned to the cell.Editor property, because the UltraNumericEditor is not inherited from the EmbeddableEditorBase class.
The UltraNumericEditor can be assigned tot the cell.EditorComponent property, but this has no effect on the cell.
Do you have any suggestion for using a numeric editor in a WinGrid cell?
Regards,
I'm afraid I don't understand your post. The URL you listed here is for WebGrid, not WinGrid. The code you have listed here doesn't seem to have any relation to the original poster's question about using masks on some cells of a column and not others. Is this related in some way? Or did you post in the wrong place by accident?