Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am Using DataGridView In an Windows Application.
I made an UserControl for Datagridview.
In this Control Only Vertical Scrollbar is Allowed.

The Vertical Scrollbar is Visible.
But when RowCount Varies, an Empty Space is Visible at the bottom part of the Datagridview.
That Empty Space (Area) is of UserControl.
When I it drag to Form , It Runs Properly.
But the Problem is in Vertical Scrollbar.
How Can I remove this Empty Space, So that I can Scroll Till List Row Of the DatagridView only.

Kindly Reply,



Regards
Lakshman
Posted
Comments
Henry Minute 23-Nov-10 13:52pm    
Just checking, in case you've missed it. You are aware that the DataGridView has a ScrollBars property, which can be set to a value that only allows the vertical scrollbar? :)
Lakshmancb 23-Nov-10 23:15pm    
Ya I Have Already Set the Same Property.
The Empty Sapce is of UserControl.
Actually, Over the UserControl I have droppeddown a DataGridView.
Sunasara Imdadhusen 23-Nov-10 23:46pm    
Please send snippet of code!

remove add row capabilities on datagridview
 
Share this answer
 
Change AutoSizeColumnsMode to Fill
 
Share this answer
 
In addition to the suggestion given in Solution 2 by Member 8810143, as it is mentioned in the question that the empty space of user control is visible, set Dock property of DataGridView in the usercontrol to DockStyle.Fill
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900