Blazor, QuickGrid(0.1.0-alpha.22351.1) WebAssembly (7.0.0) net 7 Compiler error

Mel Weaver 6 Reputation points
2022-12-06T16:01:26.35+00:00

Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.4.2

When adding the @bind:after="UpdateFilter" there is an error compiling -
Error CS1503 Argument 3: cannot convert from 'Microsoft.AspNetCore.Components.EventCallback<string>' to 'System.Action<string?>' Quickgrid WebAssembly D:\VS2022\Quickgrid WebAssembly\Quickgrid WebAssembly\Pages\FetchData.razor 1 Active

Remove the bind: after, the program compiles and runs.

@using Microsoft.AspNetCore.Components.QuickGrid;
@Anonymous "/fetchdata"
@inject HttpClient Http

<PageTitle>Weather forecast</PageTitle>  
  
<h1>Weather forecast</h1>  
  
<p>This component demonstrates fetching data from the server.</p>  
  
@if (forecasts == null)  
{  
    <p><em>Loading...</em></p>  
}  
else  
{  
    <QuickGrid Items="@forecasts.AsQueryable()" ResizableColumns="true">  
        <PropertyColumn Property="f => f.Date" Format="MMM dd yyyy" Sortable="true" />  
        <PropertyColumn Property="f => f.TemperatureC" Title="Temp (C)" Sortable="true" Align="Align.Center" />  
        <PropertyColumn Property="f => f.TemperatureF" Title="Temp (F)" Sortable="true" />  
        <PropertyColumn Property="f => f.Summary">  
            <ColumnOptions>  
                <input @bind="@searchName" placeholder="Search"  
                       class="form-control" autofocus @bind:after="UpdateFilter" @bind:event="oninput" />  
  
            </ColumnOptions>  
        </PropertyColumn>  
  
    </QuickGrid>  
}  
  
@code {  
    private WeatherForecast[]? forecasts;  
    private string? searchName;  
  
    protected override async Task OnInitializedAsync()  
    {  
        forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");  
    }  
  
    public class WeatherForecast  
    {  
        public DateOnly Date { get; set; }  
  
        public int TemperatureC { get; set; }  
  
        public string? Summary { get; set; }  
  
        public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);  
    }  
  
    void UpdateFilter()  
    {  
  
    }  
}  

  
Developer technologies | .NET | Blazor
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.