I have tried for 7 hours to change my child node column to no avail.
I have a Tree bound to a datasource with a relationship. The root node displays the correct column from the datatable but the child node is displaying the second column from the relationed. Sadly this column is the foreignkey for my relationship. How do I get the child node to display the 3rd column instead?
I am using outlookexpress viewmode here.
I have in my primary table :- IndustryID, IndustryName, Note, Rating
and my secondary table :- SkillID, IndustryID, SkillName, Note
Relationship is based on the IndustryID
My tree shows the Root node (IndustryName) and ChildNode(IndustryID). I would like the child to show SkillName.
sample code will go a long way here.
i am not able to see your attached zip file. can you help me how to get the same?
Thanks
You are the man. Thanks a lot. So much easier when you know how.
Hi,
Okay, I see the issue now. I was under the impression that you are showing stand-style nodes, but that's not the case. So the NodeTextColumn will do nothing here.
You are using OutlookExpress ViewStyle and just hiding all but one column. So what you have to do in a case like this where you are using OutlookExpress style and you have different ColumnSets for each band, is map the child column to the parent column you want. You do this using the MapToColumn property on the column.
#Region " ColumnSet Generated " Private Sub ultraTree1_ColumnSetGenerated(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.ColumnSetGeneratedEventArgs) Handles UltraTree1.ColumnSetGenerated Dim tree As UltraTree = CType(sender, UltraTree) If e.ColumnSet.Key = "Project" Then 'e.ColumnSet.NodeTextColumn = e.ColumnSet.Columns("TaskName") e.ColumnSet.Columns("TaskName").MapToColumn = "ProjectName" End If If e.ColumnSet.Key = "Projects" Then For Each _col As UltraWinTree.UltraTreeNodeColumn In e.ColumnSet.Columns _col.Visible = False Next e.ColumnSet.Columns("Project").Visible = True e.ColumnSet.Columns("ProjectName").Visible = True e.ColumnSet.NodeTextColumn = e.ColumnSet.Columns("ProjectName") End If End Sub#End Region
Any luck with the files?
Thanks, I have added the file now.