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

Scroll event

In my application, i have a GridControl and a GridDataBoundGrid, both have the same size and are on the same panel, and i had the scrolls of the GridControl invisible.

I wanted to make an event that, when user moved the scrolls of the GridDataBoundGrid, the invisible scrolls of the GridControl moved the same way in the same time.

Is that possible???


11 Replies

SR SubhaSheela R Syncfusion Team February 6, 2008 12:59 PM UTC

Hi Daniel,

Thank you for using Syncfusion products.

You can set the scroll bars of GridDataBoundGrid to share with the GridControl by setting true to UseSharedScrollBars property which enables the shared scroll bar. After setting this, you can make the mode of the horizontal and vertical scroll bar behaviour as shared by setting Shared to GridScrollbarMode property. Finally, you can set the reference of GridDataBoundGrid to the reference of GridControl using InnerScrollBar property of HScrollBar and VScrollBar respectively. Below is the code snippet:

gridControl1.HScrollBehavior = GridScrollbarMode.Shared;
gridControl1.VScrollBehavior = GridScrollbarMode.Shared;
this.gridControl1.UseSharedScrollBars = true;
this.gridControl1.HScrollBar.InnerScrollBar = this.gridDataBoundGrid1.HScrollBar.InnerScrollBar;
this.gridControl1.VScrollBar.InnerScrollBar = this.gridDataBoundGrid1.VScrollBar.InnerScrollBar;


Please refer the sample available in the link below and let me know if it helps:

http://websamples.syncfusion.com//samples/Grid.Windows/F71464/main.htm

Regards,
Subhasheela R




DS Daniel Santos de Carvalho February 7, 2008 01:03 PM UTC

Yes, that was exactly what a wanted and worked very well.

But i still have a little problem, when i press the scrollbar to the left, it scrolls the grids one column to the left, but i have more columns in the GridDataBoundGrid than the number of columns in GridControl, and it makes the GridControl reach the end of the scrollbar first than the GridDataBoundGrid (even though they have the same size).

There is any way to scrolls the grids not by columns but by pixels???




SR SubhaSheela R Syncfusion Team February 8, 2008 04:11 AM UTC

Hi Daniel,

You can set HScrollPixel and VScrollPixel property of GridControl and GridDataBoundGrid control to true which enables the grid and gridataboundgrid table to scroll by pixel.
Below is the code snippet:

this.gridControl1.UseSharedScrollBars = true;
this.gridControl1.HScrollPixel = true;
this.gridControl1.VScrollPixel = true;
this.gridDataBoundGrid1.HScrollPixel = true;
this.gridDataBoundGrid1.VScrollPixel = true;


Regards,
Subhasheela R




DS Daniel Santos de Carvalho February 8, 2008 02:44 PM UTC

Thats great, it almost perfect for me. And work very well.

But now when i maximize the screen, the grid fill the panels they are in, and the scrolls disappear because the grids fill in completely, but when i turn the screen to normal size, and the scrolls reappear in the GridDataBoundGrid, and it don't work right, it is no longer bounded with the GridControl anymore.

How can i make for the property to bound both grids to work again???



SR SubhaSheela R Syncfusion Team February 9, 2008 09:26 AM UTC


Hi Daniel,

Thank you for using Syncfusion products.

I am not able to reproduce the issue of scroll bar disappearing while maximizing the form. I have set the Dock property to Fill for Panel control, but the scroll bars for GridDataBoundGrid appears and works when maximizing as well as minimizing it. Could you please modify the previous sample to reproduce the issue, so that I could provide you the exact solution? Or please send us your sample with issue, we will analyze it and provide you the details.

Please refer the video clip file available in the link below:

F71464FollowUpVideoFile.zip

Regards,
Subhasheela R




DS Daniel Santos de Carvalho February 11, 2008 12:46 PM UTC

Hi Subhasheela,

I changed the example you send me to try to explain my situation. I use both grid in differents panel and i fill the panels with them using the dock property.

In this modified example, if you maximize the screen, you will see that the horizontal scroll will disappear and the vertical scroll will not. When i turn the screen back to normal size again, the vertical scroll will still be working fine, but the horizontal scroll (that reappeared) will not work as before.

Can you help me to deal with this problem?

Ps: the version of the syncfusion i'm using is 4.1.0.50



GridScrollBar2.zip


SR SubhaSheela R Syncfusion Team February 12, 2008 08:40 AM UTC

Hi Daniel,

Thank you for using Syncfusion products.

You could set more number of columns in the GridDataBoundGrid Control before maximizing the form, so that you can view and work with the horizontal scroll bar for both the controls while maximizing as well as minimizing the form.

Please refer to the sample available in the link below and let me know if it helps:

http://websamples.syncfusion.com/samples/Grid.Windows/F71464FollowUp1/main.htm

Regards,
Subhasheela R



DS Daniel Santos de Carvalho February 12, 2008 08:19 PM UTC

Hi!!!

In my project, i can't change the number of cols in the grids. There is anyway to adjust the scrolls properties when the screen resize??? Or any way to make the scrolls never dissapear of the grid???



SR SubhaSheela R Syncfusion Team February 14, 2008 11:45 AM UTC


Hi Daniel,

Thank you for using Syncfusion products.

You can increase the default column width size by using DefaultColWidth property of GridDataBoundGrid Control after setting false to AllowResizeToFit property, so that scroll bars are visible and works well when maximizing as well as minimizing the form. Otherwise, we cannot force the scrollbars to visible in the form when maximizing it. Below is the code snippet:

this.gridDataBoundGrid1.DefaultColWidth = 500;


Please let me know if you have any questions.

Regards,
Subhasheela R




DS Daniel Santos de Carvalho February 15, 2008 11:29 AM UTC

Ok Subhasheela, i will modify my project a little bit to make that.

Thanks a lot for all your help!



SR SubhaSheela R Syncfusion Team February 15, 2008 11:40 AM UTC

Hi Daniel,

Thanks for your update. Please feel free to contact us if you have any other queries.

Regards,
Subhasheela R


Loader.
Live Chat Icon For mobile
Up arrow icon