This walkthrough will show you how to use OnEditKeyDown client side event.
In this topic, you will learn the basic thing on how to validate input (number only) in a cell using OnEditKeyDown.
To validate input (number only) in a cell using OnEditKeyDown
- Select WebGrid's instance and press F4.
- In Layout Settings, select ClientSideEvents, then set OnEditKeyDown to WebGrid1_OnEditKeyDown.
- Write the following function in OnEditKeyDown client side event:
JavaScript Copy Code function WebGrid1_OnEditKeyDown(controlId) { var WebGrid1 = ISGetObject(controlId); var key = event.keyCode; if(key < 96 || key > 105) { return false; } else { return true; } }
- Run the project.
References
OnEditKeyDown Property
Other Resources
Walkthrough Topics
How-to Topics