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

Find a row by cell value

1 Answer 301 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
Ronald Bouras
Top achievements
Rank 1
Ronald Bouras asked on 07 Sep 2016, 07:07 AM

Hello all,

how can I locate a certain row (or determine a row index) in the virtual grid by looking up a certain value?

If for example I have a list of employees with ID, Name, Address, Phone how can I locate the row with a certain Employee ID?
Also there seems to be no row collection that can be searched using Linq.

Thanks in advance.

Best regards, Ronny

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 07 Sep 2016, 10:10 AM
Hi Ronald,

Thank you for writing.

RadVirtualGrid has no data layer and in this respect no rows collection to be iterated or searched. This is a fundamental design concept allowing instant display of data having millions or even billions of records: RadVirtualGrid | Fundamentals.

In order to achieve your task, you need to search for the value in the object used to provide the data. After you have located the searched object within your source collection its position there should be its row index in the virtual grid. For example, if you are using an IEnumerable collection of your data models you can search for a particular value in it. The following forum thread is useful in this kind of scenario suggesting how an IndexOf extension method can be implemented: http://stackoverflow.com/questions/2471588/how-to-get-index-using-linq.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Tags
VirtualGrid
Asked by
Ronald Bouras
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or