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

x
  • 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?
0
Neal Hartman
Asked:
Neal Hartman
  • 3
1 Solution
 
Bill_PSCCommented:
Do you have the datagrid on a panel or other type of container control?
0
 
Neal HartmanAuthor Commented:
Yes, it's on a Tabcontrol.
0
 
Bill_PSCCommented:
Are you disabling the Tabcontrol for any reason?
0
 
Bill_PSCCommented:
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.


http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=55293&SiteID=1
0

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