Hi,
I am having some issues with tab key when the grid cell is in edit mode.
In the activationCellChanging client script am checking the keyCode to trace some keys.
Am using the method
eventArgs.get_browserEvent().keyCode
This is working for all other keys. But then the tab key is pressed and the cell is in edit mode i got undefined error.
get_browserEvent() is undefined.
When the cell is in the normal mode (non editing) , i got eventArgs.get_browserEvent().keyCode=9
Please let me know what is the issue.
Regards
Jojesh
Hello Jojesh,
Thanks for you patience. I can suggest you to check whether get_browserEvent() is undefined in ActiveCellChanging event, if it is just to move on, because after that the KeyUp event will trigger and from there you can check which key is pressed and retrieve, for example, the new active cell value (after tab btn click) or to handle the KeyDown event and for example to get the cell value before the tab btn click. Or you can use only the KeyUp and KeyDown events, depends on your goal.
If this not satisfy you, can you give me more information about your goal here? I look forward to hearing from you!
Dear Zdravko
Thanks for the solution.
But my main intention is to move the selection to next editable cell.
The next editable cell is determined using some logic.
Basically it is downwards in column and when it reaches the last cell of the column it start from the next column first row and then again starts moving to downwards in the column. In between it will skip some cells and sometime entire column.
I have implemented this with the Enter key. But we need to implement same with tab key also. When the cell is in the edit mode i am not able to get the key code for tab key. I am preventing the undefined error by checking for undefined get_browserevent().
What is the best way to change the tab behavior to make the next active cell based on certain conditions
Hi Jojesh,
I've made you a sample demonstrating a possible workaround to achieve this functionality, to downwards in columns.
Basically I use JavaScript to move across the cells. I have set the EnableOnActive property, when the cell goes active, directly to go on edit mode:
See the attachment and if you have any other question feel free to ask me!
Dear Zdravko,
Thanks for your support and sample.
I got some idea from your example and i could manage to make the desired behavior.
I would like to ask you another thing. Is there any way to identify a particular cell isReadOnly. I want to skip those cells which are not editable when press tab key.
Please let me know whether there is any kind of JavaScript APi to find out a particular cell isReadOnly.
You need to get the column key of the cell. Then, find the column settings of the cellEditing behavior using that key and check is the get_readOnly(), true. This should be what you want.
I'm glad that I helped you to achieve the desired behavior!
I have another post here http://ko.infragistics.com/community/forums/p/85195/425159.aspx#425159
Can you help me to solve it
I’m currently looking into your issue about TextBoxEditor: default selection behavior.
I’ll let you know what I’ve found out soon.