User (Old forums)MemberMarch 12, 2008 at 10:33 amPost count: 23064
The following loop seems to return a DataRow object only if the row is visible
(This is probably due to UI virtualization).
foreach (object row in _dataGrid.Items)
Xceed.Wpf.DataGrid.DataRow currentRow = _dataGrid.GetContainerFromItem(row) as Xceed.Wpf.DataGrid.DataRow;
But is there anyway for me to retrieve a the full list of datarow(s)???
Imported from legacy forums. Posted by Serene (had 4527 views)Xceed SupportMemberMarch 12, 2008 at 10:42 amPost count: 5658
DataRows (Xceed.Wpf.DataGrid.DataRow) only exist when they are visible in the viewport (UI virtualization). There is no method to retrieve all the Xceed.Wpf.DataGrid.DataRows; however, you can retrieve the data items (usually System.Data.DataRow) through the DataGridControl.Items property.
Imported from legacy forums. Posted by Jenny [Xceed] (had 430 views)User (Old forums)MemberMarch 12, 2008 at 10:55 amPost count: 23064
Unfortunately, my datagrid is binded to a Collection<Custom Objects>
So Datagrid.Items will only return my Custom Object.
What i need are Row objects to access their cells.
Is there really no workaround for this?
Imported from legacy forums. Posted by Serene (had 535 views)Xceed SupportMemberMarch 12, 2008 at 11:36 amPost count: 5658
What do you need to access their cells for? Maybe there is another solution other than retrieving the container.
Imported from legacy forums. Posted by Jenny [Xceed] (had 239 views)User (Old forums)MemberMarch 12, 2008 at 12:21 pmPost count: 23064
I am trying to implement a export to CSV. And it is a configurable export – the user can select which columns he wishes to export.
So I wanted to loop through the rows, and retrieve the cells of the columns applicable.
It’s alright – I’ve implemented a work-around. I used reflection to retrieve the Properties from the object that I extract from Datagrid.Items.
It might not be performance optimized 😛 but, i guess it has to do for now.
Imported from legacy forums. Posted by Serene (had 4931 views)User (Old forums)MemberJuly 15, 2009 at 11:21 amPost count: 23064
I have the same problem even after an year of this post. Only change BringItemIntoView does not provide enough scalability to bring the cell in viewable area. I ended up using reflection as well. As above reflection is not a satisfactory solution for performance and when display values are different from underlying values.
Imported from legacy forums. Posted by Pritesh (had 2160 views)
- You must be logged in to reply to this topic.