views:

68

answers:

1

I know - 2007 is outdated - but I can't switch to the newer controls at the moment.

I've figured out that the TreeView is not showing properly in IE8 because of an internal function:

RadTreeView.AlignImage=function(_4e){
_4e.align="absmiddle";
_4e.style.display="inline";
if(!document.all||window.opera){
if(_4e.nextSibling&&_4e.nextSibling.tagName=="SPAN"){
_4e.nextSibling.style.verticalAlign="middle";
}
if(_4e.nextSibling&&_4e.nextSibling.tagName=="INPUT"){
_4e.nextSibling.style.verticalAlign="middle";
}

The fix would be:

RadTreeView.AlignImage=function(_4e){
_4e.align="middle";
_4e.style.display="inline";
if(!document.all||window.opera){
if(_4e.nextSibling&&_4e.nextSibling.tagName=="SPAN"){
_4e.nextSibling.style.verticalAlign="middle";
}
if(_4e.nextSibling&&_4e.nextSibling.tagName=="INPUT"){
_4e.nextSibling.style.verticalAlign="middle";
}

Edit: It seems to be used as absMiddle in the .NET assembly too. The above functions are javascript functions.

But how can I change this in the compiled dll? Is there any way to fix that in the dll?

Do I need to use code reflection? Or is there any workaround to override the AlignImage function?

Edit


A quick and dirty fix is setting a css (Edit2: this fixes the treeview - but might cause ohter issues with input and img html elements)

input
{
    vertical-align: middle!important;
}
img
{
    vertical-align: middle!important;
}
A: 

Andreas, I would jump to the Telerik AJAX treeview because I know it supports IE8 fully and will support IE9 when it is released. For the old treeview you should either use workarounds or set IE7 compatibility mode to make sure it will be rendered properly.

Dick Lampard
It's already set to IE7 compatibility. AJAX is not allowed by the customer. My CSS hack fixed it for now - and I need to support IE6 and IE8 only for the next 4 years. No need for IE9 support.
Andreas Rehm