ambiguous event hander parameter type

<SfInPlaceEditor TValue="string">

  <InPlaceEditorEvents ValueChange="@ValueChangeHandler" ></InPlaceEditorEvents>

  <EditorComponent>

    <SfTextBox @bind-Value="@ProjectName" Placeholder="Enter project name"></SfTextBox>

  </EditorComponent>

</SfInPlaceEditor>


I want to catch the ValueChange event. The problem is in my code where it says that the function prototype is ambiguous. What is the correct specification for the function to catch this event?

    public void ValueChangeHandler(ChangeEventArgs args)

    {

        Debug.Write("##### ShowProjectSettings.ValueChangeHandler #####");

    }


1 Reply

GK Gunasekar Kuppusamy Syncfusion Team August 26, 2021 01:25 PM UTC

Hi Colin,

Greetings from Syncfsion support.

We have validated your reported query "I want to catch the ValueChange event. The problem is in my code where it says that the function prototype is ambiguous".

You can use the ValueChange event as the line below mentioned. You need to mention the TValue in the InplaceEditorEvents tag and function argument type.

Refer to the below code snippets.
<SfInPlaceEditor TValue="string" @bind-Value="@ProjectName">
    <InPlaceEditorEvents TValue="string" ValueChange="@ValueChangeHandler"></InPlaceEditorEvents>
    <EditorComponent>
        <SfTextBox @bind-Value="@ProjectName" Placeholder="Enter project name"></SfTextBox>
    </EditorComponent>
</SfInPlaceEditor>

@code {
    private string ProjectName { get; set; }

    public void ValueChangeHandler(Syncfusion.Blazor.InPlaceEditor.ChangeEventArgs<string> args)
    {
        //
    }
}

Please check the sample and let us know if the solution helps.

Regards,
Gunasekar


Loader.
Up arrow icon