Hello,
i'm using webdatagrid 2012 vol 1 with unbound columns, and i'd like to recalculate unbound columns when i exit cell editting mode in adding row . Please tell me how to do that. Sorry for my poor English.
Hi ThuyNga Nguyen,
Thank you for posting in our forum.
If you want to set value for an unbound column when adding new row, you could use the ExitingEditMode client-side event:
function ExitingEditModeHandler(sender, eventArgs) { eventArgs.getCell().get_row().get_cellByColumnKey("Unbound_Field1").set_value("some text");}
Please let me know if this helps.
Thank you for replying me soon. i'd like to explain my question in more detail: i have a webdatagrid with 5 columns: old_tax, new_tax, unitprice,quantity,price. Quantity and price are unbound columns: quantity=new_tax-old_tax, price=quantity*unitprice. And i 'd like when i add a new row, right when i exit editing mode from cell old_tax or new_tax or unitprice, i can get value from these cells to calculate new value for quantity and price cells.
Hi,
This is a sample event handler for ExitingEditMode which implements the desired functionality:
Please let me know if you have any questions.
Hi Nikolay,
Thank you for your code, with some modify it works now. I have another question: i set BatchUpdating=true in my webdatagrid, but when i add new row, after pressing enter key, the new row is disappeared. If i run my webdatagrid alone, it works well. I include my code here, pls help me to fix it. Thank you in advance.
Hello ThuyNga Nguyen,
I'm glad you solved your issues.
Feel free to contact me if you have any other questions.
i've solved my problems. Pls forget my last question. Thanks for your help.