472,096 Members | 1,288 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

problem sizing a DataGridView


..NET 2.0

I've created a User Control which contain a DataGridView. This User Control
is displayed on a TabPage. This TabPage is added to the TabControl during

The problem is this:
Lets say if I set the size on the DataGridView to width=400px &
height=300px. But during runtime the DataGridView fills the User Control so
that the right & button edges disappear under the User Control GUI. But it
should be a big gap, but the edge disappear and no gap is displayed between
DataGridView and User Control.

DataGridView.x = 10; (position on the User Control)
DataGridView.y = 10;
DataGridView.width = 100;
DataGridView.height = 100;
User Control.width = 300
User Control.height=300

Then the DataGridView will fill the entire User Control from x/y=10px and
width/height=300px. It should have been width/height=100px

There are no sizing problem if I in visual studio add the tabpage with the
user control. So I think this problem is related to TabPages being added
during runtime.

any suggestions?
Oct 15 '07 #1
1 2377
Solved, the error was because I hadn't set a size on the tabpage.
Oct 15 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Olav Tollefsen | last post: by
1 post views Thread by sapkal.manish | last post: by
6 posts views Thread by George | last post: by
reply views Thread by anthony.gilliam | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.