Search and filter not work

Hello,

the search function and filter not working, below my code:

<div class="top-row auth">

    <a class="btn btn-lg px-3 btn-light" rel='nofollow' href="#" role="button">

        <img src="/Image/elencoPazienti.png" height="50">

        <br><span style="font-size:smaller;">Elenco Pazienti</span>

    </a>

    <a class="btn btn-lg px-3 btn-light" rel='nofollow' href="#" role="button" @onclick="@onClick">

        <img src="/Image/nuovoPaziente.png" height="50">

        <br><span style="font-size:smaller;">Nuovo Paziente</span>

    </a>

    <a class="btn btn-lg px-3 btn-light" rel='nofollow' href="#" role="button">

        <img src="/Image/moduli.png" height="50">

        <br><span style="font-size:smaller;">Moduli</span>

    </a>

</div>

<br>

<div class="col-lg-12 control-section">

    <div class="content-wrapper">

        <div class="row">

            <SfGrid TValue="Paziente" ID="Grid" @ref="Grid" AllowFiltering="true">

                <SfDataManager Url="/api/Paziente" Adaptor="Adaptors.WebApiAdaptor"></SfDataManager>

            </SfGrid>

        </div>

    </div>

</div>

@code {

    [CascadingParameter]

    private Task<AuthenticationState> authenticationStateTask { get; set; }

    private string _authMessage = "";

    SfGrid<Paziente> Grid;

    private DialogSettings DialogParams = new DialogSettings { Width = "450px", Height = "550px" };


    protected override void OnInitialized()

    {

        LogUsername();

    }


    private async Task LogUsername()

    {

        var authState = await authenticationStateTask;

        var user = authState.User;


        if (user.Identity.IsAuthenticated)

        {

            _authMessage = $"{user.Identity.Name}";

        }

        else

        {

            _authMessage = "";

        }

    }

I use net 6 Sinfusion 19.0.4.56

Th


3 Replies

MS Monisha Saravanan Syncfusion Team March 16, 2022 12:08 PM UTC

Hi Luigi, 

Greetings from Syncfusion support. 

We have validated your query and prepared an sample as per your requirement. But we could not reproduce the reported behavior at our end, we are able to get the filter or search details in WebAPI controller’s Get method. Also we would like to inform that, while using WebAPI adaptor, you need to handle the data operations(such as sorting, filtering, paging etc) in API controller based on querystring(Request.Query) contains skip, take and other values(for sorting, filtering) values in WebApi controller.  

Based on the querystring, you need to handle the data operations(sorting, filtering, paging) at controller side. Kindly refer the attached sample and UG for your reference. 



Kindly get back to us if you need further assistance. 

Regards, 
Monisha 




LU Luigi March 16, 2022 04:48 PM UTC

Hi Monisha,

my project is a Blazor Web Assembly with Asp.net Core Hosted.

I must use  WebAPI adaptor?




MS Monisha Saravanan Syncfusion Team March 17, 2022 01:17 PM UTC

Hi Luigi, 
  
Thanks for the update. 
  
We have prepared an sample based on your requirement  with WebApi Adaptor using web assembly. Kindly check the attached sample for your reference. 
  
  
Kindly get back to us if you need further assistance. 
  
Regards, 
Monisha 


Loader.
Up arrow icon