yahoo scrolling with gridview

2 posts, 0 answers
  1. daren
    daren avatar
    1 posts
    Member since:
    Jun 2015

    Posted 10 Jun 2015 Link to this post

    Hi,

    Is it possible to use the arrow keys on a keyboard to do a yahoo style scrolling on the radgrid when there is already a scroll bar implemented on the main page?

     

    for instance:

     

    main page needs a scroll bar because of the size.

    rad grid will need a scroll bar

    auto scrolling is set to true

    page posts back during scrolling with mouse

    must be able to use arrow keys for scrolling

     

    Even in the examples on your pages I have noticed that you cant use the arrow keys with the scroll bars.  Is this the norm or am i missing something?

     

    thanks

    daren

     

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 15 Jun 2015 Link to this post

    Hello Daren,

    In order to enable the arrow keys to scroll the content of the grid, you need to enable its Scrolling, Keyboard Navigation and Row Selection functionalities. Following is a simple example of a grid that will allow you to use the arrow keys for moving through items and scroll the content (when there is a selected item or when the grid is on focus):
    <telerik:RadGrid runat="server" ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" ClientSettings-Scrolling-AllowScroll="true"
        ClientSettings-Selecting-AllowRowSelect="true">
        <ClientSettings AllowKeyboardNavigation="true">
        </ClientSettings>
    </telerik:RadGrid>

    And the dummy data:
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        DataTable table = new DataTable();
        table.Columns.Add("ID", typeof(int));
        table.Columns.Add("BoolValue", typeof(Boolean));
        for (int i = 0; i < 500; i++)
        {
            table.Rows.Add(i, i % 2 == 0);
        }
     
        (sender as RadGrid).DataSource = table;
    }

    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top