shared scroll bars
Hi there,
I''m working on a form that has 2 virtual grids setup. The data are related and lined up in columns. I want them both to scroll together.
How do I link up an independent scrollbar to my 2 GridControls and then make their original scrollbars invisible? Or is there another way of doing this?
Thanks for any pointers.
SIGN IN To post a reply.
6 Replies
AD
Administrator
Syncfusion Team
November 9, 2005 08:34 AM UTC
Hi ,
Please try this code and let me know if you need any other further assistance.
//shares gridcontrol1scrollbars
gridControl1.HScrollBehavior = GridScrollbarMode.Shared;
gridControl1.VScrollBehavior = GridScrollbarMode.Shared;
gridControl1.UseSharedScrollBars = true;
gridControl1.VScrollBar.InnerScrollBar = vScrollBar1;
gridControl1.HScrollBar.InnerScrollBar = hScrollBar1;
//shares gridcontrol2scrollbars
gridControl2.HScrollBehavior = GridScrollbarMode.Shared;
gridControl2.VScrollBehavior = GridScrollbarMode.Shared;
gridControl2.UseSharedScrollBars = true;
gridControl2.VScrollBar.InnerScrollBar = vScrollBar1;
gridControl2.HScrollBar.InnerScrollBar = hScrollBar1;
Here is a sample for implementing it.
36722forum.zip
Regards,
Haneef
AD
Administrator
Syncfusion Team
November 9, 2005 05:22 PM UTC
Did exactly what I needed it to, thanks so much for your help!
>Hi ,
> Please try this code and let me know if you need any other further assistance.
>
> //shares gridcontrol1scrollbars
> gridControl1.HScrollBehavior = GridScrollbarMode.Shared;
> gridControl1.VScrollBehavior = GridScrollbarMode.Shared;
> gridControl1.UseSharedScrollBars = true;
> gridControl1.VScrollBar.InnerScrollBar = vScrollBar1;
> gridControl1.HScrollBar.InnerScrollBar = hScrollBar1;
>
> //shares gridcontrol2scrollbars
> gridControl2.HScrollBehavior = GridScrollbarMode.Shared;
> gridControl2.VScrollBehavior = GridScrollbarMode.Shared;
> gridControl2.UseSharedScrollBars = true;
> gridControl2.VScrollBar.InnerScrollBar = vScrollBar1;
> gridControl2.HScrollBar.InnerScrollBar = hScrollBar1;
>
>
>Here is a sample for implementing it.
>36722forum.zip
>
>Regards,
>Haneef
>
>
>
>
>
ST
Stephen
December 6, 2005 06:42 PM UTC
Hi, how would I just share the horizontal scrollbar and keep the vertical scrollbars independent? Thanks.
>Hi ,
> Please try this code and let me know if you need any other further assistance.
>
> //shares gridcontrol1scrollbars
> gridControl1.HScrollBehavior = GridScrollbarMode.Shared;
> gridControl1.VScrollBehavior = GridScrollbarMode.Shared;
> gridControl1.UseSharedScrollBars = true;
> gridControl1.VScrollBar.InnerScrollBar = vScrollBar1;
> gridControl1.HScrollBar.InnerScrollBar = hScrollBar1;
>
> //shares gridcontrol2scrollbars
> gridControl2.HScrollBehavior = GridScrollbarMode.Shared;
> gridControl2.VScrollBehavior = GridScrollbarMode.Shared;
> gridControl2.UseSharedScrollBars = true;
> gridControl2.VScrollBar.InnerScrollBar = vScrollBar1;
> gridControl2.HScrollBar.InnerScrollBar = hScrollBar1;
>
>
>Here is a sample for implementing it.
>36722forum.zip
>
>Regards,
>Haneef
>
>
>
>
>
ST
stanleyj
Syncfusion Team
December 7, 2005 05:06 AM UTC
Hi Stephen,
You can try out with different VScrollBars for different grids. Here is the modified sample.
Best regards,
Stanley
ST
Stephen
December 17, 2005 12:31 AM UTC
Hi, is there a way to make the scrollbars XP style? Thanks.
>Hi Stephen,
>
>You can try out with different VScrollBars for different grids. Here is the modified sample.
>
>Best regards,
>Stanley
AD
Administrator
Syncfusion Team
December 17, 2005 10:10 AM UTC
If you are using .NET 1.1 or 2.0, then in your Main, you can enable themes for Windows Forms controls that support them (including scrollbars).
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}
SIGN IN To post a reply.
- 6 Replies
- 4 Participants
-
JT Jason Talaban
- Nov 8, 2005 11:48 PM UTC
- Dec 17, 2005 10:10 AM UTC