Solved

VS C# Vertical Scroll Bar

Posted on 2013-11-11
5
629 Views
Last Modified: 2013-11-12
I have a VS C# 2008 application with a form that contains a data grid view. Is there anyway to force the vertical scroll bar to always appear on the datagridview? The window is large enough for 20 records. If there are more than 20 records to display the vertical scroll bar appears but if there are less the scroll bar does not appear leaving an empty gray area where the scroll bar would be.
0
Comment
Question by:rwheeler23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 39640570
No, you cannot force scrollbars to show. However you may try to adjust column width to hide "grey area".

Some authors suggest using an external scroll bars but I'm not sure it worth efforts.

one more thing is to add "blank" lines to a data grid view but it is possible in some scenarios only...
0
 

Author Comment

by:rwheeler23
ID: 39640611
I would love to add blank lines so the grid is always full. I just have not been able to find any examples of how to do that. By having blank lines the scroll bar would always appear. If you could point me to some examples that would be great!
0
 
LVL 30

Accepted Solution

by:
anarki_jimbel earned 500 total points
ID: 39640642
0
 

Author Comment

by:rwheeler23
ID: 39643264
OK, please excude my ignorance but I am not getting this. I have attached my code. The maximum number of rows to display is 20. How do I adjust this code to only append whatever number of lines are necessary to fill the grid with 20 lines. For example, if the query return 5 rows, I need 15 blank rows. If the query returns 15 rows I need 5 blank rows. If the query returns more than 20 rows I need no blank rows.
DataGridRowFill.txt
0
 

Author Closing Comment

by:rwheeler23
ID: 39643532
You got me pointed in the correct direction. Thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 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