how to send 2 parameters to method in blazor

Viewed 88

I have an AutoComplete control and I need to send a parameter plus the ValueChange method

<BlazoredTypeahead SearchMethod="searchProvedores"                                                     
    TValue="T200MmTerceros"                                                        
    TItem="T200MmTerceros"                                                        
    Value="conceptos.SelectedProveedor"                                                        
    ValueChanged="SelectedProveedorChanged"                                                        
    ValueExpression="@(() => conceptos.SelectedProveedor,conceptos.f5962_rowid)"                                                        
    Placeholder="Escribe 4 caracteres para buscar..." MinimumLength="4">
      <SelectedTemplate Context="T200MmTerceros">@T200MmTerceros.RazonSocial</SelectedTemplate>
      <ResultTemplate Context="T200MmTerceros">@T200MmTerceros.RazonSocial @T200MmTerceros.Id)</ResultTemplate>
</BlazoredTypeahead>                                             
<ValidationMessage For="@(() => conceptos.SelectedProveedor)" />

And:

private async Task\<IEnumerable\<T200MmTerceros\>\> searchProvedores(String searchText)
{

    model.SearchProveedores = searchText;
    var result = await new ProxyLogicaNegocio("", HCore.UrlSiesaApi).GetGestionViajesProvedoresListAsync(model);
    return result;

}

private async Task SelectedProveedorChanged(T200MmTerceros t200MmTerceros, int concepto )
{
    //SelectedProveedor = t200MmTerceros;
    
    model.RowidTerceroProv = t200MmTerceros.Rowid;
    model = await new ProxyLogicaNegocio("", HCore.UrlSiesaApi).GetGestionViajesSucursalesAsync(model);
   // Sucursales = model.SucursalViajes;
   data[0].SelectedProveedor = t200MmTerceros;
    data[0].SelectedSucursales = model.SucursalViajes; 

}`

but i get the following errors -No overload for method 'TypeCheck' takes 2 arguments -Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type -Argument 2: cannot convert from 'method group' to 'EventCallback'

I need to be able to send another parameter that would allow me to know which item in the list to modify the value that was selected

1 Answers

Your error comes from this part:

ValueExpression="@(() => conceptos.SelectedProveedor,conceptos.f5962_rowid)"

I'm not sure what the rowid is supposed to be for but this should at least compile:

ValueExpression="@(() => conceptos.SelectedProveedor)"

Note that the For in <ValidationMessage For="@(() => conceptos.SelectedProveedor)" /> also uses a ValueExpression.

Related