[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 687
  • Last Modified:

Datagrid scrollbars

I seem to be missing something. I create as dataset, then the dataview and set the datagrid to the dataview. Why are the scrollbars grayed out and useless?
Neal Hartman
Neal Hartman
  • 3
1 Solution
Do you have the datagrid on a panel or other type of container control?
Neal HartmanAuthor Commented:
Yes, it's on a Tabcontrol.
Are you disabling the Tabcontrol for any reason?
I found an answer for you;

Right after binding the data to the datagrid re-enable the scrollbar. If you have a large datatable you'll find that both vertical and horizontal scrollbars are visible but disabled. Do this in the following manner:

datagrid.Controls[0].Enabled = true; // Index zero is the horizontal scrollbar
datagrid.Controls[1].Enabled = true; // Index one is the vertical scrollbar

...but make sure you do the above *after* applying any RowFilter criteria to the underlying DataView you are binding to, ...

...or the Scrollbars get disabled again.


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now