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

Specifies the vertical scrolling behavior in regard to how the UltraGrid scrolls rows. Default is ScrollToLastItem.

Syntax

Visual Basic (Declaration) 
Public Property ScrollBounds As ScrollBounds
C# 
public ScrollBounds ScrollBounds {get; set;}

Example

Following code sets the ScrollBounds and ScrollStyle properties to alter the default vertical scrolling behavior of the UltraGrid in two ways.

Visual BasicCopy Code
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 the ScrollStyle to immediate so that the UltraGrid scrolls the rows
        ' while the user drags the thumb. By default, UltraGrid displays a tooltip
        ' and scrolls the rows when the user releases the thumb.
        e.Layout.ScrollStyle = ScrollStyle.Immediate

        ' Se the ScrollBounds to ScrollToFill so that the UltraGrid stops scrolling
        ' once the last visible row is fully visible. By default UltraGrid will
        ' continue scrolling until only a single row is visible.
        e.Layout.ScrollBounds = ScrollBounds.ScrollToFill
    End Sub
C#Copy Code
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 the ScrollStyle to immediate so that the UltraGrid scrolls the rows
			// while the user drags the thumb. By default, UltraGrid displays a tooltip
			// and scrolls the rows when the user releases the thumb.
			e.Layout.ScrollStyle = ScrollStyle.Immediate;

			// Se the ScrollBounds to ScrollToFill so that the UltraGrid stops scrolling
			// once the last visible row is fully visible. By default UltraGrid will
			// continue scrolling until only a single row is visible.
			e.Layout.ScrollBounds = ScrollBounds.ScrollToFill;
		}

Remarks

Setting ScrollBounds to ScrollToFill will disallow the user from scrolling further down once the last row becomes visible. While setting it to ScrollToLastItem will allow the user to continue scrolling until last row is the only visible row in the row scroll region.

See Also