4 Answers, 1 is accepted
Hi Graham,
It is possible and rather straightforward through the OnRead event. I made the following Knowledge Base article that explains the situation: https://docs.telerik.com/blazor-ui/knowledge-base/grid-get-filtered-data.
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Thanks. I got it working but had to change my collection to ObservableCollection to get the grid to refresh when I changed the data externally - I am using a drop-down control to apply a filter to the data. (I think Telerik advise using ObservableCollection as the default?).
Question - is there a way of accessing the GridSearchBox text or knowing if the GridSearchBox triggered the OnRead event?
thanks
Regarding my last question - I found this which allows me to see the current filters...
https://docs.telerik.com/blazor-ui/components/grid/manual-operations#get-information-from-the-datasourcerequest
thanks
Hello Graham,
Indeed, an observable collection is needed when you will be changing the data from an external place via the .Add(), .Remove() and .Clear() methods of the collection, you can read more on this here. We can't recommend that as the default, because whether you need that depends on your scenario and it is up to you to decide. The grid merely needs an IEnumerable - list, array, observable collection.
On getting data from OnRead - that's the way - you can loop over the information in the .Request object to get what you need out of it.
Regards,
Marin Bratanov
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).