Search results

Disable the edit mode specifically

The edit mode of In-place Editor can be disabled by setting the Disabled property value to true. In the following example, when check or uncheck the checkbox, In-place Editor component will disable or enable the edit mode.

@using Syncfusion.EJ2.Blazor
@using Syncfusion.EJ2.Blazor.InPlaceEditor
@using Syncfusion.EJ2.Blazor.Buttons
@using Syncfusion.EJ2.Blazor.Inputs

<table class="table-section">
    <tr>
        <td> Disabled: </td>
        <td>
            <EjsCheckBox @bind-Checked="Checked" Label="Disable" ></EjsCheckBox>
        </td>
    </tr>
    <tr>
        <td class="sample-td"> Enter your name: </td>
        <td class="sample-td">
            <EjsInPlaceEditor Mode="RenderMode.Inline" Disabled="Checked" Type="InputType.Text" Value="TextValue" SubmitOnEnter="true" Model="TModel">
            </EjsInPlaceEditor>
        </td>
    </tr>
</table>

<style>
    .table-section {
        margin: 0 auto;
    }

    tr td:first-child {
        text-align: right;
        padding-right: 20px;
    }

    .sample-td {
        padding-top: 10px;
        min-width: 230px;
        height: 100px;
    }
</style>

@code {
    public string TextValue { get; set; } = "Andrew";
    public bool Checked { get; set; } = true;

    public TextBoxModel TModel = new TextBoxModel()
    {
        Placeholder = "Enter some text"
    };

}