Hi,
We have problem with the XamGrid, we want to bind the filtered, ordered collection from the XamGrid itemsource.
What we want:
In our application we have two collection, one is the original whole source, second is the XamGrid viewed collection. In the second collection we want to have the source what is visible, after the ordering, filtering and we want to bind to this list.
Our question is, how we can create this second collection (This collection should be updated, when the itemsource it is changed, a new sorting it is made, a new filtering is made)- Can we have a direct binding to the visible collection, or we should use and create our collection after RowCollectionxhange, Sort change and FIltering change?
Thank you for the update and feel free to let me know if you have any questions.
Hi Maria,
We found one thing, when we are reloading the XamGrid data every time we sett to null the itemsource, perhaps this is not good, because the control every time must recreate the XamGrid columns, so we changed only to clear the item source. With this changes we obeserved that the XamGrid will not freeze.
Hello,
The increased loading time of any grid placed in a tab control is caused by the re-redering of its elements. While in tab control, the grid is not in the visual tree.
Another reason that can reflect the loading are the missing virtualization (you can check if the grid is placed inside a container which sizes its children with infinity width). Makes sure that it is not turned off.
I would also suggest you to use the latest service release where all the recent fixes for the control are included and check if the performance on tab switch is better.
Please do not hesitate to ask if you have any questions.
Thank you for the response, we access every time this XamGrid.Rows collection but it seems the the control freeze on rendering.
We have 30000 rows, and we have 3 XamGrid in a tab control, every tab has a XamGrid, and we access the rows, in 3 event (Row collection changed, Sorting changed, Filtered, changed), here we call a method to collect the visible rows:
private void TransferFilteredRecordsToTarget() { if (this.AssociatedObject.Rows != null) { this.filteredItemList = new List<object>(); foreach (RowBase r in this.AssociatedObject.Rows) { if (r.RowType == RowType.DataRow) { this.filteredItemList.Add(r.Data); } } } }
The method is working fine, but when I select the a tab control, the list is refreshed, but the UI it's freeze for 30 sec - 1 min, and the CPU is in 30 %, and we don't know why we have this freezing.
Hello and thank you for posting!
XamGrid rows collection contains the visible rows that are currently loaded in the grid. This means that if filter is applied it will only contains the currently visible rows. The same is the case if paging is used – row collection will retrieve the rows on the current page. You can use the RowAdded, RowDeleted, Filtered and ColumnSorted events to update you subcollection with only rows in the grid that are loaded when the user change the view. Please feel free to let me know if you have any questions.