Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Cant update webgrid cells from client script
posted

I am trying to update the value of a cell through any means possible (innerHTML,  cell.appendChild(), etc) and it appears that it is working when I step through the code, but it does not actually reflect the change in the browser. Its almost like the elements on the page are readonly.

Does anybody have any ideas as to why this is not updating on the browser? Please let me know if you need any more info.

Thanks,

Andrew 

Parents
  • 28464
    posted

    Hello Andrew, 

    I believe an easier approach and one that would give more consistent results would be using the client-side object model of UltraWebGrid (CSOM) instead of directly manupilating the DOM elements.

    You just need to obtain a reference to the "cell" you need to modify and use the setValue method instead of directly using innerHTML/appendChild etc. 

    List of available cell client-side API methods/properties is available here: 

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/WebGrid_cell_Object_CSOM.html 

    Sample code and additional information can be found here:

    http://help.infragistics.com/Help/NetAdvantage/NET/2007.2/CLR2.0/html/WebGrid_Object_CSOM.html 

    For example this is how you show the value of the first cell of all selected grid rows with BLOCKED SCRIPT 

    for(var rowId in grid.SelectedRows)
    {
        var row=igtbl_getRowById(rowId);
        alert(row.getCell(0).getValue());
    }

    Hope this helps. 

Reply Children