Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Remove Horizontal Scroll Bars from a datagrid

Posted on 2004-08-23
5
Medium Priority
?
1,402 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 2000 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

618 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