Get A list of rows that are on the screen

2 posts, 0 answers
  1. Mark
    Mark avatar
    130 posts
    Member since:
    Oct 2014

    Posted 19 Jan 2017 Link to this post

    Is there a way, in the grid view, to programmatically get a list of rows that are only visible on the screen.  For example, I have 100 rows in my datasource and I only show 15 rows of in my gridview, I scroll down a few pages. I want to get a list of the rows that are visible, programmatically.  How can I do that?

     

    Thanks

  2. Dimitar
    Admin
    Dimitar avatar
    2951 posts

    Posted 20 Jan 2017 Link to this post

    Hi Mark,

    You can use the VisualRows collection:
    private void radButton1_Click(object sender, EventArgs e)
    {
        foreach (var item in radGridView1.TableElement.VisualRows)
        {
            if (item is GridDataRowElement)
            {
     
                Console.WriteLine(item.RowInfo.Cells[2].Value);
            }
        }
    }

    I hope this information is useful. Let me know if you need further assistance.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top