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

[Solved] Getting GridViewRow for rows outside of current visible rows

1 Answer 236 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Randy
Top achievements
Rank 1
Randy asked on 27 Oct 2010, 11:11 PM
I have a grid that is bound to a table via RIA services and it also includes paging (in this case, 50 items per page).  Within a single page of the grid, I want to loop thru the items and get a reference to the GridViewRow object for a specific row so that I can use the Measure() routine on the row object to determine its height.

I know that I can use the grid Items collection to get to all of the rows, whether they are visible or not.  But the object that it returns, using something like grid.Items[CurrentRow], is an object based on the type of record that is bound to the grid.  Using the other methods for getting the grid row like ChildrenOfType<GridViewRow> or ItemContainerGenerator.ContainerFromIndex will only return a row object for rows that are currently visible.

Is there a way to get a reference to the GridViewRow for rows that are not visible for the current grid page?  Or is there another way to determine the row height?  My grids are dynamic in that users can specify different font sizes, which impact row height, so I do not have any explicit row height set that I can query.

Thanks,
Randy

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 28 Oct 2010, 07:20 AM
Hi Randy,

 You can get these rows only if you force the grid to create all of them. This can be achieved if the grid is measured with infinity - inside StackPanel, ScrollViewer, Row with Height="Auto", etc. 

Regards,
Vlad
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
Tags
GridView
Asked by
Randy
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or