|
Rank: Advanced Member Groups: Member
Joined: 5/31/2007 Posts: 36
|
there is a problem with the checkbox icon and the icon that is associated to the image url. take a look at this code, i've created a new node and assign its image url and i want to show the checkbox both of them do not apper afer populate, please help.
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml; public partial class _Default : System.Web.UI.Page {
protected void TreeView1_ItemPopulate(object sender, EO.Web.NavigationItemEventArgs e) { EO.Web.TreeNode node = new EO.Web.TreeNode(); node.ShowCheckBox = EO.Web.NullableBool.True; node.ImageUrl = "~/images/car_blue.gif"; node.Text = "Sub Node"; e.TreeNode.ChildNodes.Add(node);
} }
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <eo:treeview id="TreeView1" runat="server" onitempopulate="TreeView1_ItemPopulate" controlskinid="None" height="260px" width="230px" > <looknodes> <eo:treenode disabledstyle-csstext="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;color:Gray;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;" imageurl="00030407" itemid="_Default" normalstyle-csstext="padding-right: 1px; padding-left: 1px; padding-bottom: 1px; color: black; border-top-style: none; padding-top: 1px; border-right-style: none; border-left-style: none; background-color: transparent; border-bottom-style: none" selectedstyle-csstext="background-color:Silver;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:white;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;"> </eo:treenode> </looknodes> <margin backgroundimageurl="00030417" visible="True" width="24" /> <topgroup style-csstext="background-image:url('00030417');background-repeat:repeat-y;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:11px;padding-bottom:2px;padding-left:2px;padding-right:2px;padding-top:2px;"> <nodes> <eo:treenode imageurl="00030407" populateondemand="True" text="Test"> </eo:treenode> </nodes> </topgroup> </eo:treeview> </div> </form> </body> </html>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
You won't be able to display a checkbox for a child node without also having a checkbox for the parent node. In your case the parent node ("Test") does not have a checkbox so setting the child node's ShowCheckBox to EO.Web.NullableBool.True won't work. To make it work you can try to set the parent node's ShowCheckBox to EO.Web.NullableBool.True as well.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 5/31/2007 Posts: 36
|
in that case there is no sinse making a showcheckbox property for each node, since it wont work unless i have all the checkbox shown you can put it in the main treeview properties.
also i've noticed that if the treeview is databind to xml and the bottom level has the showcheckbox property set to true the checkbox is shown ok like the way i want it, only the populate on demand is causing this problem .
any way in my case i don't want to show the check box at the top level is there any way to add this feature in the near future??
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
The reason that the parent item need a checkbox is in order to show the check status of the child items. For example, if one child item is checked and the other is not, the parent item will show as "half checked". Having a ShowCheckBox on each node makes it possible to have some part of the tree have checkbox and some part of the tree not having checkbox. For example, you can have checkbox on the first node and not having checkbox on the second node. We will think about making them totally independent with each other in the future.
Thanks
|
|