Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Grid and List<string> #1064

Unanswered
curtic00 asked this question in Q&A
Mar 14, 2025 · 3 comments · 1 reply
Discussion options

Hi, is it possible to use client side filtering on your grid if you data source is a simple String list? ( List )

You must be logged in to vote

Replies: 3 comments · 1 reply

Comment options

@curtic00 Filtering is not supported at the moment. However, sorting and paging are supported.

image

<Grid TItem="string"
      Class="table table-hover table-bordered table-striped"
      DataProvider="EmployeesDataProvider"
      AllowPaging="true"
      PageSize="5"
      AllowSorting="true"
      Responsive="true">

    <GridColumns>
        <GridColumn TItem="string"
                    HeaderText="Customer Name"
                    SortKeySelector="item => item">
            @context
        </GridColumn>
    </GridColumns>

</Grid>

@code {
    private IEnumerable<string> employees = default!;

    private async Task<GridDataProviderResult<string>> EmployeesDataProvider(GridDataProviderRequest<string> request)
    {
        if (employees is null) // pull employees only one time for client-side sorting, and paging
            employees = GetEmployees(); // call a service or an API to pull the employees

        return await Task.FromResult(request.ApplyTo(employees));
    }

    private IEnumerable<string> GetEmployees()
    {
        return new List<string>
        {
            "Alice",
            "Bob",
            "John",
            "Pop",
            "Ronald",
            "Line",
            "Daniel",
            "Merlin",
            "Sharna",
            "Zayne",
            "Isha",
            "Glenda",
        };
    }
}
You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@gvreddy04
Comment options

@curtic00 Class with one property will work.

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.