Implementation of a full-text search field above a grid (simple version)

Imagine you want to search for data via a text input field and display the result in a datagrid. It should look similar to this in the end:

When a string is entered in the search field, the grid should be filtered according to the search string.

First, place the search field and then define a user-specific attribute "@oninput" with value "@(async(args) => {search = $"{args.Value}";await datagridKundenAbo.GoToPage(0);await Load();})" in the search field."

This ensures that when a value is entered in the text field, the entered value is copied into the variable "search", and then the Load method of the specified grid is executed.

Define "search" variable in Load function of page:

Filter of Load method with extended where clause to use value of search variable

In Visual Studio this looks like:

var eEvolutionGetTicketkundeabosResult = await EEvolution.GetTicketkundeabos(new Query() { Filter = $@"i => (i.USERID == @0 && i.USERID != @1) && (i.Kunde.NAME1.Contains(@1))", FilterParameters = new object[] { Security.User.Id, search } });

"The whole thing works with a trick. The desired 'Where-Clause' is (i.Kunde.NAME1.Contains(@1)). It needs a variable with the search string, which in this example is @1. In order for @1 to be generated by the RADZen code generator, there must be a 'normal' filter condition, as we see in line 2 in the upper part. Line 1 is actually necessary, but line 2 exists only so that @1 is generated as a filter parameter and can be used by line 3. It is important that the expression in line 2 always evaluates to FALSE so that the result set is not corrupted."