Issue with wpf datagrid and scrollintoview

2 posts, 0 answers
  1. amit kumar
    amit kumar avatar
    1 posts
    Member since:
    Nov 2014

    Posted 27 Nov 2014 Link to this post

    Hello All,

    I have a requirement where I have to search for a particular type of item in the data grid and then click on it. 
    But when I am trying to search it in the data grid, initially I was unable to found this item as the number of rows present in the data grid found through Telerik were only the rows that were visible. This was due to the by default enabled feature of WPF virtualization. I disabled it and was able to get all the grid items.

    So the first question what if I don't want to disable virtualization and want to traverse all the grid items. Any solution for this?.
    The second query is when I disabled virtualization and traversed the data row items in a loop. I was trying to find the required item in this grid and when I found it I tried to click on it after scrolling to it using scrollintoview. But I was unable to click on it as after scrolling the grid was scrolled down to the bottom end.

    The code is like:
    foreach(DataGrid row in rows){
         if(row.Text.Equals(someValue))// Comparing the row data one by one
             row.ScrollToVisible();// Not working
             row.User.Click(); // Not working

    Please let me know on how to fix this one?

    Amit Singh

  2. Boyan Boev
    Boyan Boev avatar
    1025 posts

    Posted 02 Dec 2014 Link to this post

    Hi Amit,

    Here is a coded sample against Silverlight grid which can be used also against WPF.

    It gives the necessary information about the visualization also. 

    Let me know if this helps.

    Boyan Boev
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top