Reloading Grid from XML

I have the following code that loads my grid / treegrid from an XML Dom obj that is obtained externally.  This code works fine for both tree loading and smart rendering mode. 

        if (mode == ‘tree’ || rowCount <= 15){
            // load in tree mode
            // load it in Smart Render  mode
            var loader = new dtmlXMLLoaderObject();

I now have a case where I need to clear all rows and reload with a new XMLContent (which has the same structure, just different values) with out reconstructing the grid.  I tried to just use grid.clearAll(false);  and then run the above code again, but end up getting the following exception when using the tree loading (parseXML) in the dhtmlXGridObject.prototype._prepareRow function: 

    this.hdr.rows[0].cells    ‘this.hdr.rows.0.cells’ is null or not an object    Error

Is there a better way to do this? I think something like updateFromXML is what I need, but since I’m not loading via URL, this function doesn’t work for me (I think it doesn’t work in smart rendering mode either, or least I thought I read some post about this).  I need something that will update from an external XML Dom and work in both tree and smart rendering mode.


I think I had another issue that was causing the problem. I just fixed it and now it appears my code above does reload the data ok. I still need to verify if it works for smart rendering mode, however.