Find a row by cell value

2 posts, 0 answers
  1. Ronald Bouras
    Ronald Bouras avatar
    11 posts
    Member since:
    Jun 2010

    Posted 07 Sep Link to this post

    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

  2. Hristo Merdjanov
    Hristo Merdjanov avatar
    664 posts

    Posted 07 Sep Link to this post

    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:

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

    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top