Infragistics2.Win.UltraWinTree.v8.1
AllowCellEdit Property
See Also  Example
Infragistics.Win.UltraWinTree Namespace > UltraTreeColumnSettings Class : AllowCellEdit Property

Gets/sets whether cells can be activated and/or edited.

Syntax

Visual Basic (Declaration) 
Public Property AllowCellEdit As AllowCellEdit
C# 
public AllowCellEdit AllowCellEdit {get; set;}

Remarks

The AllowCellEdit property is exposed by each of the column-related objects (UltraTreeNodeColumn, UltraTreeColumnSet, and UltraTreeColumnSettings), and the UltraTreeNodeCell object exposes an UltraTreeNodeCell.AllowEdit property, which is named differently but functionally identical. The AllowCellEdit property of the UltraTreeColumnSettings object is the least specific of all the levels, that is, applies to the most cells.

Cells can be disabled by setting the AllowCellEdit property to 'Disabled'.

The end user can be prevented from changing a cell's contents, while still being allowed to copy the cell's contents, by setting the AllowCellEdit property to 'ReadOnly'.

The AllowCellEdit property does not, by itself, determine the behavior exhibited when a cell is clicked with the mouse; the Override.CellClickAction property also determines whether a cell can be activated and/or edited when it is clicked with the mouse.

Example

The following code samples demonstrates how to use the cell editing related properties of the UltraTreeColumnSettings object to configure the cell editing functionality for all cells in the UltraTree:

Visual BasicCopy Code
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTree

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Use the ActiveCellAppearance to bring attention to the cell
        ' with the input focus
        Me.ultraTree1.ColumnSettings.ActiveCellAppearance.BackColor = Color.Red
        Me.ultraTree1.ColumnSettings.ActiveCellAppearance.ForeColor = Color.White

        ' Set AllowCellEdit to 'ActivateOnly' so that clicking a cell does
        ' not put in into edit mode immediately
        Me.ultraTree1.ColumnSettings.AllowCellEdit = AllowCellEdit.ActivateOnly

        ' Set TabNavigation to 'NextCell' so that the tab key can be used to
        ' navigate to a cell
        Me.ultraTree1.ColumnSettings.TabNavigation = TabNavigation.NextCell

        ' Enable tooltips for cells whose value is not fully visible
        Me.ultraTree1.ColumnSettings.TipStyleCell = TipStyleCell.Show

    End Sub

C#Copy Code
using Infragistics.Win;
using Infragistics.Win.UltraWinTree;
using System.Diagnostics;

       
private void button1_Click(object sender, System.EventArgs e)
       {
           
//    Use the ActiveCellAppearance to bring attention to the cell
           
//    with the input focus
           
this.ultraTree1.ColumnSettings.ActiveCellAppearance.BackColor = Color.Red;
           
this.ultraTree1.ColumnSettings.ActiveCellAppearance.ForeColor = Color.White;

           
//    Set AllowCellEdit to 'ActivateOnly' so that clicking a cell does
           
//    not put in into edit mode immediately
           
this.ultraTree1.ColumnSettings.AllowCellEdit = AllowCellEdit.ActivateOnly;

           
//    Set TabNavigation to 'NextCell' so that the tab key can be used to
           
//    navigate to a cell
           
this.ultraTree1.ColumnSettings.TabNavigation = TabNavigation.NextCell;

           
//    Enable tooltips for cells whose value is not fully visible
           
this.ultraTree1.ColumnSettings.TipStyleCell = TipStyleCell.Show;
       }

See Also