Hi !!!
I am facing unexpected issue with UltraWebGrid. I have set number format on the Grid's column using column's format property and now using setValue and by GUI inputing new value to the grid's cell and it is not taking the format given at the server side using following code snippet : Format = "###,##0,";
Am I doing something wrong there or is it expected behavior ???? I have also tried with Editors but not working
Bunty :)
Bunty,
I format the cells dinamically using a javascript code:
function HandleExitEdit(gridID,cellID) { var cell = igtbl_getCellById(cellID); var line = cell.getRow().getIndex(); var rows = igtbl_getGridById(gridID).Rows; var current_line = rows.getRow(line); var coluna = cell.Column.Key; if ((coluna == 'KEYOFCOLUMN') && (current_line.getCellFromKey('KEYOFCOLUMN').getValue() != "")&& (current_line.getCellFromKey('KEYOFCOLUMN').getValue() != null)) { var value = current_line.getCellFromKey('KEYOFCOLUMN').getValue(); //Type here a piece of code to format the string urrent_line.getCellFromKey('KEYOFCOLUMN').setValue(value); } }
And on uwg's propertie ClienteSideEvents set this:
<ClientSideEvents AfterExitEditModeHandler="HandleExitEdit" />
I hope this helpful.
Thank you for your help.
I have tried to use the above given workaround but it is not working in my case, as I have provided you with the format which I am using and I have tried to use the following workaround:
function HandleExitEdit(gridID,cellID) { var cell = igtbl_getCellById(cellID); var line = cell.getRow().getIndex(); var rows = igtbl_getGridById(gridID).Rows; var current_line = rows.getRow(line); var coluna = cell.Column.Key; if ((coluna == 'TestCol') && (current_line.getCellFromKey('TestCol').getValue() != "")&& (current_line.getCellFromKey('TestCol').getValue() != null)) { var value = current_line.getCellFromKey('TestCol').getValue();
//Type here a piece of code to format the string value = parseFloat(value) / 1000; // But this will change the column value + this will need to interchange when again try to access the //column Please suggest do I need to set column format from there?? current_line.getCellFromKey('TestCol').setValue(value); } }