Treeview tweak

R

richie_hackett

OK I have been tearing my hair out trying to get the Treeview
webcontrol to display a background image.


My current thinking is that mozilla allows you to render the treeview
as a table instead of using the htc. Any ideas how this can be done
for all requests? I have noticed that the Treeview control inherits
from the BaseRichControl which has a Browser Level check method


I figure if I can make the web page believe that the browser doesn't
support the htc component I can get the result I need. However the
browser settings come from the headers which can't be editted(to the
best of my knowledge)


Any ideas on how I can extend... overload... modify... or butcher this
 
A

Andrew Robinson

Richie,

Wrap your TreeView in a Table / TableCell and set the Table Cell Background
to your image:

<table>
<tr>
<td background="myBackground.jpg">
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode Text="New Node" Value="New Node">
<asp:TreeNode Text="New Node" Value="New Node">
<asp:TreeNode Text="New Node" Value="New Node">
<asp:TreeNode Text="New Node" Value="New Node"></asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</td>
</tr>
</table>
 
R

richie_hackett

Unfortunately not. I am using the microsoft.web.ui.controls component.
When you set a background the treeview picks up the background colour
but will not pick up the image. This is the way the htc has been
written. I have tried setting transparent for all nodes and it still
doesn't work, hence I was trying to make the component present the
treeview as a table not a htc. Thanks anyway
 
A

Andrew Robinson

Richie,

You have me a bit confused. Take a look at this:

http://www.binaryocean.com/samples/treeviewbackground/

There is a nice background image under the tree view.

When you say that you are using the Microsoft.web.ui.controls are you
talking about the old treeview navigation control? Why not give the built in
System.Web.UI.WebControls.TreeView control a try. Yes, you have to use
version 2.0 of the Framework.

Hope this helps or at least reduces my confusion over what you are trying to
do.
 
R

richie_hackett

Thats exactly what I want but I need it in 1.1 without buying it.
Basically someone speced a project and said it could be done without
checking. At the 11th hour technical tried to put it in and it didn't
work so were out of budget and nearly out of time
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,814
Members
47,359
Latest member
Claim Bitcoin Earnings. $

Latest Threads

Top