How to change EnableEditMode programmatically

I use the way described here https://blazor.syncfusion.com/documentation/in-place-editor/how-to/dynamic-edit-mode  to enable edit mode where the value is null initially:

@bind-EnableEditMode="@EditModeEnabled"

Everything works well.

I have AutoComplete component inside the in-place editor, and I would like to turn off edit mode of editor when the value is selected. I set the variable to EditModeEnabled = false and nothing was happened. I tried to use StateHasChanged() and InvokeAsync(StateHasChanged), but the edit mode did not turned off anyway.

Please, check 


9 Replies

VJ Vinitha Jeyakumar Syncfusion Team January 11, 2022 12:54 PM UTC

Hi Stanislav,


We have prepared a sample for your requirement using OnValueSelect event of autoComplete control to disable the edit mode when we select the value from dropdown. please check the code below,

Code snippet:
<SfInPlaceEditor EnableEditMode="EditModeEnable" Type="Syncfusion.Blazor.InPlaceEditor.InputType.AutoComplete" @bind-Value="@AutoValue" Mode="@Mode" TValue="string">
                <EditorComponent>
                    <SfAutoComplete TValue="string" TItem="Countries" @bind-Value="@AutoValue" DataSource="@Country" Autofill=true>
                        <AutoCompleteFieldSettings Value="Name"></AutoCompleteFieldSettings>
                        <AutoCompleteEvents TValue="string" TItem="Countries" OnValueSelect="onSelect"></AutoCompleteEvents>
                    </SfAutoComplete>
                </EditorComponent>
            </SfInPlaceEditor>

@code {

    public bool EditModeEnable { get; set; } = true;

    public void onSelect()
    {
        this.EditModeEnable = false;
        this.StateHasChanged();
    }
}


Regards,
Vinitha



SG Stanislav Gordenko January 13, 2022 07:14 AM UTC

Hi Vinitha,

Your sample does not work well. It shuts down in-place editor once the first time, but all next selections it does not work.

I use NET6 and the in-place editor with autocomplete is wrapped into separate component, which invoke valuechanged on each selection, it could affect also.



BS Buvana Sathasivam Syncfusion Team January 17, 2022 02:20 AM UTC

Hi Stanislav, 
 
Currently, we are validating your reported query. We will update you with further details on or before January 18, 2022. 
 
Regards, 
Buvana S 



BS Buvana Sathasivam Syncfusion Team January 19, 2022 07:45 AM UTC

Hi Stanislav, 

Thank you for your patience. 

We have considered the issue “Dynamically change the EnableEditMode property is not working properly” as a bug from our end and the fix for the issue will be included with our upcoming weekly patch release on January 25, 2022. 

You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link:  


Regards, 
Buvana S 



BS Buvana Sathasivam Syncfusion Team January 25, 2022 05:41 PM UTC

Hi Stanislav, 

We are facing complexity to resolve the issue. We will include the fix in February 1, 2022 patch release. We appreciate your patience until then. 

Regards, 
Buvana S 



BS Buvana Sathasivam Syncfusion Team February 1, 2022 06:19 PM UTC

Hi Stanislav, 
  
Sorry for the inconvenience.  
  
We are facing complexity in resolving the reported issue in our end. We will include the fix in the upcoming patch release which is expected to be rolled out on February 08, 2022. 
  
Regards, 
Buvana S 



BS Buvana Sathasivam Syncfusion Team February 9, 2022 03:19 AM UTC

Hi Stanislav, 

Thanks for your patience.  
  
We are glad to announce that our Patch release V19.4.50 has been rolled out. We thank you for your support and appreciate your patience in waiting for this release. The fix for the reported issue “Dynamically change the EnableEditMode property is not working properly” is included in the above release, kindly upgrade the package to the latest version. 
Please get in touch with us if you would require any further assistance. 
  
Regards,  
Buvana S 



SG Stanislav Gordenko February 9, 2022 07:55 AM UTC

Hi,

Exactly with this patch release another trouble with in-line editor was popped out. I think that solution of this request influenced for the new issue. I have described it in the yesterdays message " Editor cancel editing on OnInput event ". Please, check.



BS Buvana Sathasivam Syncfusion Team February 10, 2022 10:58 AM UTC

Hi Stanislav, 

Thanks for your update. 

You can follow up your other issue on the "Editor Cancel Editing on OnInput Event" forum for your further updates. 

Regards, 
Buvana S 


Loader.
Up arrow icon