Version

BeforeRowActivate Event

Occurs before a row is activated.
Syntax
'Declaration
 
Public Event BeforeRowActivate As RowEventHandler
public event RowEventHandler BeforeRowActivate
Event Data

The event handler receives an argument of type RowEventArgs containing data related to this event. The following RowEventArgs properties provide information specific to this event.

PropertyDescription
Row The row (usually the row that the cell belongs to) (read-only)
Remarks

The row argument returns a reference to an UltraGridRow object that can be used to set properties of, and invoke methods on, the row that will be activated. You can use this reference to access any of the returned row's properties or methods.

This event is generated before a row is activated, which means it has been given focus.

The BeforeRowDeactivate event is generated before a row is deactivated, meaning it will lose focus.

The AfterRowActivate event, which occurs after a row is activated, is generated after this event.

Example
The following sample code illustrates how one can use combination of BeforeRowDeactivate and BeforeRowActivate to change the ActiveRow's appearance. ActiveRowAppearance property off the UltraGridOverride can be used to accomplish the same thing.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub UltraGrid1_BeforeRowDeactivate(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ultraGrid1.BeforeRowDeactivate

      Dim row As UltraGridRow = Me.ultraGrid1.ActiveRow

      ' Reset the FontData to default
      row.Appearance.FontData.Reset()

  End Sub

  Private Sub UltraGrid1_BeforeRowActivate(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.RowEventArgs) Handles ultraGrid1.BeforeRowActivate

      ' Set the font of the row about to be activated to bold
      e.Row.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True

  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void ultraGrid1_BeforeRowDeactivate(object sender, System.ComponentModel.CancelEventArgs e)
{

	UltraGridRow row = this.ultraGrid1.ActiveRow;
	 
	// Reset the FontData to default
	row.Appearance.FontData.Reset( );

}

private void ultraGrid1_BeforeRowActivate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e)
{

	// Set the font of the row about to be activated to bold
	e.Row.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True;

}
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