Solved

Remove Horizontal Scroll Bars from a datagrid

Posted on 2004-08-23
5
1,281 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

Technology Partners: 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

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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