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]
>
>.