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

Iterate through GridViewRows

2 Answers 132 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 04 Mar 2011, 01:09 AM
I'm writing my own custom "export to excel" command for the WPF GridView.  Since I can apply custom styles and want them applied to my exported spreadsheet I need to iterate through all rows / cells and snag not only content but styles.  I can't seem to figure out how to do this (obviously it's set up to allow you to iterate through the underlying data items).  I was thinking about using ChildOfType or something.  Any thoughts?

2 Answers, 1 is accepted

Sort by
0
Dean
Top achievements
Rank 1
answered on 04 Mar 2011, 01:38 AM
I tried using ChildrenOfType and the problem is: with virtualization there are only the visible rows as children of the gridview.  Any thoughts?
0
Yavor Georgiev
Telerik team
answered on 06 Mar 2011, 01:21 AM
Hello Dean,

 Unfortunately there is no way to circumvent this, save for turning off virtualization altogether. However, if you apply styles using the Style properties (RowStyle in RadGridView and CellStyle in GridViewColumn) or the matching StyleSelector properties, you can still get the style used from those properties.

Best wishes,
Yavor Georgiev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Dean
Top achievements
Rank 1
Answers by
Dean
Top achievements
Rank 1
Yavor Georgiev
Telerik team
Share this question
or