CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.internet_explorer_web_controls Tags:
Item Type: NewsGroup Date Entered: 7/21/2004 9:13:46 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 20 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
dilfee
Asp.Net User
treeview control display only text ???why?7/21/2004 9:13:46 AM

0/0

hi

I just tried the iewc treeviw and i tried one exemple (it's not mine).look:

<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
<%@ Page language="c#" Codebehind="ietreeview.aspx.cs" AutoEventWireup="false" Inherits="IETreeView.IETreeView" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>ietreeview</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<iewc:TreeView id="treeDirectory" runat="server" ImageUrl="images/dir.gif" ExpandedImageUrl="images/dir_open.gif">
<iewc:TreeNodeType ImageUrl="images/text.gif" ID="Document" Type="Document"></iewc:TreeNodeType>
<iewc:TreeNodeType ImageUrl="images/xmldoc.gif" ID="xmlDoc" Type="XmlDoc"></iewc:TreeNodeType>
<iewc:TreeNodeType ImageUrl="images/aspxdoc.gif" ID="aspxDoc" Type="AspxDoc"></iewc:TreeNodeType>
<iewc:TreeNodeType ImageUrl="images/vbdoc.gif" ID="VBDoc" Type="vbDoc"></iewc:TreeNodeType>
<iewc:TreeNodeType ImageUrl="images/csdoc.gif" ID="CSDoc" Type="csDoc"></iewc:TreeNodeType>
<iewc:TreeNodeType ImageUrl="images/resx.gif" ID="ResxDoc" Type="resxDoc"></iewc:TreeNodeType>
<iewc:TreeNodeType ImageUrl="images/img.gif" ID="Image" Type="img"></iewc:TreeNodeType>
<iewc:TreeNode Text="Root" ID="RootNode"></iewc:TreeNode>
</iewc:TreeView>
<br>
</form>
</body>
</HTML>



using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;

using Microsoft.Web.UI.WebControls;

namespace IETreeView
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class IETreeView : System.Web.UI.Page
{
protected Microsoft.Web.UI.WebControls.TreeView treeDirectory;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
PopulateTreeView(MapPath(""), treeDirectory.GetNodeFromIndex("0"));
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void PopulateTreeView(string strDirectory, TreeNode nodeParent)
{
try
{

DirectoryInfo CurDir = new DirectoryInfo(strDirectory);

DirectoryInfo[] DirArray;
FileInfo[] FilesArray;

DirArray = CurDir.GetDirectories();
FilesArray = CurDir.GetFiles();

//DirectoryInfo curdirInfo;
//FileInfo curfileInfo;

foreach (FileInfo curfileInfo in FilesArray)
{
TreeNode newFileNode = new TreeNode();
newFileNode.Text = curfileInfo.Name;
if(curfileInfo.Extension == ".xml")
{
newFileNode.Type = "XmlDoc";
}
else if(curfileInfo.Extension == ".aspx")
{
newFileNode.Type = "AspxDoc";
}
else if(curfileInfo.Extension == ".vb")
{
newFileNode.Type = "vbDoc";
}
else if(curfileInfo.Extension == ".cs")
{
newFileNode.Type = "csDoc";
}
else if(curfileInfo.Extension == ".gif")
{
newFileNode.Type = "img";
}
else if(curfileInfo.Extension == ".resx")
{
newFileNode.Type = "resxDoc";
}
else
{
newFileNode.Type = "Document";
}
nodeParent.Nodes.Add(newFileNode);
}
foreach (DirectoryInfo curdirInfo in DirArray)
{
TreeNode newDirNode = new TreeNode();
newDirNode.Text = curdirInfo.Name;
string strDir;
strDir = curdirInfo.FullName;
nodeParent.Nodes.Add(newDirNode);
PopulateTreeView(strDir, newDirNode);
}
}
catch(UnauthorizedAccessException)
{
TreeNode node = new TreeNode();
node.Text = "Access Denied!";
nodeParent.Nodes.Add(node);
}
}
}
}

un look which is the result (WHYYYYYYYYYY)

Root AssemblyInfo.cs Global.asax Global.asax.cs Global.asax.resx ietreeview.aspx ietreeview.aspx.cs ietreeview.aspx.resx IETreeView.csproj IETreeView.csproj.webinfo IETreeView.sln IETreeView.suo Web.config bin IETreeView.dll IETreeView.pdb microsoft.web.ui.webcontrols.dll images aspxdoc.gif csdoc.gif dir.gif dir_open.gif img.gif resx.gif text.gif vbdoc.gif xmldoc.gif _vti_cnf _vti_pvt access.cnf deptodoc.btr doctodep.btr service.cnf service.lck services.cnf _vti_script _vti_txt

Can someone tell me why?this isn't the rigth result.
Thanks.
dennisgorelik
Asp.Net User
Re: treeview control display only text ???why?7/22/2004 8:43:59 PM

0/0

If you're trying to access your page from external IP address then it works only if you have set Internet Explorer:
Tools
Internet options
Security
Internet
Low

The problem is that default security settings in IE are "Medium".

I don't know how to handle this problem on end users' computers...
:-(

If you know how - please email me: asp.net (at) dennisgorelik.com
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
VB.NET Developer's Guide: Developer's Guide Authors: Cameron Wakefield, Henk-Evert Sonder, Wei Meng Lee, Pages: 784, Published: 2001
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Access 2003 Programming by Example with VBA, XML, and ASP Authors: Julitta Korol, Pages: 600, Published: 2005
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
Pro .NET 2.0 XML Authors: Bipin Joshi, Pages: 499, Published: 2007
.NET Programming 10-minute Solutions: 10-Minute Solutions Authors: A. Russell Jones, Mike Gunderloy, Pages: 433, Published: 2004
Developing Microsoft Office Solutions: Answers for Office 2003, Office XP, Office 2000, and Office 97 Authors: Ken Bluttman, Pages: 608, Published: 2003
Professional C# Authors: Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen, Pages: 1224, Published: 2004

Web:
How to populate a TreeView control with XML data in Visual C# 2005 ... Text = "TreeView control from XML"; this.Width = 336; this. ... In many instances, you may want to display only part of the XML data. ...
How To Populate a TreeView Control with XML Data in Visual Basic .NET Text) ' SECTION 2. Initialize the treeview control. TreeView1.Nodes. ... In many instances, you may want to display only part of the XML data. ...
Treeview displayed as Text - ng.asp-net-forum ... TreeView Web Server Control Overview The TreeView Web server control is used to display hierarchical data, such as a ... Node text that can be displayed as ...
YUI Library Examples: TreeView Control: Using TreeView with Custom ...