CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.internet_explorer_web_controls Tags:
Item Type: NewsGroup Date Entered: 10/2/2003 2:30:04 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 5 Views: 42 Favorited: 0 Favorite
6 Items, 1 Pages 1 |< << Go >> >|
fralar
Asp.Net User
Microsoft.Web.UI.WebControls Treeview10/2/2003 2:30:04 PM

0

Hi

I trying use the treeview control on my ASP.NET application.
I have a problem when i want to expand a node.
All the items inculded in the node are shown on the same colon of the parent.
Have you any ideas to solve this problem.

Thank you for your answer

Regards
Bill2clone
Asp.Net User
Re: Microsoft.Web.UI.WebControls Treeview10/2/2003 3:14:27 PM

0

fralar
Asp.Net User
Re: Microsoft.Web.UI.WebControls Treeview10/2/2003 3:26:48 PM

0

Thanks for your answer

I send you the code.
<%@ Page Language="VB" %>
<%@ Register TagPrefix="portal" TagName="Banner" Src="~/DesktopPortalBanner.ascx" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="ASPNetPortal" %>
<%@ Register TagPrefix="bfc" Namespace="Bfc.Controls" Assembly="bfcControls"%>
<%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<script runat="server">

Private moduleId As Integer = 0
Private tabId As Integer = 0
Private tabIndex As Integer = 0
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
If Not IsPostBack Then
dim a as string ="0"
dim ServerName As String = "LocalHost"
Dim DataBaseName As String = "Portal"
Dim UserId As String = "sa"
Dim PassWord As String = "sa"
Dim StoredP As String = "select * from sherlockrelation where LevelId=1 order by levelid, ParentId"
Dim SqlType As String = "Text"
Dim Nsql As New SqlConnection
Dim CmLevelId As SqlDataAdapter
Dim CmParentId As SqlDataAdapter
Dim CmChildId As SqlDataAdapter
Dim CmItemId as SqlDataAdapter
Dim CmItemIcon as SqlDataAdapter
Dim ds As DataSet
Dim Ncmd As New Sqlcommand
Dim RowItem As DataRow
Dim _NewConnection as string = "server=" & ServerName & ";uid=" & UserId & ";pwd=" & PassWord & ";database=" & DataBaseName
Nsql= new SqlConnection(_NewConnection)
Ncmd= new SqlCommand(StoredP,Nsql)
ds = New DataSet
if SqlType="Text"
Ncmd.commandType=commandType.text
else
Ncmd.commandType=Commandtype.StoredProcedure
end if
Try
Nsql.Open()
Catch ex As Exception
a ="1"
Finally
if a="0"
Try
CmLevelId = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "LevelId")
CmParentId = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "ParentId")
CmChildId = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "ChildId")
CmItemId = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "ItemId")
CmItemIcon = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "ItemIcon")
Catch ex As Exception
end try
end if
End Try
'Populate the TreeView from the DataSet.
For Each RowItem In ds.Tables("ItemId").Rows
dim nodeItem = New TreeNode()
nodeItem.Text = RowItem("ItemId")
nodeItem.NodeData = RowItem("ChildId")
if RowItem("ParentId")>0 then
nodeItem.Expandable = ExpandableValue.always
End if
nodeItem.ImageUrl = "/webctrl_client/1_0/images/" & RowItem("ItemIcon")
'NodeItem.OnExpand=TvExpand
TvSherlock.Nodes.Add(nodeItem)
Next
'Clean up.
ds.Dispose()
Nsql.Close()
Nsql.Dispose()


End If
End Sub

' Sub for expand item on the treeView
Private Sub TvExpand(ByVal sender As Object, ByVal e As Microsoft.Web.UI.WebControls.TreeViewClickEventArgs)

dim a as string ="0"
dim nodeItem as TreeNode
nodeItem = sender.nodes(e.Node.ToString)
dim ParentSearch as integer = CInt(nodeItem.NodeData)
dim TvIndex as integer = CInt(NodeItem.GetNodeIndex)
dim ServerName As String = "LocalHost"
Dim DataBaseName As String = "Portal"
Dim UserId As String = "sa"
Dim PassWord As String = "sa"
Dim StoredP As String = "select * from sherlockrelation where parentId=" & ParentSearch & " order by levelid, ParentId"
Dim SqlType As String = "Text"
Dim Nsql As New SqlConnection
Dim CmLevelId As SqlDataAdapter
Dim CmParentId As SqlDataAdapter
Dim CmChildId As SqlDataAdapter
Dim CmItemId as SqlDataAdapter
Dim CmItemIcon as SqlDataAdapter
Dim ds As DataSet
Dim Ncmd As New Sqlcommand
Dim RowItem As DataRow
Dim _NewConnection as string = "server=" & ServerName & ";uid=" & UserId & ";pwd=" & PassWord & ";database=" & DataBaseName
Nsql= new SqlConnection(_NewConnection)
Ncmd= new SqlCommand(StoredP,Nsql)
ds = New DataSet
if SqlType="Text"
Ncmd.commandType=commandType.text
else
Ncmd.commandType=Commandtype.StoredProcedure
end if
Try
Nsql.Open()
Catch ex As Exception
a ="1"
Finally
if a="0"
Try
CmLevelId = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "LevelId")
CmParentId = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "ParentId")
CmChildId = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "ChildId")
CmItemId = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "ItemId")
CmItemIcon = New SqlDataAdapter(StoredP, Nsql)
CmLevelId.Fill(ds, "ItemIcon")
Catch ex As Exception
end try
end if
End Try
'Populate the TreeView from the DataSet.
For Each RowItem In ds.Tables("ItemId").Rows
nodeItem = New TreeNode()
nodeItem.Text = RowItem("ItemId")
nodeItem.NodeData = RowItem("ChildId")
nodeItem.Expandable = ExpandableValue.CheckOnce
nodeItem.ImageUrl = "/webctrl_client/1_0/images/" & RowItem("ItemIcon")
'NodeItem.OnExpand=TvExpand(nodeItem.NodeDtata)
TvSherlock.Nodes.Addat(TvIndex+1, NodeItem)
Next
'Clean up.
ds.Dispose()
Nsql.Close()
Nsql.Dispose()


End Sub
</script>

<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../portal.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
<Form runat="server">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td height="100%" class="ItemTitle">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="100%" class="ItemTitle">
<ie:TreeView id="TvSherlock" style="Z-INDEX: 101; LEFT: 13px; POSITION: absolute; TOP: 13px" runat="server" SystemImagesPath="/webctrl_client/1_0/treeimages/" OnExpand="TvExpand" autopostback="True" >

</ie:TreeView>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
Bill2clone
Asp.Net User
Re: Microsoft.Web.UI.WebControls Treeview10/2/2003 3:53:25 PM

0

Just before digging in your code.
You added webctrl_client\1_0 under wwwroot (view post 342819), but did you add \bin (with Microsoft.Web.UI.WebControls.dll) there too?
DNN skins Forum
Tressleworks modules
DNN & webhosting
IEWCtrls
fralar
Asp.Net User
Re: Microsoft.Web.UI.WebControls Treeview10/2/2003 4:07:44 PM

0

When i build the treeview with HTML code, it run perfectly and the treevieew looks like XP treeview.
When i use VB to build the treeview, all the values are shown but the items are aligned left.
The (Microsoft.Web.UI.WebControls.dll) is on the righ place like you say.

Thank if you have an idea
Bill2clone
Asp.Net User
Re: path issue10/9/2003 3:10:21 PM

0

Suggestion.

Desktopmodules\treeview.ascx
|_webctrl_client

SystemImagesPath="DesktopModules/webctrl_client/1_0/treeimages
DNN skins Forum
Tressleworks modules
DNN & webhosting
IEWCtrls
6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET Unleashed Authors: Stephen Walther, Pages: 1459, Published: 2003
Advanced SharePoint Services Solutions: Advanced Sharepoint Services Solutions Authors: Scot Hillier, Pages: 365, Published: 2005
.NET programming 10-minute solutions: 10-Minute Solutions Authors: A. Russell Jones, Mike Gunderloy, Pages: 433, Published: 2003
ASP.NET Developer's Cookbook Authors: Steven A. Smith, Rob Howard, ASP Alliance, Pages: 456, Published: 2003
ASP.NET 2.0 Black Book Authors: Dreamtech Software, Charul Shukla, Dreamtech Software India, Anil Kumar Barnwal, Pages: 1167, Published: 2006
Sams Teach Yourself More Visual Basic .NET in 21 Days Authors: Lowell Mauer, Pages: 579, Published: 2002
ASP.NET by example Authors: Steven A. Smith, Pages: 527, Published: 2002
Pro C# 2008 and the .NET 3.5 Platform Authors: Andrew Troelsen, Pages: 1370, Published: 2007
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Pro ASP. Net 3. 5 Server Controls and AJAX Components Authors: Rob Cameron, Dale Michalk, Pages: 740, Published: 2008

Web:
Microsoft.Web.UI.WebControls.Design Assembly Reference Provides the designer class for Microsoft.Web.UI.WebControls.TreeView. Note All of the classes within the Microsoft.Web.UI.WebControls. ...
About the TreeView WebControl As with the other Microsoft Internet Explorer WebControls, the TreeView control .... WebControls" Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226, ...
ASP.NET Microsoft.Web.UI.WebControls Treeview Problem - ASP.NET Forums In these web applications we are using the treeview control which is part of the Microsoft.Web.UI.WebControls package. ...
Programmatically Loading, Expanding and Searching TreeView May 16, 2002 ... It is obvious that writers of Microsoft.Web.UI.WebControls.TreeView were more concerned with design time features of this control than with ...
Microsoft.Web.UI.Webcontrol Treeview Talk about Microsoft.Web.UI.Webcontrol Treeview. ... Reload this Page Microsoft. Web.UI.Webcontrol Treeview ...
Microsoft.Web.UI.WebControls - TreeView is ambiguous - ASP.NET Forums Hi, I've a problem, from some day my web site doesn't work. I use Microsoft.Web. UI.WebControls.dll (v.1.0.2.226) for building a treeview, ...
Deriving from Microsoft.Web.UI.WebControls.TreeView - CodeGuru Forums public class TimesheetTreeView : Microsoft.Web.UI.WebControls.TreeView { }. I add a TreeView control to my form and then edit then entry in ...
Microsoft.Web.UI.WebControls.Treeview Data Population Hai all, I have a Microsoft.Web.UI.WebControls dll and trying to form a treeview . But instead ....
Extending Microsoft.Web.UI.WebControls.TreeNode - MSDN Forums Extending Microsoft.Web.UI.WebControls.TreeNode. Answered Question This post has a code sample within it. Was this post helpful ? ...
SelectedIndexChange event is not working in Microsoft.Web.UI ... I'm using a Microsoft.Web.UI.WebControls treeview in my web application (ASP.NET 1.1). It is working fine and i have built a tree with data. ...






how to autoselect a node?

styling issue

problem installing ie web controls

tabstrip and multipage usage

tree view control - mouse over events

inserting a javascript function call upon a treenode selection

subtree is null or not an object

treeview with enabled autopostback stops collapsing/expanding

i can run iewebcontrols

drag and drop in treeview control

see treeview in action

dll file not created in ie webcontrol download

treeview of ms ie web controls

insufficient state to deserialize the object.

microsoft tree view control

iis sever, urgent

installation problem & relative webctrl_client directory.

a way to detect and save changes automatically?

treeview drag and drop

need help with asp.net, c# and treeview web control

wierd treeview behaviour after migration

tree view display problems

modifying treeview and treenode

directory/folder tree browsing

microsoft tabstrip control problem

treeview does not show a tree, just plain string of text

tabstrip

changing checkbox style

editboxes and other controls inside treenodes?

ie web controls instalation problem

   
  Privacy | Contact Us
All Times Are GMT