Solved

VS C# Vertical Scroll Bar

Posted on 2013-11-11
5
623 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
  • 3
  • 2
5 Comments
 
LVL 29

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 29

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

777 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