Hi,
I would like to validate the price field in the grid. Currently, the grid line is allowing to enter non-numeric characters also in the price field. This should be validated and set the price as 0.00 when non-numeric value is entered in the grid line.
Note: The validation needs to be done on when editing a price cell in the line(by double clicking of the price cell) of the grid.
Thanks in advance for your help!
You can use “onEditCell” method to check what value was entered into the cell:
mygrid.attachEvent(“onEditCell”,function(stage,rowId,cellId,newValue,oldValue){
if ((stage==2)&&(cellInd==0)){
//validate newValue
}
});
Hi,
I used the below code provided by you. I facing a problem now, because of the below code.
You can use "onEditCell" method to check what value was entered into the cell:
mygrid.attachEvent("onEditCell",function(stage,rowId,cellId,newValue,oldValue){
if ((stage==2)&&(cellInd==0)){
//validate newValue
}
});
mygrid.attachEvent("onEditCell",function(stage,rowId,cellId,newValue,oldValue){
if ((stage==2)&&(cellInd==0)){
//validate newValue
}
});
Problem is, when I use the above code, I couldnt check the checkbox in the same row. Its not allowing me to check the check box in the same row..
Please let me know the solution for this problem.
Try to add “return true” to the event handler definition:
mygrid.attachEvent(“onEditCell”,function(stage,rowId,cellId,newValue,oldValue){
if ((stage==2)&&(cellInd==0)){
//validate newValue
return true;
}
return true;
});
Thanks for your reply…
Its working fine now…