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

Get cell content for row outside of UI collection

2 Answers 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 30 Jul 2010, 02:00 PM
I'm trying to implement something similar to the "Search as You Type" demo (http://demos.telerik.com/silverlight/#GridView/Search) but instead of filtering the data to show only the rows that match the user's input, I want to find the first row that contains the user's input for a particular column and just highlight the row.  So all of the data on the current grid page is still there but the row matching the input would be highlighted.

Everything is fine if the matching row exists in the current UI container but if the user is searching for something that is not currently displayed, then what is the best way to get the actual cell contents of those rows?  For example, my grid is defined to display 50 rows per page but the current display container shows the first 20 rows.  I know that I can use ContainerFromItem to get the row information for a specified item but it will only return something if it exists in the current UI collection.  I also know that I can loop thru the current grid Items collection and will be able to see all of the rows for the current page.  But using this method does not get me the data that is actually displayed - it returns the data for the underlying data source, which doesn't always contain what is displayed (for example, gender may be stored as M or F in the data source but will display as Male or Female and I want to be able to search on the actual display contents).

I'm looking for suggestions on how to best achieve this without impacting performance too much.

Thanks


 

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 02 Aug 2010, 04:36 PM
Hello Randy,

As the virtualization is turn on by default for the grid, you cannot work with the values of the cells that are not visible at the moment. So, a possible solution might be to turn it off, but it will lead to slower performance in case of great amount of data. However, the recommended way is to work right with the exposed properties of you object. So, in order to provide you with a more accurate solution, we would need more details about your project, the type of data, the way you are changing the data displayed - in the case of Male and Female. It would be great if you could send us a sample project.
 

Sincerely yours,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Randy
Top achievements
Rank 1
answered on 04 Aug 2010, 06:32 PM
Hi Maya,

Thanks for responding.  I think I have a way around my original problem.  We are using RIA Services entities as the data source to the grid and for the example I cited regarding Gender, we have a specific annotation on the entity to indicate that the data value should be translated to a more readable version.  We are adding this behavior in OnAutoGeneratingColumn to use a Converter to convert the database value to full string value.  So in my search logic, I am now using the same converter and searching against the converted data and everything seems to be working well.

Thanks
Tags
GridView
Asked by
Randy
Top achievements
Rank 1
Answers by
Maya
Telerik team
Randy
Top achievements
Rank 1
Share this question
or