This is a migrated thread and some comments may be shown as answers.

Get A list of rows that are on the screen

1 Answer 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
Mark asked on 19 Jan 2017, 05:04 PM

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

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 20 Jan 2017, 09:59 AM
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.
Tags
GridView
Asked by
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
Answers by
Dimitar
Telerik team
Share this question
or