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

This class represents a cell in the grid (a specific column in a specific row)

Syntax

Visual Basic (Declaration) 
Public Class UltraGridCell 
   Inherits ActivateableGridItemBase
   Implements Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Shared.ISelectableItem 
C# 
public class UltraGridCell : ActivateableGridItemBase, Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Shared.ISelectableItem  

Example

Following code illustrates how UltraGridBase.ActiveCell, UltraGridCell.IsActiveCell and UltraGridCell.Activated are related.

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

   Private Sub Button85_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button85.Click

       Dim cell As UltraGridCell = Me.UltraGrid1.Rows(0).Cells(0)

       ' IsActiveCell and Activated properties off the UltraGridCell test if the cell is the same
       ' as the UltraGrid.ActiveCell property. So all three of following should give the same
       ' result.
       Debug.WriteLine("Before:")
       Debug.WriteLine("cell.IsActiveCell = " & cell.IsActiveCell)
       Debug.WriteLine("cell.Activated =    " & cell.Activated)
       Debug.WriteLine("cell == UltraGrid.ActiveCell = " & (cell Is Me.ultraGrid1.ActiveCell))

       ' Toggle the activation.
       cell.Activated = Not cell.Activated

       Debug.WriteLine("After:")
       Debug.WriteLine("cell.IsActiveCell = " & cell.IsActiveCell)
       Debug.WriteLine("cell.Activated =    " & cell.Activated)
       Debug.WriteLine("cell == UltraGrid.ActiveCell = " & (cell Is Me.ultraGrid1.ActiveCell))

   End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button85_Click(object sender, System.EventArgs e)
{

	UltraGridCell cell = this.ultraGrid1.Rows[0].Cells[0];

	// IsActiveCell and Activated properties off the UltraGridCell test if the cell is the same
	// as the UltraGrid.ActiveCell property. So all three of following should give the same
	// result.
	Debug.WriteLine("Before:");
	Debug.WriteLine( "cell.IsActiveCell = " + cell.IsActiveCell );
	Debug.WriteLine( "cell.Activated =    " + cell.Activated );
	Debug.WriteLine( "cell == UltraGrid.ActiveCell = " + ( cell == this.ultraGrid1.ActiveCell ) );

	// Toggle the activation.
	cell.Activated = !cell.Activated;

	Debug.WriteLine("After:");
	Debug.WriteLine( "cell.IsActiveCell = " + cell.IsActiveCell );
	Debug.WriteLine( "cell.Activated =    " + cell.Activated );
	Debug.WriteLine( "cell == UltraGrid.ActiveCell = " + ( cell == this.ultraGrid1.ActiveCell ) );

}

See Also