Solved

Datagrid scrollbars

Posted on 2006-07-10
4
679 Views
Last Modified: 2008-02-26
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
Comment
Question by:Neal Hartman
  • 3
4 Comments
 
LVL 2

Expert Comment

by:Bill_PSC
ID: 17072519
Do you have the datagrid on a panel or other type of container control?
0
 
LVL 1

Author Comment

by:Neal Hartman
ID: 17072543
Yes, it's on a Tabcontrol.
0
 
LVL 2

Expert Comment

by:Bill_PSC
ID: 17072602
Are you disabling the Tabcontrol for any reason?
0
 
LVL 2

Accepted Solution

by:
Bill_PSC earned 500 total points
ID: 17072643
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question