Solved

Remove Horizontal Scroll Bars from a datagrid

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

825 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