Version

AfterSummaryDialogEventArgs Class

Event args associated with UltraGrid.AfterSummaryDialog event.
Syntax
'Declaration
 
Public Class AfterSummaryDialogEventArgs 
   Inherits System.EventArgs
public class AfterSummaryDialogEventArgs : System.EventArgs 
Example
Following sample code scrolls the summaries into view whenever the user selects a new summary using AfterSummaryDialog event.

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_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        ' Set AllowRowSummaries to allow the user to select summaries.
        Me.UltraGrid1.DisplayLayout.Override.AllowRowSummaries = AllowRowSummaries.True
    End Sub

    Private Sub UltraGrid1_AfterSummaryDialog(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.AfterSummaryDialogEventArgs) Handles UltraGrid1.AfterSummaryDialog

        ' SummariesChanged property indicates if the user modified any summaries.
        If e.SummariesChanged And 0 = e.Column.Band.Index Then

            ' Find out if the user cleared the summaries for the column.
            Dim summariesCleared As Boolean = True
            Dim summary As SummarySettings
            For Each summary In e.Column.Band.Summaries
                ' If there is a summary with the source column of the column the user 
                ' modified the summaries on then the user did not clear the summaries 
                ' for the column.
                If summary.SourceColumn Is e.Column Then
                    summariesCleared = False
                    Exit For
                End If
            Next

            ' At this point the user has selected a new summary. To make the summary area
            ' visible, we need to scroll the last visible row into view.
            If Not summariesCleared Then
                Dim lastVisibleRow As UltraGridRow = Me.UltraGrid1.Rows.GetRowAtVisibleIndex(Me.UltraGrid1.Rows.VisibleRowCount - 1)
                Me.UltraGrid1.ActiveRowScrollRegion.ScrollRowIntoView(lastVisibleRow)
            End If

        End If

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


		private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			// Set AllowRowSummaries to allow the user to select summaries.
			this.ultraGrid1.DisplayLayout.Override.AllowRowSummaries = AllowRowSummaries.True;
		}


		private void ultraGrid1_AfterSummaryDialog(object sender, Infragistics.Win.UltraWinGrid.AfterSummaryDialogEventArgs e)
		{
			// SummariesChanged property indicates if the user modified any summaries.
			if ( e.SummariesChanged && 0 == e.Column.Band.Index )
			{
				// Find out if the user cleared the summaries for the column.
				bool summariesCleared = true;
				foreach ( SummarySettings summary in e.Column.Band.Summaries )
				{
					// If there is a summary with the source column of the column the user 
					// modified the summaries on then the user did not clear the summaries 
					// for the column.
					if ( summary.SourceColumn == e.Column )
					{
						summariesCleared = false;
						break;
					}
				}

				// At this point the user has selected a new summary. To make the summary area
				// visible, we need to scroll the last visible row into view.
				if ( ! summariesCleared )
				{
					UltraGridRow lastVisibleRow = this.ultraGrid1.Rows.GetRowAtVisibleIndex( this.ultraGrid1.Rows.VisibleRowCount - 1 );
					this.ultraGrid1.ActiveRowScrollRegion.ScrollRowIntoView( lastVisibleRow );
				}
			}
		}
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