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: ej2-asp-core-mvc/grid/EJ2_ASP.MVC/data-binding/remote-data.md
+30-1Lines changed: 30 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -658,6 +658,35 @@ The following code example demonstrates how to export all records on the client
658
658
{% endhighlight %}
659
659
{% endtabs %}
660
660
661
+
## Sending additional parameters to the server
662
+
663
+
The Syncfusion ASP.NET MVC Grid allows you to include custom parameters in data requests. This feature is particularly useful when you need to provide additional information to the server enhanced processing.
664
+
665
+
By utilizing the `Query` property of the Grid along with the `addParams` method of the **Query** class, you can easily incorporate custom parameters into data requests for every Grid action.
666
+
667
+
To enable custom parameters in data requests for the Grid, follow these steps:
668
+
669
+
**1. Bind the Query Object to the Grid**: Assign the initialized query object to the `Query` property of the Grid.
670
+
671
+
**2. Initialize the Query Object:** Create a new instance of the **Query** class and use the `addParams` method to add the custom parameters.
672
+
673
+
**3. Handle Data State Changes:** If you need to dynamically update the data based on interactions, implement the [DataStateChange](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Grids.Grid.html#Syncfusion_EJ2_Grids_Grid_DataStateChange) event handler to execute the query with the updated state.
674
+
675
+
**4. Execute Data Request:** In the service, execute the data request by combining the custom parameters with other query parameters such as paging and sorting.
676
+
677
+
The following example demonstrates how to send additional parameters to the server:
678
+
679
+
{% tabs %}
680
+
{% highlight razor tabtitle="CSHTML" %}
681
+
{% include code-snippet/grid/data-binding/remote-prams/razor %}
682
+
{% endhighlight %}
683
+
{% highlight c# tabtitle="remotedata.cs" %}
684
+
{% include code-snippet/grid/data-binding/remote-prams/custombinding.cs %}
On remote data binding, all grid actions such as paging, sorting, editing, grouping, filtering, etc, will be processed on server-side. To avoid post back for every action, set the grid to load all data on initialization and make the actions process in client-side. To enable this behavior, use the **Offline** property of DataManager.
@@ -669,7 +698,7 @@ On remote data binding, all grid actions such as paging, sorting, editing, group
669
698
{% highlight c# tabtitle="Offline.cs" %}
670
699
{% include code-snippet/grid/data-binding/offline/offline.cs %}
671
700
{% endhighlight %}
672
-
{% endtabs %}
701
+
{% endtabs %}
673
702
674
703
## Fetch result from the DataManager query using external button
0 commit comments