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

sender
e
delegate for handling event that is fired before a row is resized

Syntax

Visual Basic (Declaration) 
Public Delegate Sub BeforeRowResizeEventHandler( _
   ByVal sender As Object, _
   ByVal e As BeforeRowResizeEventArgs _
) 
C# 
public delegate void BeforeRowResizeEventHandler( 
   object sender,
   BeforeRowResizeEventArgs e
)

Parameters

sender
e

Example

Following code shows how you can use BeforeRowResize event to prevent the user from resizing a row to heights greater than 50 pixels.

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_BeforeRowResize(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.BeforeRowResizeEventArgs) Handles ultraGrid1.BeforeRowResize

      If e.NewHeight > 50 Then
          ' Cancel the event so the UltraGrid doesn't proceed with resizing.
          e.Cancel = True

          ' Set the height to the max height, 50.
          e.Row.Height = 50
      End If

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

private void ultraGrid1_BeforeRowResize(object sender, Infragistics.Win.UltraWinGrid.BeforeRowResizeEventArgs e)
{

	if ( e.NewHeight > 50 )
	{
		// Cancel the event so the UltraGrid doesn't proceed with resizing.
		e.Cancel = true;

		// Set the height to the max height, 50.
		e.Row.Height = 50;
	}

}

See Also