Ultragrid Scrolling- Disable Scrolling in UltraWinGrid


ultragrid, ultragrid control

Introduction


o disable scrolling in an Infragistics UltraWinGrid (UltraGrid), you can control both vertical and horizontal scrolling behavior using its properties.

Here’s how to disable scrolling entirely

Description


// Disable vertical and horizontal scrolling
ugReports.DisplayLayout.Scrollbars = Scrollbars.None;

This will:

  • Prevent both vertical and horizontal scrollbars from appearing.
  • Effectively disable scrolling behavior.

 

🧩 Alternative: Lock Scrolling Direction

If you want to allow only one direction (e.g., vertical only), you can use:

 

// Allow only vertical scrolling ugReports.DisplayLayout.Scrollbars = Scrollbars.Vertical; // Or only horizontal ugReports.DisplayLayout.Scrollbars = Scrollbars.Horizontal;

 

 

🛑 Prevent Scroll Wheel Scrolling (Optional)

If you want to block mouse wheel scrolling as well:

private void ugReports_MouseWheel(object sender, MouseEventArgs e) { ((HandledMouseEventArgs)e).Handled = true; }

And register the event:

ugReports.MouseWheel += ugReports_MouseWheel;

 

// Allow only vertical scrolling
ugReports.DisplayLayout.Scrollbars = Scrollbars.Vertical;
 
// Or only horizontal
ugReports.DisplayLayout.Scrollbars = Scrollbars.Horizontal;
private void ugReports_MouseWheel(object sender, MouseEventArgs e)
{
    ((HandledMouseEventArgs)e).Handled = true;
}