You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/grid/manual-operations.md
+121-4Lines changed: 121 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,9 @@ Examples:
28
28
29
29
30
30
*[Custom paging with a remote service](#custom-paging-with-a-remote-service)
31
-
*[If you have all the data at once, the Telerik .ToDataSourceResult(request) extension method can manage the operations for you](#if-you-have-all-the-data-at-once-the-telerik-todatasourceresultrequest-extension-method-can-manage-the-operations-for-you)
32
-
*[Extract information from the DataSourceRequest object to use in your own API](#extract-information-from-the-datasourcerequest-object-to-use-in-your-own-api)
@@ -118,7 +119,9 @@ Custom paging. There is a deliberate delay in the data source operations in this
118
119
}
119
120
````
120
121
121
-
### If you have all the data at once, the Telerik .ToDataSourceResult(request) extension method can manage the operations for you
122
+
### Telerik .ToDataSourceResult(request)
123
+
124
+
If you have all the data at once, the Telerik .ToDataSourceResult(request) extension method can manage the operations for you
122
125
123
126
````CSHTML
124
127
Using Telerik DataSource extension methods to manipulate all the data into paged chunks and also perform other operations like filtering, sorting, etc. There is a deliberate delay in the data source operations in this example to mimic real life delays and to showcase the async nature of the calls.
@@ -201,7 +204,9 @@ Using Telerik DataSource extension methods to manipulate all the data into paged
201
204
````
202
205
203
206
204
-
### Extract information from the DataSourceRequest object to use in your own API
207
+
### Get Information From the DataSourceRequest
208
+
209
+
With a few simple loops, you can extract information from the DataSourceRequest object to use in your own API (such as filters, sorts, paging state).
205
210
206
211
````CSHTML
207
212
@using Telerik.DataSource
@@ -277,6 +282,118 @@ Using Telerik DataSource extension methods to manipulate all the data into paged
277
282
````
278
283
279
284
285
+
### Cache Data Request
286
+
287
+
If you need to replay the last request for some reason (your data has updated, or you need to await some business logic that determines what data to request), store the `DataSourceRequest` object in a field in your view model, then run the method that will read the data when necessary - a button click, or when some async operation completes.
288
+
289
+
290
+
````CSHTML
291
+
@* This example awaits some business data in OnInitializedAsync and fetches grid data according to it
292
+
You can call the SetGridData() method from button clicks or other events according to your needs *@
0 commit comments