Gets/sets the
UltraTreeColumnSet instance that defines the column structure for nodes that do not have a more specific setting.
Syntax
Example
The following code sample demonstrates how to use the properties of the UltraTreeColumnSet object to control the behavior of all columns in a particular UltraTreeColumnSet's Columns collection.
| Visual Basic | Copy Code |
|---|
Imports Infragistics.Win
Imports Infragistics.Win.Layout
Imports Infragistics.Win.UltraWinTree
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim rootColumnSet As UltraTreeColumnSet = Me.ultraTree1.ColumnSettings.RootColumnSet
rootColumnSet.AllowCellSizing = LayoutSizing.None
rootColumnSet.AllowCellSpanSizing = GridBagLayoutAllowSpanSizing.None
rootColumnSet.AllowColMoving = GridBagLayoutAllowMoving.None
rootColumnSet.AllowLabelSizing = LayoutSizing.None
rootColumnSet.AllowLabelSpanSizing = GridBagLayoutAllowSpanSizing.None
rootColumnSet.AllowSorting = DefaultableBoolean.False
rootColumnSet.BorderStyleCell = UIElementBorderStyle.None
rootColumnSet.BorderStyleColumnHeader = UIElementBorderStyle.None
rootColumnSet.CellAppearance.BackColor = SystemColors.Control
rootColumnSet.CellWrapText = DefaultableBoolean.False
rootColumnSet.ColumnAutoSizeMode = ColumnAutoSizeMode.VisibleNodes
rootColumnSet.HeaderStyle = HeaderStyle.Standard
rootColumnSet.ColumnHeaderAppearance.BackColor = SystemColors.ControlDark
rootColumnSet.ColumnHeaderImageSize = New Size(20, 20)
If rootColumnSet.ExpansionIndicatorColumn Is Nothing Then
rootColumnSet.Columns("CompanyName").CanShowExpansionIndicator = DefaultableBoolean.True
End If
rootColumnSet.LabelPosition = NodeLayoutLabelPosition.Top
rootColumnSet.LabelStyle = NodeLayoutLabelStyle.Separate
rootColumnSet.NodeTextColumn = rootColumnSet.Columns("CompanyName")
rootColumnSet.NullText = "[NULL]"
rootColumnSet.ShowSortIndicators = DefaultableBoolean.True
End Sub
|
| C# | Copy Code |
|---|
using Infragistics.Win; using Infragistics.Win.Layout; using Infragistics.Win.UltraWinTree; using System.Diagnostics;
private void button1_Click(object sender, System.EventArgs e)
{
UltraTreeColumnSet rootColumnSet = this.ultraTree1.ColumnSettings.RootColumnSet;
// Disallow cell sizing for all columns in the
Columns collection
rootColumnSet.AllowCellSizing = LayoutSizing.None;
// Disallow cell span sizing for all columns in
the Columns collection
rootColumnSet.AllowCellSpanSizing =
GridBagLayoutAllowSpanSizing.None;
// Disallow moving for all columns in the
Columns collection
rootColumnSet.AllowColMoving = GridBagLayoutAllowMoving.None;
// Disallow header sizing for all columns in the
Columns collection
rootColumnSet.AllowLabelSizing = LayoutSizing.None;
// Disallow header span sizing for all columns
in the Columns collection
rootColumnSet.AllowLabelSpanSizing =
GridBagLayoutAllowSpanSizing.None;
// Disallow sorting for all columns in the
Columns collection
rootColumnSet.AllowSorting = DefaultableBoolean.False;
// Don't display cell borders for any columns in
the Columns collection
rootColumnSet.BorderStyleCell = UIElementBorderStyle.None;
// Don't display header borders for any columns
in the Columns collection
rootColumnSet.BorderStyleColumnHeader =
UIElementBorderStyle.None;
// Set the BackColor for all cells in all
columns to 'Control'
rootColumnSet.CellAppearance.BackColor = SystemColors.Control;
// Set CellWrapText to False to prevent text
from
// wrapping to additional lines in all
columns
rootColumnSet.CellWrapText = DefaultableBoolean.False;
// Set ColumnAutoSizeMode to 'VisibleNodes' so
that when the end
// user auto-sizes a column, only currently
visible cells are considered
rootColumnSet.ColumnAutoSizeMode =
ColumnAutoSizeMode.VisibleNodes;
// Set the HeaderStyle property to 'Standard',
so that column headers
// are not themed, and set the BackColor of the
ColumnHeaderAppearance
// to 'ControlDark'.
rootColumnSet.HeaderStyle = HeaderStyle.Standard;
rootColumnSet.ColumnHeaderAppearance.BackColor = SystemColors.ControlDark;
// Change the size of images displayed in the
headers to 20w X 20h
rootColumnSet.ColumnHeaderImageSize = new Size( 20, 20 );
// If there is currently no
ExpansionIndicatorColumn, set the
// CanShowExpansionIndicator property to true
for the
// 'CompanyName' column
if (
rootColumnSet.ExpansionIndicatorColumn == null )
rootColumnSet.Columns["CompanyName"].CanShowExpansionIndicator = DefaultableBoolean.True;
// Set the LabelPosition property ot display
headers on top of cells,
// and set the LabelStyle property to display
headers and cells
// separately.
rootColumnSet.LabelPosition = NodeLayoutLabelPosition.Top;
rootColumnSet.LabelStyle = NodeLayoutLabelStyle.Separate;
// Assign the 'CompanyName' column to the
NodeTextColumn property,
// so that the value of the Text property is
obtained from the cell
// in the 'CompanyName' column.
rootColumnSet.NodeTextColumn =
rootColumnSet.Columns["CompanyName"];
// Set the NullText property to "[NULL]" so that
null values in any
// cell for all columns is displayed the same
way.
rootColumnSet.NullText = "[NULL]";
// Show sort indicators for all columns
rootColumnSet.ShowSortIndicators = DefaultableBoolean.True;
} |
See Also