Hi John,
Greetings from Syncfusion support.
We suggest you to use CustomAdaptor as Component feature for this scenario. And now you can fetch the Query AddParams value using Grid’s ref.
We have also prepared a sample based on this scenario for your convenience. Please download the sample from the link below,
Please refer the codes below,
|
<SfButton OnClick="OnClick">Modify query</SfButton>
<SfGrid @ref="GridInstance" ... Query=@GridQuery>
<SfDataManager Adaptor="Adaptors.CustomAdaptor">
<CustomAdaptor GridRef=@GridInstance></CustomAdaptor>
</SfDataManager>
...
</SfGrid>
@code{
public string ParamValue = "original";
public Query GridQuery { get; set; }
SfGrid<Order> GridInstance;
public void OnClick()
{
//Example code on how to modfiy AddParams query
GridInstance.Query.Queries.Params["sfgrid"] = "changed";
}
protected override void OnInitialized()
{
GridQuery = new Query().AddParams("sfgrid", ParamValue);
}
}
[CustomAdaptor.razor]
[Parameter] public Syncfusion.Blazor.Grids.SfGrid<Order> GridRef{ get; set; } ... // Performs Update operation public async override Task<object> UpdateAsync(DataManager dm, object value, string keyField, string key) { //fetch param value by using below code var paramvalue = GridRef.Query.Queries.Params.FirstOrDefault().Value; ... return value; }
|
Please get back to us if you need further assistance.
Regards,
Renjith R