datagridview on a splitcontainer on a form

P

Peted

Hello,

Ive got a datagridview, on a splitcontainer, in a
system.windows.forms.usercontrol.

The datagrid view by default shows 3 colums of data and fills exactly
the size of the user control form.

This control is then called from another c# solution, and it displays
fine when called and shown.

My problem is that at some point a user has the option to display more
colums of data in the datagridview, and this causes the horizotal
scroll bard to appear and the columns are now off the edge of the
window and you need to scroll back and forwards to see it.

What i want is a way to make the parent usercontrol and form
autoresize wider when more columns are displayed in the datagrid view.
I then want the user control to auto shrink when the number of
displayed columns is reduced. In short i want the host usercontrol
/form to auto resize up and down to fit around the new size of the
displayed datagridview.

I have tried all the anchor/dock fill, auto resize options,
eliminating the horizontal scroll bar, but the hosting form never
resizes, the datagridview columns always disappear of the edge of the
window.

I am using vs 2005 c#, if anyone can help please or point me in the
right direction

thanks

Peted
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top