This is a migrated thread and some comments may be shown as answers.

Scrollbar Integration????????

3 Answers 169 Views
ScrollBar
This is a migrated thread and some comments may be shown as answers.
Web
Top achievements
Rank 1
Web asked on 27 Feb 2007, 04:05 PM
I am intersted how the scrollbars actually are getting integrated in the windows forms. unfortunately i cn not see an example or further description anywhere and this : The telerik r.a.d.hscrollbar and r.a.d.vscrollbar controls are themeable alternatives to the standard Windows Forms scroll bar controls. They allow you to include scroll bars in your applications that are consistent in look and feel with the other telerik r.a.d.controls.

does not tell me anything. so is there a way where you could make a project where you integrate the scrollbar in a for example datagridview.
that would be great and i am sure there are a lot more people out there who would appreciate it. i am developing in visual 2005 language does not matter.

thanks

3 Answers, 1 is accepted

Sort by
0
Angel
Telerik team
answered on 28 Feb 2007, 10:12 AM
Hi kerstin,

The telerik r.a.d.hscrollbar and r.a.d.vscrollbar controls are just like Microsoft's HScrollBar and VScrollBar. These controls are independent from complicated controls like DataGridView (which already contains HScrollBar and VScrollBar).
 
To replace the default scroll controls in DataGridView (or any other control), the grid must offer such capability. A small research reveals that DataGridView does not support this feature. It does not support even scrolling via API so the only way to scroll the content is to show the grid's default scroll bars and to use them.

Again, our controls are just like Microsoft's HScrollBar and VScrollBar, as noted in the description.
 
 
 
Sincerely yours,
Angel
the telerik team
0
John Hutchison
Top achievements
Rank 1
answered on 14 Mar 2007, 10:59 PM
"It does not support even scrolling via API so the only way to scroll the content is to show the grid's default scroll bars and to use them."

    FYI - You can actually use the FirstDisplayedScrollingRowIndex property of a datagridview to programmatically scroll a datagridview.
You can also set the horizontalscrollingoffset I believe and scroll horizontally by pixel...however the verticalscrollingoffset is readonly and cannot be set - so there appears no easy way to scroll by pixel vertically.
0
Chris
Telerik team
answered on 15 Mar 2007, 11:41 AM
Hi John,

First, thanks for the additional information. I'll try to explain in detail what could be the problems when attaching the radScrollBars to the DataGridView control.
Firstly you'll need to set for each ScrollBar at least these properties: Maximum, Minimum and LargeChange. Also you have to locate and size the scrollbars correctly.
Then you need to write code to affect the scrollbars when the visible size of the DataGridView has changed or when the number of rows / columns has changed. In addition there are problems with the client rectangle of the DataGridView which is calculated automatically when property ScrollBars is different than None. But in this case when we have external scrollbars it must be None or otherwise you'll see 2 pairs of scrollbars.

Nevertheless we have attached a sample application which demonstrates how you could make the DataGridView use the radScrollBars. Still there're some problems which we couldn't overcome with the current version of the DataGridView control (mainly these problems are related to synchronization):
  • The scrollbars are actually over the content of the grid - they do not affect the ClientRectangle of the grid.
  • The scrollbars don't synchronize with the current size and content of the grid (the height of the vertical scrollbar, the thumb sizes for both scrollbars, the maximum values, page scrolling, etc.)
  • The scrollbars are not affected when the grid is scrolled with the keyboard.
  • The gird cannot be scrolled with the mouse wheel anymore.
Anyway I hope this information and the sample project bring additional light to this use case.

All the best,
Chris
the telerik team
Tags
ScrollBar
Asked by
Web
Top achievements
Rank 1
Answers by
Angel
Telerik team
John Hutchison
Top achievements
Rank 1
Chris
Telerik team
Share this question
or