#Region " ultraTree1_AfterDataNodesCollectionPopulated " Private Sub tvGroup_AfterDataNodesCollectionPopulated(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.AfterDataNodesCollectionPopulatedEventArgs) Handles tvGroup.AfterDataNodesCollectionPopulated ' This event fires after the tree has populated a Nodes collection ' with data from the data source. ' Since the nodes collection has been populated with nodes at Me point, ' This is an excellent place to autosize the columns based on their ' contents. Dim column As UltraTreeNodeColumn For Each column In e.Nodes.ColumnSetResolved.Columns ' column.PerformAutoResize() column.PerformAutoResize(UltraWinTree.ColumnAutoSizeMode.AllNodesWithDescendants) Next End Sub #End Region #Region " ultraTree1_InitializeDataNode " Private Sub ultraTree1_InitializeDataNode(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.InitializeDataNodeEventArgs) Handles tvGroup.InitializeDataNode ' This event fires every time a node is added to the tree from ' a data source. ' Make sure that only the highest-level employees show up at ' the root level of the tree. 'If e.Node.Parent Is Nothing AndAlso _ ' Not e.Node.Cells("SupervisorID").Value Is DBNull.Value Then ' e.Node.Visible = False ' Return 'End If 'we dont want to show checkbox on Industry With e.Node If .BandName = "tblIndustry" Then .Cells("Required").AllowEdit = AllowCellEdit.Disabled ' .Cells("Required").Value = DBNull.Value End If End With With e.Node If .BandName = "tblGroup" Then .Cells("Required").AllowEdit = AllowCellEdit.Disabled ' .Cells("Required").Value = DBNull.Value End If End With With e.Node If .BandName = "tblList" Then .Cells("Required").AllowEdit = AllowCellEdit.Full .Cells("Required").EditorComponent = xCheckEditor .Cells("Required").Column.DataType = GetType(Boolean) .Cells("Required").Appearance.TextHAlign = HAlign.Center End If End With ' Put a space before each parent node and color the parent ' nodes so the the tree is a little easier to read. If e.Node.Nodes.Count > 0 Then ' No point in putting a space before the root node. If Not e.Node.Parent Is Nothing Then e.Node.Override.NodeSpacingBefore = 5 End If e.Node.Override.NodeAppearance.BackColor = Color.LightSteelBlue e.Node.Override.NodeAppearance.FontData.Bold = DefaultableBoolean.True End If ' If Me is the root node (CEO) then expand it. 'If e.Node.Parent Is Nothing Then ' e.Node.Expanded = True 'End If e.Node.Expanded = True End Sub #End Region ' ultraTree1_InitializeDataNode #Region " ColumnSet Generated " Private Sub tvGroup_ColumnSetGenerated(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.ColumnSetGeneratedEventArgs) Handles tvGroup.ColumnSetGenerated 'If tvGroup.Nodes.Count = 1 Then ' 'e.ColumnSet.Columns("GroupName").VisibleResolved ' e.ColumnSet.Columns("GroupName").Visible = True ' e.ColumnSet.Columns("IndustryID").Visible = False 'End If ' e.ColumnSet.Columns.Item("IndustryID").ColumnSet.Columns("GroupName").Visible = True ' e.ColumnSet.Columns("SkillGroupID").Visible = False ' Center the text in the Status Column 'e.ColumnSet.Columns("SkillGroup").CellAppearance.TextHAlign = HAlign.Center ' Set the NodeTextColumn to the Last Name column. ' This has 2 effects: ' First, it tells the tree which column to use for Keyboard searching. ' Second, it tells the tree which column to show on each ' node when the ViewStyle is set to Standard. 'e.ColumnSet.NodeTextColumn = e.ColumnSet.Columns("Industry") If e.ColumnSet.Key = "tblIndustry" Then For Each _col As UltraWinTree.UltraTreeNodeColumn In e.ColumnSet.Columns _col.Visible = False Next '' show some columns With e.ColumnSet .Columns("Industry").Visible = True .Columns("GroupName").Visible = True .Columns("Skill").Visible = True .Columns("tblGroup").Visible = True .Columns("Required").Visible = True .Columns("Required").DataType = GetType(Boolean) ' .Columns("Required").AllowCellEdit = AllowCellEdit.Full End With e.ColumnSet.NodeTextColumn = e.ColumnSet.Columns("Industry") End If If e.ColumnSet.Key = "tblGroup" Then For Each _col As UltraWinTree.UltraTreeNodeColumn In e.ColumnSet.Columns _col.Visible = False Next '' show some columns With e.ColumnSet .Columns("Industry").Visible = True .Columns("GroupName").Visible = True .Columns("Skill").Visible = True .Columns("tblList").Visible = True .Columns("Required").Visible = True ' .Columns("Required").DataType = GetType(Boolean) ' .Columns("Required").AllowCellEdit = AllowCellEdit.Full End With 'e.ColumnSet.Columns("IndustryID").Visible = True ' e.ColumnSet.Columns("GroupName").MapToColumn = "Industry" 'e.ColumnSet.NodeTextColumn = e.ColumnSet.Columns("GroupName") End If If e.ColumnSet.Key = "tblList" Then '' show some columns For Each _col As UltraWinTree.UltraTreeNodeColumn In e.ColumnSet.Columns _col.Visible = False Next With e.ColumnSet .Columns("Industry").Visible = True .Columns("GroupName").Visible = True .Columns("Skill").Visible = True .Columns("Required").Visible = True ' .Columns("Required").DataType = GetType(Boolean) ' .Columns("Required").AllowCellEdit = AllowCellEdit.Full End With ' e.ColumnSet.Columns("Skill").MapToColumn = "GroupName" ' e.ColumnSet.NodeTextColumn = e.ColumnSet.Columns("Industry") End If End Sub #End Region Private Sub tvGroup_AfterCheck(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.NodeEventArgs) Handles tvGroup.AfterCheck End Sub Private Sub tvGroup_CellValueChanged(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.CellValueChangedEventArgs) Handles tvGroup.CellValueChanged If Not e.Node.BandName = "tblList" Then Exit Sub End If 'need to end edit and do whatever 'me.m_dbSkillList.ds.Tables("tblList") e.Node.Update() ' e.Node.EndCellEdit(True) bm.EndCurrentEdit() End Sub #Region " Tree After Select " Private Sub tvGroup_AfterSelect(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinTree.SelectEventArgs) _ Handles tvGroup.AfterSelect Dim x As UltraWinTree.UltraTree x = sender Exit Sub If Not x.ActiveNode.IsRootLevelNode Then Call lGetSkillList(x.ActiveNode.Cells.Item("SkillGroupID").Value) Else Call lGetSkillList(0) End If End Sub #End Region