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

EventArgs for BeforeRowFixedStateChanged event.

Syntax

Visual Basic (Declaration) 
Public Class BeforeRowFixedStateChangedEventArgs 
   Inherits System.ComponentModel.CancelEventArgs
C# 
public class BeforeRowFixedStateChangedEventArgs : System.ComponentModel.CancelEventArgs 

Example

The following code shows some of the information available in the BeforeRowFixedStateChanged and the AfterRowFixedStateChanged event handlers.

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.

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


    Private Sub UltraGrid1_BeforeRowFixedStateChanged(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.BeforeRowFixedStateChangedEventArgs) Handles UltraGrid1.BeforeRowFixedStateChanged
        Dim operation As String

        ' NewFixedState specifies whether the row is being fixed or unfixed.
        If e.NewFixedState Then
            operation = "fix"
        Else
            operation = "unfix"
        End If

        Dim r As DialogResult = MessageBox.Show(Me, "You are about to " & operation & _
                                                " row with the first cell value of " _
                                                & e.Row.Cells(0).Text & ". Continue?", _
                                                "Confirm", MessageBoxButtons.YesNo)

        If DialogResult.Yes <> r Then
            ' Set Cancel to true to cancel the operation.
            e.Cancel = True
        End If
    End Sub

    Private Sub UltraGrid1_AfterRowFixedStateChanged(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.AfterRowFixedStateChangedEventArgs) Handles UltraGrid1.AfterRowFixedStateChanged
        Dim operation As String

        ' You can find out whether the row was fixed or unfixed by using the
        ' Fixed property of the row.
        If e.Row.Fixed Then
            operation = "fixed"
        Else
            operation = "unfixed"
        End If

        MessageBox.Show(Me, "The row with the first cell value of " _
                    & e.Row.Cells(0).Text & " has been " & operation)
    End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;


		private void UltraGrid1_BeforeRowFixedStateChanged(object sender, Infragistics.Win.UltraWinGrid.BeforeRowFixedStateChangedEventArgs e)
		{
			string operation;

			// NewFixedState specifies whether the row is being fixed or unfixed.
			if ( e.NewFixedState )
			{
				operation = "fix";
			}
			else
			{
				operation = "unfix";
			}
				
			DialogResult r = MessageBox.Show( this, "You are about to " + operation + 
												" row with the first cell value of " 
												+ e.Row.Cells[0].Text + ". Continue?", 
												"Confirm", MessageBoxButtons.YesNo );

			if ( DialogResult.Yes != r )
			{
				// Set Cancel to true to cancel the operation.
				e.Cancel = true;
			}
		}

		private void UltraGrid1_AfterRowFixedStateChanged(object sender, Infragistics.Win.UltraWinGrid.AfterRowFixedStateChangedEventArgs e)
		{
			string operation;

			// You can find out whether the row was fixed or unfixed by using the
			// Fixed property of the row.
			if ( e.Row.Fixed )
			{
				operation = "fixed";
			}
			else
			{
				operation = "unfixed";
			}

			MessageBox.Show( this, "The row with the first cell value of " 
				+ e.Row.Cells[0].Text + " has been " + operation );
		}

See Also