Solved

VS C# Vertical Scroll Bar

Posted on 2013-11-11
5
618 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
Comment Utility
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
Comment Utility
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
Comment Utility
0
 

Author Comment

by:rwheeler23
Comment Utility
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
Comment Utility
You got me pointed in the correct direction. Thanks
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now