|
Rank: Newbie Groups: Member
Joined: 8/13/2009 Posts: 2
|
Hello, I am trying to use the treeview control with check boxes in a simple aspx page. The requirement I have is to hide check box on the root node and enable it on child nodes. The root node is displayed normally and after expanding it, image place holders appear instead of check boxes for its children. Here is a simple page to replicate the issue.
Code: HTML/ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckBox.aspx.cs" Inherits="TestApp.CheckBox" %>
<%@ 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">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
EO.Web.TreeNode node = new EO.Web.TreeNode();
node.Text = "Root Node";
node.Value = "Root Node";
node.PopulateOnDemand = true;
node.OnClickScript = "onNodeSelected(false);";
node.ShowCheckBox = EO.Web.NullableBool.False;
TreeView1.Nodes.Clear();
TreeView1.Nodes.Add(node);
}
}
protected void TreeView1_ItemPopulate(object sender, EO.Web.NavigationItemEventArgs e)
{
EO.Web.TreeNode node = e.TreeNode;
for (int i = 0; i < 5; i++ )
{
EO.Web.TreeNode sub = new EO.Web.TreeNode();
sub.Text = node.Text + "." + i.ToString();
sub.Value = node.Text + "." + i.ToString();
sub.Expanded = false;
sub.PopulateOnDemand = true;
sub.ShowCheckBox = EO.Web.NullableBool.True;
sub.ToolTip = "Tree Node";
node.ChildNodes.Add(sub);
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<eo:TreeView ID="TreeView1" runat="server" OnItemPopulate="TreeView1_ItemPopulate" AutoExpandOnClick="False">
</eo:TreeView>
</div>
</form>
</body>
</html>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, I believe you need to set the TreeView's CheckBoxImages.Visible to true for that. It will be something like this:
Code: HTML/ASPX
<eo:TreeView ......>
<CheckBoxImages Visible="True"></CheckBoxImages>
....
</eo:TreeView>
Please let us know if it works for you. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 8/13/2009 Posts: 2
|
That works with my requirments.
Thanks for your time.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Thanks for confirming that it works. Please feel free to let us know if you have any more questions.
|
|