I need to mix different types of ViewStypes (Infragistics.Win.UltraWinTree.ViewStyle) on the different levels of a data source bound tree. I would like the top two levels within the tree (each level is a DataTable) to appear as a Standard tree node whist the bottom level to appear as a Grid (multiple Cells). This is the structure that I would like to get:
+ Level 1
+ Level 2
+ Level 3 Column1 | Level3 Column2 | Level 3 Column 3| ...
What is the easiest way to achieve something like that? If I start with tree ViewStyle Grid all levels within the tree appear as single or multi-cell grid levels. Thanks!
If you didn't change ShowBandNodes from the default, then your data source must have more than one relationship under Level 1. This is easy enough to check. Trap the ColumnSetGenerated event and loop through the columns in the Level 1 ColumnSet. Check each column's IsChaptered property. If there is more than one, then you have more than one child band. I think if you hide or remove all but one of the chaptered columns, the band nodes should go away.
Thanks Mike. My objective is to remove this band node alltogether, not just change its name. I will try to reproduce this behavior in a sample project and post it here if I cannot find a solution.
Hi,
Like I said, the tree only shows the band nodes (by default) if you have sibling node.
Maybe you set tree.ColumnSettings.ShowBandNodes to Always? The default is OnlyForSiblingBands.
Or perhaps there is another relationship directly under Level 1 which is therefore a sibling of Level1_Level2
Anyway, you can set the text of the band nodes to whatever you want. I'd recommend using the InitializeDataNode event:
private void ultraTree1_InitializeDataNode(object sender, Infragistics.Win.UltraWinTree.InitializeDataNodeEventArgs e) { if (e.Node.IsBandNode) { switch (e.Node.BandName) { case "Level1_Level2": e.Node.Text = "Whatever text I want."; break; } } }
I see that the first band node ('Standard type node') is named correctly - ie. Level 1. 2nd Level node is named as I named DataRelation between 2nd and 1st bands - Level1_Level2 (as opposed to name of the 2nd band DataTable - Level 2).
For some reason even though I indicated 'ShowColumns =False' for 1st and 2nd level what I see (see your first response) this is the tree structure that I end up with:
+ Level 1 (1st Datatable name, standard node)
+ Level1_ Level 2 (Name of the relationship appears as a standard node)
+ Level 2 (2nd Datatable name, appears as a grid node)
+ Level 3 Column1 | Level3 Column2 | Level 3 Column 3| ... (3rd Datatable name, appears as a grid node)
I want to get rid of the Level1_ Level 2 (replace it with Level 2 DataTable name) and make Level 2 DataTable a standard node (right now it became a 3rd level node b/c of the relation). Any way to prevent Relation name to be shown on the tree at all? Thanks!
The name of the band comes from the data source, and in the case of a DataSet, it's always the name of the Relationship. So I expect you are mistaken about the third level.
It also doesn't matter which ViewStyle you are using.
Where are you seeing the band names, anyway? Those will only show up if you have sibling bands and you don't have any in the example you describe here.