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

Controls how vertical row scrolling is done in the grid.

Syntax

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

Example

Following code sets some of the scrolling related properties.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
        ' Set the scroll style to Imeediate so the UltraGrid scrolls the rows immediately
        ' as soon as the user drags the thumb rather than waiting untill the scroll thumb is
        ' released.
        Me.UltraGrid1.DisplayLayout.ScrollStyle = ScrollStyle.Immediate

        ' Scrollbars indicates which of the vertical and horizontal scrollbar if any
        ' gets shown and how.
        Me.UltraGrid1.DisplayLayout.Scrollbars = Scrollbars.Both

        ' Set the ColumnScrollbarSmallChange to 100 to specify that the grid scroll 100
        ' pixels when the left or right arrows of the horizontal scroll bar is clicked.
        Me.UltraGrid1.DisplayLayout.ColumnScrollbarSmallChange = 100

        ' By default the UltraGrid uses ScrollWindow calls to scroll the control whenever
        ' up/down or left/right arrows of the scrollbars are clicked. This results in
        ' better scrolling performace however there might be instances, for example if
        ' you had a ui element creation filter or a draw filter, that required the grid
        ' to repaint the whole grid instead of using ScrollWindow, then set this property
        ' to None.
        Me.UltraGrid1.DisplayLayout.UseScrollWindow = UseScrollWindow.None

        ' Fixed headers functionality can be turned on to prevent the grid from scrolling
        ' the row selectors when scrolled horizontally. Look at UseFixedHeaders property
        ' for more info.
        Me.UltraGrid1.DisplayLayout.UseFixedHeaders = True

        ' Set verious scrollbar related properties using ScrollBarLook object returned
        ' by ScrollBarLook property.
        Me.UltraGrid1.DisplayLayout.ScrollBarLook.MinMaxButtonsVisible = True

        ' Set the style of the scroll bar arrows.
        Me.UltraGrid1.DisplayLayout.ScrollBarLook.ScrollBarArrowStyle = _
                     Infragistics.Win.UltraWinScrollBar.ScrollBarArrowStyle.BothAtRightBottom

        ' Set appearances for various ui elements of the scroll bar.
        Me.UltraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackColor = Color.Silver
        Me.UltraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackColor2 = Color.SkyBlue
        Me.UltraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackGradientStyle = GradientStyle.Vertical

        Me.UltraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.BackColor = Color.Blue
        Me.UltraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.ForeColor = Color.LightYellow

        ' When true, scroll notifications as a result of a scroll arrow or scroll track click 
        ' will occur synchronously thus giving scrolling higher priority when cpu intensive
        ' tasks are being performed.
        Me.UltraGrid1.DisplayLayout.PriorityScrolling = True
    End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

		private void button1_Click(object sender, System.EventArgs e)
		{
			// Set the scroll style to Imeediate so the UltraGrid scrolls the rows immediately
			// as soon as the user drags the thumb rather than waiting untill the scroll thumb is
			// released.
			this.ultraGrid1.DisplayLayout.ScrollStyle = ScrollStyle.Immediate;

			// Scrollbars indicates which of the vertical and horizontal scrollbar if any
			// gets shown and how.
			this.ultraGrid1.DisplayLayout.Scrollbars = Scrollbars.Both;

			// Set the ColumnScrollbarSmallChange to 100 to specify that the grid scroll 100
			// pixels when the left or right arrows of the horizontal scroll bar is clicked.
			this.ultraGrid1.DisplayLayout.ColumnScrollbarSmallChange = 100;

			// By default the UltraGrid uses ScrollWindow calls to scroll the control whenever
			// up/down or left/right arrows of the scrollbars are clicked. This results in
			// better scrolling performace however there might be instances, for example if
			// you had a ui element creation filter or a draw filter, that required the grid
			// to repaint the whole grid instead of using ScrollWindow, then set this property
			// to None.
			this.ultraGrid1.DisplayLayout.UseScrollWindow = UseScrollWindow.None;

			// Fixed headers functionality can be turned on to prevent the grid from scrolling
			// the row selectors when scrolled horizontally. Look at UseFixedHeaders property
			// for more info.
			this.ultraGrid1.DisplayLayout.UseFixedHeaders = true;

			// Set verious scrollbar related properties using ScrollBarLook object returned
			// by ScrollBarLook property.
			this.ultraGrid1.DisplayLayout.ScrollBarLook.MinMaxButtonsVisible = true;

			// Set the style of the scroll bar arrows.
			this.ultraGrid1.DisplayLayout.ScrollBarLook.ScrollBarArrowStyle = 
				Infragistics.Win.UltraWinScrollBar.ScrollBarArrowStyle.BothAtRightBottom;

			// Set appearances for various ui elements of the scroll bar.
			this.ultraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackColor = Color.Silver;
			this.ultraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackColor2 = Color.SkyBlue;
			this.ultraGrid1.DisplayLayout.ScrollBarLook.Appearance.BackGradientStyle = GradientStyle.Vertical;
						
			this.ultraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.BackColor = Color.Blue;
			this.ultraGrid1.DisplayLayout.ScrollBarLook.ButtonAppearance.ForeColor = Color.LightYellow;

			// When true, scroll notifications as a result of a scroll arrow or scroll track click 
			// will occur synchronously thus giving scrolling higher priority when cpu intensive
			// tasks are being performed.
			this.ultraGrid1.DisplayLayout.PriorityScrolling = true;
		}

Remarks

See Also