Hi Sabeer,
Thanks for your patience.
We have prepared a sample for your requirement to load the data from API to SfDataGrid. In that sample, we used Refit to fetch the data from the server and loaded the data to SfDatagrid asynchronously. So you've got to wait a few seconds to get data from the server. Before launching the app, make sure that you have to allow an internet connection.
Code snippet :
| private async void getData() { var url = RestService.For<RefitApi>("http://makeup-api.herokuapp.com"); var orderInfo = await url.GetCompanyAsync("maybelline"); ObservableCollection<OrderInfo> records = JsonConvert.DeserializeObject<ObservableCollection<OrderInfo>>(orderInfo); sfGrid.ItemsSource = records; sfGrid.ColumnSizer = ColumnSizer.Star; sfGrid.AllowEditing = true; sfGrid.NavigationMode = NavigationMode.Cell; sfGrid.SelectionMode = Syncfusion.SfDataGrid.XForms.SelectionMode.Single; } … public interface RefitApi { [Get("/api/v1/products.json?brand={symbol}")] Task<string> GetCompanyAsync(string symbol); }
|
Sample link :
https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid_Demo-501673709Please refer to the below UG link to add filtering to SfDataGrid.
https://help.syncfusion.com/xamarin/datagrid/filteringRegards,
Karthik Raja