Version

Disabling a WinGrid Cell

You may need to disable a single Cell in the WinGrid™ control, or even a group of cells scattered throughout the grid. Each cell exposes an Activation property, which you can set to the Activation enumeration. Through this property, you can implement an activation behavior for any cell in the WinGrid control. You can choose to have a cell activate only, allow editing, disable completely, or just disallow edits.

The following code disables the first cell in the first row of WinGrid by setting the Activation property to Disable. When disabled, a cell will display its text as grayed out, similar to the screenshot shown to the right. This topic assumes that you have a WinGrid control on your form with at least one band. For more information on data binding the WinGrid control, see Bind WinGrid to a Flat Data Source.

disable a ultragrid cell

In Visual Basic:

Me.UltraGrid1.Rows(0).Cells(0).Activation = _
  Infragistics.Win.UltraWinGrid.Activation.Disabled

In C#:

this.ultraGrid1.Rows[0].Cells[0].Activation =
  Infragistics.Win.UltraWinGrid.Activation.Disabled;