We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to customize "EmptyText" to something else like "Please enter shelf number"

When data source return null value for some text box it shows as EmptyText, Can I customize  EmptyText  to some thing else like "Please enter shelfnumber" 


 <SfInPlaceEditor @bind-Value="@documentModel.Shelf_No" CssClass="form-text" TValue="string" Mode="@Mode" EditableOn="@EditableOn" Type="Syncfusion.Blazor.InPlaceEditor.InputType.Text" Disabled="@disabled" SubmitOnEnter="true">

                            <EditorComponent>

                                <SfTextBox @bind-Value="@documentModel.Shelf_No" Placeholder="Enter shelf number"></SfTextBox>

                            </EditorComponent>


                        </SfInPlaceEditor>




3 Replies 1 reply marked as answer

VY Vinothkumar Yuvaraj Syncfusion Team October 20, 2022 11:22 AM

Hi Sarvajeet kaur,


We have analyzed your reported query. To meet your requirements, we have created a sample. Please find the below sample for your reference.


Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/178324-1478343687.zip


Reference : https://blazor.syncfusion.com/demos/in-place-editor/edit-post?theme=fluent


Please check the attached sample and let us know if you have any concerns.



Regards,

Vinothkumar



SK Sarvajeet Kaur October 20, 2022 12:39 PM

does it work without  "Required"  because in my case shelf number required only in some conditions but not always required.

[Required(ErrorMessage = "Enter shelf number")]

        public string Name { get; set; } = "Andrew";



VJ Vinitha Jeyakumar Syncfusion Team October 21, 2022 04:07 AM

Hi Sarvajeet,


Please ignore the solution provided in the last update.

To achieve your requirement to customize "EmptyText" to something else can be achieved by using the EmptyText property of the In-PlaceEditor. please check the sample and code below,

Code snippet:
<SfInPlaceEditor @bind-Value="@value" TValue="string" EmptyText="Please enter shelf number" Type="Syncfusion.Blazor.InPlaceEditor.InputType.Text">
                <EditorComponent>
                    <SfTextBox @bind-Value="@value" Placeholder="Enter employee name"></SfTextBox>
                </EditorComponent>
            </SfInPlaceEditor>



Regards,
Vinitha

Marked as answer
Loader.
Live Chat Icon For mobile
Up arrow icon