Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2003

Tip: Looking for answers? Try searching our database.

DataGrid Slider Bar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JT - 09 Sep 2003 21:41 GMT
Is there a way to hide the horizontal slider bar that
appears at the bottom of a datagrid?  I have set
navigation to false, but all this did was disable the
slider, not hide it.
Thanks.
JT
Alen Oblak - 09 Sep 2003 23:15 GMT
Resize or hide the columns with styles collection so there is no need of
showing the slider bar.

> Is there a way to hide the horizontal slider bar that
> appears at the bottom of a datagrid?  I have set
> navigation to false, but all this did was disable the
> slider, not hide it.
> Thanks.
> JT
Ying-Shen Yu[MS] - 10 Sep 2003 13:06 GMT
Hi JT,
The  datagrid control will show/hide the scrollbar automaticlly on the
width of your data columns.
and this is the default behaviour of datagrid, so it's not easy to change
it.
And I'm wondering why you want to hide the horizontal scrollbar of the
datagrid?
Maybe we can try other ways to let the scrollbar not shown.

Thanks!

Kind regards,

Ying-Shen Yu [MS]
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.  2001 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message
| From: "JT" <JTnospam@verizon.net>
[quoted text clipped - 13 lines]
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:51976
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
[quoted text clipped - 5 lines]
| Thanks.
| JT
JT - 10 Sep 2003 16:01 GMT
Thanks to you both.  My datagrid is a little unusual in
that it clears the tablestyle of the designer datagrid and
adds a custom table style on form load.  The custom table
style has a width LESS than the 'container' designer
grid.  Nevertheless, the slider appears.  If I slightly
tweak the width of any of the datacolumns once the form is
loaded, the slider disappears and does not return.  Any
further advice would be appreciated.  The reason that I
want to hide this slider is mostly for aesthetics, but
also because it is unnecessary.
JT
>-----Original Message-----
>Hi JT,
[quoted text clipped - 46 lines]
>
>.
Ying-Shen Yu[MS] - 11 Sep 2003 04:22 GMT
Hi JT,
    Thanks for your detail description, My understanding of your problem
is, your  width of the columns is just as same as or a little less than the
width of the DataGrid, then the DataGrid shows the horizontal scrollbar
automatically.
    As far as I know, We have little way to hide the scrollbar. However,
we can adjust the width of your columns
and leave two grid units for the vertical scrollbar. or you may also
enlarge your datagrid width by two grid units(this way maybe simpler but
depends on your UI Design). And If your data lings are not long enough to
show the vertical scroll bar  you will find the empty space beside the
right column. I think you can change columnwidth of the right column after
filling the dataset by checking if there is an vertical scrollbar ( you can
use GetChildAtPoint method to check a fix point, or check this by the row
count).

Thanks, If you have any questions on this issue, please let me know!

   

Best regards,

Ying-Shen Yu [MS]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "JT" <JTnospam@verizon.net>
| Sender: "JT" <JTnospam@verizon.net>
| References: <05ed01c37712$cfdfe760$a101280a@phx.gbl>
<6flyDQ5dDHA.2080@cpmsftngxa06.phx.gbl>
| Subject: RE: DataGrid Slider Bar
| Date: Wed, 10 Sep 2003 08:01:38 -0700
[quoted text clipped - 10 lines]
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:52046
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
[quoted text clipped - 68 lines]
| >
| >.
Scot Rose [MSFT] - 11 Sep 2003 14:57 GMT
A little trick I discovered is this... Add a Command button in your form and place the following line of code in the event

DataGrid1.Controls(0).Height = 0

Control 0 is the HScrollBar. You can't set its visible property to false. However IF you set the Height of the scrollbar to 0 then it pretty much has the same effect as it not being there...

You will have to try this code in some different events, and anytime the grid is reinitalized teh height will be reset to default, so you will have to put the code where it will do the most
good (Perhaps a paint event?)

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : scotr@online.microsoft.com  <Remove word online. from address>

This posting is provided ?AS IS?, with no warranties, and confers no rights.

--------------------
>Content-Class: urn:content-classes:message
>From: "JT" <JTnospam@verizon.net>
[quoted text clipped - 86 lines]
>>
>>.
JT - 11 Sep 2003 18:59 GMT
Thank you both.  Setting the control height to zero as I
configure my datagrid at runtime did the trick
beautifully.  Thanks again.
JT
>-----Original Message-----
>A little trick I discovered is this... Add a Command button in your form and place the following line of code
in the event

>DataGrid1.Controls(0).Height = 0
>
>Control 0 is the HScrollBar. You can't set its visible property to false. However IF you set the Height of the
scrollbar to 0 then it pretty much has the same effect as
it not being there...

>You will have to try this code in some different events, and anytime the grid is reinitalized teh height will be
reset to default, so you will have to put the code where
it will do the most
>good (Perhaps a paint event?)
>
[quoted text clipped - 3 lines]
>
>This posting is provided "AS IS", with no warranties,
and confers no rights.

>--------------------
>>Content-Class: urn:content-classes:message
[quoted text clipped - 89 lines]
>
>.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.