Link to home
Start Free TrialLog in
Avatar of Endelm
Endelm

asked on

C# WinForms - Scroll in a DataGrid

Hi,

I'm displaying a lots of columns in a WinForms DataGrid control.

My columns are so many that they're all squashed up against each other.

The problem is that I can't seem to find some kind of property like a scrollbar or something. Isn't there a property on the DataGrid that enables a scrollbar?

Thank you.
Avatar of Endelm
Endelm

ASKER

My DataGrid control is:
System.Windows.Forms.DataGridView
Avatar of Endelm

ASKER

I'm talking about horizontal scrolling of the DataGridView control.
ASKER CERTIFIED SOLUTION
Avatar of REA_ANDREW
REA_ANDREW
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Endelm

ASKER

Thank you REA_ANDREW.

What property is the scroll bar changing?

Thank you.
Avatar of illusio
dataGridView1.ScrollBars = ScrollBars.Both;

Also handy:
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
AllCells is slow but other values are also possible.

Kind regards,
Peter