I need to iterate all rows in the grid under for the following criteria:
Virtual Rows and Columns are enabled
I am using GridView filter capabilities to reduce number of visible rows
I know from reading similar forum responses that it is strongly recommended not to iterate the grid rows but iterate thru the bound data object. However, the data object does not reflect the filtering on the data as displayed in the grid. In my app I need to save the data (no filtered rows) in a custom format to a file. How do you recommend I do this?
Since the GridView software is aware of virtual rows and is also aware of what is filtered a new GridView method to iterate the data object would be very helpful. This method would take into account the filtering as well as columns hidded by a column chooser.
7 Answers, 1 is accepted
In the XAML then you have:
Or something of that nature.
Should do the trick I think...Could be an easier solution but I think this will give you the desired subset of data.
The saving of data could be pretty easy using some of the export functionality that the controls have baked in. Just check out the documentation there, though I prefer to use something like ClosedXML for my exporting needs.
Sorry I think I misread what you are trying to do there...my bad...
You can use a QueryableCollectionView as an ItemsSource value for RadGridView. In this way it will automatically sync its sort, filter and group descriptors with RadGridView and you will be able to track the changes in your view model. I am attaching a sample project that illustrates this approach.Regards,
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Loading ItemsSource with a QueryableCollectionView object worked great. It is exactly what I needed and couldn't have been easier.
Are you saying that the change in the GridView will be reflected in the source, i.e., when I'm sorting in GridView, that the source will also be sorted in the same order?
What my colleague explained is that the SortDescriptors between RadGridView and QueryableCollectionView will be synchronized. The data displayed in RadGridView will be sorted based on the active SortDescriptors, not the source collection itself.
Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).