?
Solved

VS C# Vertical Scroll Bar

Posted on 2013-11-11
5
Medium Priority
?
632 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

762 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