Version

Cells Property

Returns the TreeNodeCellsCollection which contains the cells for this UltraTreeNode.
Syntax
'Declaration
 
Public ReadOnly Property Cells As TreeNodeCellsCollection
public TreeNodeCellsCollection Cells {get;}
Remarks

The Cells collection contains instances of the UltraTreeNodeCell object. Accessing a member of the Cells collection will cause an UltraTreeNodeCell object to be created for the associated UltraTreeNodeColumn. In the interest of memory conservation, UltraTree's internal logic does not cause any UltraTreeNodeCell objects to be create unnecessarily. The end developer can use alternative methods to get or set a cell's value (see GetCellValue, SetCellValue) so that the performance impact caused by creating large numbers of UltraTreeNodeCell objects can be avoided.

Note: Cells are only displayed by nodes that have an UltraTreeColumnSet assigned to the Override instance which governs behavior for the node (see ColumnSet property). As with all properties of the Override object, the ColumnSet property can be set at several different levels; to determine the UltraTreeColumnSet which dictates the column structure for a particular node, use the DisplayColumnSetResolved property.



Note: A node will display cells if the UltraTreeColumnSet referenced by the DisplayColumnSetResolved property has visible columns, but this can be prevented by setting the ShowColumns property to DefaultableBoolean.False.

Example
The following code sample demonstrates how the properties of the UltraTreeNodeCell object can be used to customize the appearance and behavior of a particular cell.

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 cell As UltraTreeNodeCell = Me.ultraTree1.ActiveNode.Cells("CompanyName")

        '	If the cell's node is selected, use the appearance
        '	to make the cell more visually apparent.
        If cell.Node.Selected = False Then
            cell.Appearance.BackColor = Color.Red
            cell.Appearance.ForeColor = Color.White
        End If

        '	Assign an EditorWithText with a custom EmbeddableEditorOwnerBase
        '	derived implementation.
        cell.Editor = New EditorWithText(New CustomOwner(cell))

        '	Output the cell's displayed value to the debug window
        If cell.Column.NullText.Length = 0 AndAlso Not cell.Value Is Nothing Then
            Debug.WriteLine(cell.Text)
        Else
            Debug.WriteLine(cell.Column.NullText)
        End If

        '	Determine whether the cell is currently in view.
        Dim isInView As Boolean = (cell.UIElement Is Nothing = False)

    End Sub
using Infragistics.Win;
using Infragistics.Win.Layout;
using Infragistics.Win.UltraWinTree;
using System.Diagnostics;

		private void button1_Click(object sender, System.EventArgs e)
		{
			UltraTreeNodeCell cell = this.ultraTree1.ActiveNode.Cells["CompanyName"];
			
			//	If the cell's node is selected, use the appearance
			//	to make the cell more visually apparent.
			if ( cell.Node.Selected == false )
			{
				cell.Appearance.BackColor = Color.Red;
				cell.Appearance.ForeColor = Color.White;
			}

			//	Assign an EditorWithText with a custom EmbeddableEditorOwnerBase
			//	derived implementation.
			cell.Editor = new EditorWithText( /*new CustomOwner(cell)*/ );

			//	Output the cell's displayed value to the debug window
			if ( cell.Column.NullText.Length == 0 && cell.Value != null )
				Debug.WriteLine( cell.Text );
			else
				Debug.WriteLine( cell.Column.NullText );
	
			//	Determine whether the cell is currently in view.
			bool isInView = cell.UIElement != null;
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also