Scrollbar Integration????????

4 posts, 0 answers
  1. Web
    Web avatar
    88 posts
    Member since:
    Nov 2006

    Posted 27 Feb 2007 Link to this post

    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.

  2. Angel
    Angel avatar
    121 posts

    Posted 28 Feb 2007 Link to this post

    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,
    the telerik team
  3. John Hutchison
    John Hutchison avatar
    15 posts
    Member since:
    Aug 2005

    Posted 14 Mar 2007 Link to this post

    "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.
  4. Chris
    Chris avatar
    221 posts

    Posted 15 Mar 2007 Link to this post

    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,
    the telerik team
Back to Top