The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
TreeView using Microsoft.Web.UI.WebControls
Posted: 18 Jul 06 2:59 PM
|
fiogf49gjkf0d I have had to create several treeviews (which work) but now need to add some type of tooltip to each node. From what I could find on the web there is imagetooltip and tooltip for the node but I get the following error when I add the node.tooltip = value.
Compiler Error Message: BC30456: 'ToolTip' is not a member of 'Microsoft.Web.UI.WebControls.TreeNode'.
Dim nodeOrgChart As New Microsoft.Web.UI.WebControls.TreeNode() nodeOrgChart.Text = "Organization Chart" nodeOrgChart.ImageUrl="/webctrl_client/1_0/images/orgchart.gif" nodeOrgChart.ToolTip = "Test Tip" <=====***************
Anyone familiar with using this? |
|
|
|
Re: TreeView using Microsoft.Web.UI.WebControls
Posted: 18 Jul 06 3:28 PM
|
fiogf49gjkf0d Looks good to me, not sure if there is a diffrence between .net 1.1 and .net 2
but in my version (2) the first line is Dim nodeOrgChart As New TreeNode
Not sure if that helps at all |
|
|
| |
|
Re: TreeView using Microsoft.Web.UI.WebControls
Posted: 19 Jul 06 8:41 AM
|
fiogf49gjkf0d I do notice that if I set the ASP.NET tab in IIS to ver 1.1 then I can use Dim nodeOrgChart As TreeNode
If I set it to 2.0 I must fully qualify the control as Dim nodeOrgChart As New Microsoft.Web.UI.WebControls.TreeNode()
But either way the .tooltip is not excepted. |
|
|
| |
| |
|
Re: TreeView using Microsoft.Web.UI.WebControls
Posted: 19 Jul 06 8:59 AM
|
fiogf49gjkf0d Yes the treeview works perfectly. I just would like to have a tooltip popup onmouseover of the username with the users title. When I add the node.tooltip line it errs. The page in question is quite large so I created a skinny version for you to get an idea of what I am doing.
Had to strip a few things to get it to post here...
@ Import NameSpace="Microsoft.Web.UI.WebControls" @ Import Namespace="System.Data" @ Import Namespace="System.Data.SqlClient" @ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" @ Page Language="vb" Debug="false"
<script runat="server"> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) GrowTree End Sub
Sub GrowTree Dim nodeOrgChart As New Microsoft.Web.UI.WebControls.TreeNode() nodeOrgChart.Text = "SalesLogix Organization Chart" nodeOrgChart.ImageUrl = "/webctrl_client/1_0/treeimages/orgchart.gif" SLXOrgTree.Nodes.Add(nodeOrgChart) SLXOrgTree.ExpandLevel = 1 Dim nodeTeams As New Microsoft.Web.UI.WebControls.TreeNode() nodeTeams.Text = "Teams" nodeTeams.ImageUrl = "/webctrl_client/1_0/treeimages/team.gif" nodeOrgChart.Nodes.Add(nodeTeams) Teams(nodeTeams) End Sub
Sub Teams(nodeObj As Object) Dim strConn As String = "Server=MYSERVER UID=MYLOGON PWD=MYPWD database=MYDB" Dim objConn As New SqlConnection(strConn) Dim DataSet As New DataSet Dim daGroups As New SqlDataAdapter("SELECT * FROM USERSECCODE WHERE SECCODETYPE = 'G' ORDER BY SECCODEDESC", objConn) Dim daMembers As New SqlDataAdapter("SELECT USERNAME, PARENTSECCODEID, USERID, PROFILEDESCRIPTION, ISMANAGER FROM USERJOINS WHERE PARENTSECCODEID IN (SELECT SECCODEID FROM USERSECCODE WHERE SECCODETYPE = 'G') ORDER BY USERNAME", objConn) daGroups.Fill(DataSet, "dtGroups") daMembers.Fill(DataSet, "dtMembers") objConn.Close() DataSet.Relations.Add("GroupsToMembers", _ DataSet.Tables("dtGroups").Columns("SECCODEID"), _ DataSet.Tables("dtMembers").Columns("PARENTSECCODEID")) Dim nodeGroups As New Microsoft.Web.UI.WebControls.TreeNode() Dim nodeMembers As New Microsoft.Web.UI.WebControls.TreeNode() Dim rowGroups As DataRow Dim rowMembers As DataRow For Each rowGroups In DataSet.Tables("dtGroups").Rows nodeGroups = New Microsoft.Web.UI.WebControls.TreeNode() nodeGroups.Text = "" + rowGroups("SECCODEDESC") + "" nodeGroups.ID = rowGroups("SECCODEID") nodeGroups.ImageUrl = "/webctrl_client/1_0/treeimages/team.gif" nodeObj.Nodes.Add(nodeGroups) For Each rowMembers In rowGroups.GetChildRows("GroupsToMembers") nodeMembers = New Microsoft.Web.UI.WebControls.TreeNode() nodeMembers.Text = "" + rowMembers("USERNAME") + " - " + rowMembers("PROFILEDESCRIPTION") + "" nodeMembers.ID = rowMembers("USERID") If rowMembers("ISMANAGER") = "T" Then nodeMembers.ImageUrl = "/webctrl_client/1_0/treeimages/manager.gif" Else nodeMembers.ImageUrl = "/webctrl_client/1_0/treeimages/employee.gif" End If nodeGroups.Nodes.Add(nodeMembers) Next Next DataSet.Dispose() daGroups.Dispose() daMembers.Dispose() objConn.Close() objConn.Dispose() End Sub
</script>
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" html head title SalesLogix Organization Chart /title /head body form id="frmSLXOrgTree" method="post" runat="server" ie:TreeView id="SLXOrgTree" runat="server" /ie:TreeView /form /body /HTML |
|
|
|
Re: TreeView using Microsoft.Web.UI.WebControls
Posted: 19 Jul 06 12:36 PM
|
fiogf49gjkf0d Usually the problem with fully qualifying the name stems from using the same name somewhere in an internal class, or it exists in one of your using statements. Sometimes even fully qualifying the name won't fix issues resulting from using the same name in multiple places.
Not that this is the case, mind you, but it's most often the problem if you have to fully qualify names. |
|
|
| |
| |
| |
| |
|
Re: I got two good eyes but still don't see!
Posted: 21 Jul 06 8:28 AM
|
fiogf49gjkf0d Thanks Duncan. I will store that away for future use. Don't pause in posting any suggestions to me. I am learning this more and more each day. I welcome any and all suggestions. I have never had any .NET training PERIOD. I just learn by doing and re-doing and well you get the point! |
|
|
|
Re: I got two good eyes but still don't see!
Posted: 21 Jul 06 11:56 AM
|
fiogf49gjkf0d No worries. Join the club, on the no .Net training and the doing and re-doing approach, but I do find you learn more by just getting stuck in! |
|
|
|