I have a treeview in a my asp.net page, it works fine when the page has a background color, but when i set a background-image(which is defined in the <body> tag) on the page, a terrible thing happened, the treeview no longer seems to be transparent, and insted it is shown as a white box.

Microsoft treeview background problem.

    I have tried treeview.styles.add() and added background colors, this seems to work, but it only allows me to change the color to something like red or blue, it doesnt allow transparent as an option. Then i hacked into treeview.htc(if you installed the Microsoft Internet Explorer WebControls for ASP .NET, you can find it in the "wwwroot/webctrl_client/1_0" folder), and get the idea that it can't be transparent. TreeView.htc is using a viewlink, which is actually a seperate document. I have changed the treeview.htc so that treeview support transparent background,here is the code:

Microsoft treeview background problem.function buildTreeFromRoot()
Microsoft treeview background problem.{
Microsoft treeview background problem.     Microsoft treeview background problem.
Microsoft treeview background problem.     bodyNode.style.direction 
= element.currentStyle.direction;
Microsoft treeview background problem.     
//this line is added for supportting transparent background
Microsoft treeview background problem.
     bodyNode.style.background = "transparent";
Microsoft treeview background problem.     
var head = element.document.createElement("HEAD");
Microsoft treeview background problem.     Microsoft treeview background problem.
Microsoft treeview background problem.}

    As you can see, I just add a line code in the "buildTreeFromRoot" function, but it worksMicrosoft treeview background problem.
    Hope this helpsMicrosoft treeview background problem.

相关文章:

  • 2021-09-11
  • 2021-10-02
  • 2022-12-23
  • 2021-04-12
猜你喜欢
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2021-07-04
  • 2022-01-03
相关资源
相似解决方案