Yes, it is set, actually if i add let's say 50 columns to DGV0 the scrollbar appears and scrolls. But not the dynamically created DataGridViews, it only scrolls its own columns although the DGV's are all in the DGV0.
Main Topics
Browse All TopicsHi,
I have spent a full work-day to solve this but i was not able to.
Here is my problem:
I use VS 2008 with .NET 3.0 FW and code in VB.Net (Desktop App).
I create a Datagridview(DGV0) in design time then for every customer in db; i create a datagridview("DGV" & CustID) in runtime and add to DGV0 (See the code)
All positioning and styling are done correctly, i have no problem displaying the data the way i want in DataGridView with multiple DataGridViews added to it.
But the problem is there are a total of 17 DataGridViews created (Customer count) and will probably increase as the program is used.
Every datagridview is being added horizontally just next to the datagirdview before itself.
So, the user wants to scroll right (horizontally) to see other Customer details (other datagridviews). But there is not scroll bar created in the main DataGridView (DGV0).
I tried many solutions, none of them work. My idea is to create a HScrollBar control and add to DGV0.
I will appreciate if anyone is able to help.
Thanks.
1.44mb
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Yes, CodeCruiser, it did not work either. The problem is, these controls do not cause a scroll bar. Because, in my opinion, they are not columns, i think if the width of the columns exceed the width of the dgv, then dgv's hscrollbar appears. So these are controls and they do not cause dgv to draw a hscrollbar, even if they did, it doesn't scroll through controls.
I think what i ask is beyond the capabilities of DGV. So i came up with a solution like this.
Dim DGContainer as New Panel
for i=1 to CustomerCount
DGContainer.Controls.Add("
next
After all the DGVs are added in the new panel.
I add the panel to the main DGV.
DGV0.Controls.Add(DGContai
and set the AutoScroll property of Panel to True.
And make the Panel backcolor same as DGV0.
So i get what i want, Panel creates scrollbars and scrolls through controls. The panel is inside DGV and the user doesn't understand this. It all seems like just one DGV with spaces and borders between columns. Just like i want.
So i solved my problem, but i will leave the question open because this particular problem is not solved yet. Any help will be appreciated and maybe some other users can find this topic when they need such an assistance.
Thanks.
Business Accounts
Answer for Membership
by: roma2208Posted on 2009-11-04 at 04:08:48ID: 25738488
Have you set the scrollbar property of gridview to both ?? h
Datagridview.scrollbar=bot