Solved

Remove Horizontal Scroll Bars from a datagrid

Posted on 2004-08-23
5
1,309 Views
Last Modified: 2010-05-18
Hi

I would like to remove the horizontal scroll bar from a datgrid which has a datatable as its datasource (within a windows app - vb.net).  I have 9 columns in total but of these 9, 3 of there widths are set to 0 from within a tablestyle but the datagrid still insists on going to the full width of what it should be.

any help urgently would be greatly appreciated

thanks

matt
0
Comment
Question by:cafferm
[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
5 Comments
 

Expert Comment

by:sungs
ID: 11878281
If you used a derived DataGrid, you can access the HorizScrollBar by this.HorizScrollBar and do whatever you want to the bar.
0
 
LVL 10

Accepted Solution

by:
prakash_prk earned 500 total points
ID: 11878318
Try this code

 DataGrid1.Controls(0).Height = 0

regards
prakash
0
 

Author Comment

by:cafferm
ID: 11878334
Thanks

The DataGrid1.Controls(0).Height = 0 worked fine.  

I mustn't be using a dervied grid as i couldn't acess the horix bit.  thanks anyway

matt
0
 
LVL 10

Expert Comment

by:prakash_prk
ID: 11878566

Thank you cafferm

regards
Prakash
0
 

Expert Comment

by:lyptus
ID: 13423273
Hi,
I'm having the same problem the cafferm was having. prakash_prk solution worked great. However, if the user adjusts the columns to be wider the scroll bars don't show up. Is there any way around this.
0

Featured Post

Industry Leaders: 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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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