Grid - Editable Column To Uppercase while the user is typing

Hi,
I have a grid with an editable column (ed.). While the user is typing, I would like to make the text uppercase and limit no more than 20 characters. Something like that:

myGrid.attachEvent(“onEditCell”, function(stage, id, index, nValue){
if (stage === 1 && index === 0) {
myTreeGrid.editor.obj.onkeypress = function () {
return this.value.toUpperCase().substr(0, 20);
};
}
});
but unfortunately it does not work

Hi,
I found a solution and fixed it. This is possibly useful to someone. Since I noticed the support on this forum is not very active.

myGrid.attachEvent(“onEditCell”, function(stage, id, index){
if (stage === 1 && index === 0) {
myGrid.editor.obj.onkeyup = function () {
this.value = this.value.toUpperCase().substr(0, 20);
};
}
return true;
});

The idea is that in the input field all letters automatically become uppercase and no more than 20 characters.
Thanks,