Datagrid vertical scrolling

Posted by: milosic.bogdan on 17 November 2021, 5:54 am EST

  • Posted 17 November 2021, 5:54 am EST

    Hi, is there possibility for manual vertical scrolling on request (button click or key down).

    I have c1:datagrid with many columns and i want to move croller position on request, when user click on button, then move scroller position for some points (or cells) to right.

    Any idea

  • Posted 18 November 2021, 4:34 am EST

    Hi Bogdan,

    In order to programmatically scroll C1DataGrid horizontally/vertically, you can use C1DataGrid’s ScrollToVerticalOffset/ScrollToHorizontalOffset methods as follows:

    
     private void Button_Click(object sender, RoutedEventArgs e)
        {
            counterVertical += 5;
            _grid.Viewport.ScrollToVerticalOffset(counterVertical * _grid.RowHeight.Value);
        }
    
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            counterHorizontal += 5;
            _grid.Viewport.ScrollToHorizontalOffset (counterHorizontal * _grid.RowHeight.Value);
        }
    
    

    Please refer to the same from the attached sample. (see ButtonClickVerticalScroll.zip)

    Best Regards,

    Kartik

    ButtonClickVerticalScroll.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels