Skip to content

Commit a7aa85c

Browse files
945064: correction
1 parent f7a9755 commit a7aa85c

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

ej2-asp-core-mvc/grid/EJ2_ASP.MVC/data-binding/remote-data.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,35 @@ The following code example demonstrates how to export all records on the client
658658
{% endhighlight %}
659659
{% endtabs %}
660660

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 %}
685+
{% endhighlight %}
686+
{% endtabs %}
687+
688+
![AdditionalParameters](../images/databinding/remote-params.png)
689+
661690
## Offline mode
662691

663692
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
669698
{% highlight c# tabtitle="Offline.cs" %}
670699
{% include code-snippet/grid/data-binding/offline/offline.cs %}
671700
{% endhighlight %}
672-
{% endtabs %}
701+
{% endtabs %}
673702

674703
## Fetch result from the DataManager query using external button
675704

0 commit comments

Comments
 (0)