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

Issue with wpf datagrid and scrollintoview

1 Answer 233 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
amit kumar
Top achievements
Rank 1
amit kumar asked on 27 Nov 2014, 06:48 AM
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?

Regards,
Amit Singh
 













1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 02 Dec 2014, 06:49 AM
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.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
amit kumar
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or