We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to check whether Vertical Scroll Bar is visible or not ?

Hi,
I am using GGC and attached DataTable to it's DataSource. Iwant to check whether Vscroll baar get visible or not ? I used if (gridGroupingControl1.TableControl.VScroll) to get VScroll visible status but it returning false at load time after attaching DataSource and after GGC get displayed and then we tried to get VScroll Status in Resize event of GGC then it working fine. but i want the status of VScroll on load time after DataSource attached so that i can calculate exact client width of GGC for rendering columns.
Any solution to achieve this ?

3 Replies

KC Karuppasamy C Syncfusion Team January 2, 2014 11:58 AM UTC

Hi Shashi,

 

Thank you for using Syncfusion Products.

 

Query:

To find visibility of vertical scroll in GGC

 

We have analyzed your query at our end. We would like to suggest the property  VScrollVisible which is used to find visibility of vertical scroll in GGC.Please refer the below sample,

 

Sample Link:

 

http://www.syncfusion.com/uploads/user/directTrac/116859/CS1271737053.zip

 

After I gone through your query, I have found that you have to calculate client width of GGC.

Please make use AllowProportionalColumnSizing property in GGC which leads to achieve your requirement in simplest manner.

 

 

Please let me know if you have any concerns.

 

Regards,

Karuppasamy C.



SB Shashi Bhushan Kumar January 6, 2014 05:21 AM UTC

Hi Karuppasamy C  , thank u for reply.
The solution u have provided is working correct but i want Vertical Scroll Bar visible status at the form load after the attaching the dataSource of GGC. When i use
        this.gridGroupingControl1.TableControl.VScroll

to get visible status of VScroll then it always give False even GGC has VScroll.


KC Karuppasamy C Syncfusion Team January 10, 2014 09:48 AM UTC

Hi Shashi,

Thank you for your update.

If you want to catch the visibility of vertical or horizontal scroll bar . you can use the conditions below as you already know

Code 1:

 if (this.gridDataBoundGrid1.VScroll)
            {
// code
            }
          else if(this.gridDataBoundGrid1.HScroll)
            {
// code
            }

But before that you should enable or disable the any one of the scroll bars, based on these enable / disable conditions the above if loop conditions works. Here I have  enabled the  horizontal scroll and disabled the vertical scroll.therefore the  second  condition alone works.

Code 2:

this.gridDataBoundGrid1.VScrollBehavior =Syncfusion.Windows.Forms.Grid.GridScrollbarMode.Disabled;
this.gridDataBoundGrid1.HScrollBehavior = Syncfusion.Windows.Forms.Grid.GridScrollbarMode.Enabled;

Thanks & Regards,
Karuppasamy C.

Loader.
Live Chat Icon For mobile
Up arrow icon