I wanted to avoid any HTML file creation , so initial HTML was formed as a string and assigned to DocumentText.
After that the aim was to manipulate with html using DOM .
It turned out when dynamically adding rows to table
ctable = (mshtml.HTMLTableClass)htable.DomElement;
foreach (T row in table)
{
crow = (mshtml.HTMLTableRowClass)ctable.insertRow(currow++);
crow.id = rowId + "_" + row.id ;
crow.onclick = "hilight_row(this,'#ffcc99')";
ccell = (mshtml.HTMLTableCellClass)crow.insertCell(0);
...
}
page updates are dispalyed properly without refreshing DocumentText , but onclick script is not fired unless DocumentText is reassigned again
Now after
DocumentText = updatedHTML
html is shown from the top , whereas the need is to keep the existing location ( I mimic multicolumn tree in html and after expanding a parent row it should stay visible ).
Attempt to introduce anchors and call javascript where
location.href = anchor ;
or anything like
xdoc = xie1.document
xelem2 = xdoc.getElementByID( some_ID )
xelem2.ScrollIntoView
didn't result in successful outcome. Html still on a top. Which probably due to internal initial navigation to about:blank and ignoring further navigation.
Any idea how to overcome this problem and keep only string/Dom manipulations without html file creation.