radgridview vertical scroll position / location

3 posts, 1 answers
  1. Chan
    Chan avatar
    14 posts
    Member since:
    Nov 2012

    Posted 04 Jun 2013 Link to this post

    Helo !

    In a grid(WinForms), by default, vertical scroll appears to the right side of grid and horizontal scroll appears to the bottom of grid.
    but I need to display vertical scroll to the left side of grid and horizontal scroll to the top of grid.

    For horizontal scroll, please specify some way to display the scroll at top of grid in following position with respect to grid :
    a.  just above column headers
    b.  just below column header
    c.  just above group descriptor(if group descriptor set to true)
    d.  in between group descriptor and column headers.
    I need to implement any one of these.

    For Vertical Scroll : to the left side of grid
    a. After RowHeaderColumn (if ShowRowHeaderColumn set to true)
    b. Before RowHeaderColumn (if ShowRowHeaderColumn set to true)
    c. Simply at the beginning from left(if ShowRowHeaderColumn set to false)


    thanks,

    Chan

  2. Answer
    Paul
    Admin
    Paul avatar
    60 posts

    Posted 06 Jun 2013 Link to this post

    Hello Chan,

    Thank you for writing.

    In order to change the positions of the scroll bars you have to override the ArrangeOverride method of the GridTableElement. To do that you have to inherit the same and also to inherit the TableViewDefinition.
    After that you can reposition the scroll bars as per your convenience as far as the design allows of course.

    I have attached a sample project showing how to position them on top and in front respectively.

    Hope that helps.

    Regards,
    Paul
    Telerik
    RadChart for WinForms is obsolete. Now what?
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Chan
    Chan avatar
    14 posts
    Member since:
    Nov 2012

    Posted 08 Jun 2013 Link to this post

    Helo Paul !

    A million thanks to you for this solution. I could never have reached to the code you wrote as solution of my problem.

    However, I, achieved by making the following changes to the grid :

    1. Setting the Vertical Scroll State of Grid View to Always Hide as, VerticalScrollState = "AlwaysHide"
    2. Setting the Minimum, Maximum, Margin properties values of VerticalScrollBar equal to the same property values of radGridView.TableElement.VScrollBar.
    private void SetRadVScrollbar()
          {
              //Set Vertical Scrollbar on radGridView1 Grid...
     
               this.radGridView1.VerticalScrollState = ScrollState.AlwaysHide;
                 
               radVScrollBar1.Minimum = this.radGridView1.TableElement.VScrollBar.Minimum;
               radVScrollBar1.Maximum = this.radGridView1.TableElement.VScrollBar.Maximum;
               radVScrollBar1.Margin = this.radGridView1.TableElement.VScrollBar.Margin;
          //  radVScrollBar1.Bounds = this.radGridView1.TableElement.VScrollBar.Bounds;
          //  radVScrollBar1.ThumbLength = this.radGridView1.TableElement.VScrollBar.ThumbLength;
     
              
          }

    I reverted back my code as you suggested and that worked perfectly. Now, I am feeling comfortable and safe.


    Thanks a lot for your support.

    Chan
Back to Top