Infragistics(R) NetAdvantage(R) Windows Forms
ReadOnlyCellAppearance Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > UltraGridOverride Class : ReadOnlyCellAppearance Property

Determines the formatting attributes that will be applied to the cells that are read-only.

Syntax

Visual Basic (Declaration) 
Public Property ReadOnlyCellAppearance As Infragistics.Win.AppearanceBase
C# 
public Infragistics.Win.AppearanceBase ReadOnlyCellAppearance {get; set;}

Example

The following code sets read-only appearance and makes a cell read-only. The read-only cell will be displayed using this appearance.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid


    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
        ' ReadOnlyCellAppearance will apply to cells that are read-only. A cell can be read-only
        ' by means of datasource not allowing edits on the associated column or by the CellActivation 
        ' property settings.
        Me.ultraGrid1.DisplayLayout.Override.ReadOnlyCellAppearance.BackColor = Color.Blue
        Me.ultraGrid1.DisplayLayout.Override.ReadOnlyCellAppearance.ForeColor = Color.Yellow

        ' Make the cell read-only. You will notice that the above appearance will apply
        ' to the cell.
        Me.ultraGrid1.Rows(2).Cells(2).Activation = Activation.ActivateOnly
    End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;


		private void button1_Click(object sender, System.EventArgs e)
		{
			// ReadOnlyCellAppearance will apply to cells that are read-only. A cell can be read-only
			// by means of datasource not allowing edits on the associated column or by the CellActivation 
			// property settings.
			this.ultraGrid1.DisplayLayout.Override.ReadOnlyCellAppearance.BackColor = Color.Blue;
			this.ultraGrid1.DisplayLayout.Override.ReadOnlyCellAppearance.ForeColor = Color.Yellow;

			// Make the cell read-only. You will notice that the above appearance will apply
			// to the cell.
			this.ultraGrid1.Rows[2].Cells[2].Activation = Activation.ActivateOnly;
		}

See Also