CMA
CMA

Reputation: 2808

c# winforms: DataGridView scrollbar not showing

I am new to C# and Winforms..

I am having a problem with my scrollbar in DataGridView.

The vertical scrollbar image does not show, BUT you can scroll the grid using the using the mouse's scroll wheel.

What should be done to properly handle my scrollbar in DataGridView. I have read several solutions but none of them were able to solve this issue. All of my columns already have Frozen Property set to false, and I have set the AutoSizeMode of the problematic column to AllCells. But didn't worked..

Upvotes: 3

Views: 22703

Answers (3)

YAO
YAO

Reputation: 1

public partial class Form1: Form
{
  this.WindowState = FormWindowState.Minimized; // <<== if here have ......

  public Form1()
  {
    InitializeComponent();
  }
}

private void Fm_Shown(object sender, EventArgs e)
{
  this.WindowState = FormWindowState.Normal;<==than ScrollBars Noshowing
}

Upvotes: 0

Aimal
Aimal

Reputation: 21

I had the same problem, all columns should be set to frozen EXCEPT the first column of dataGridView, then the scroll bar will appear.

Upvotes: 0

Ahmed Ghoneim
Ahmed Ghoneim

Reputation: 7057

Simply,

myDataGridView.ScrollBars = ScrollBars.Both;

Upvotes: 1

Related Questions