Class InPlaceEditorButtton
Represents a customizable button used within the Syncfusion.Blazor.InPlaceEditor, typically for save and cancel actions.
Namespace: Syncfusion.Blazor.InPlaceEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class InPlaceEditorButtton : OwningComponentBase
Remarks
This component is a child of SfInPlaceEditor<TValue> and allows you to define properties such as content, CSS classes, and event handlers for the buttons.
Examples
The following example demonstrates how to configure save and cancel buttons within the Syncfusion.Blazor.InPlaceEditor.
<SfInPlaceEditor TValue="string">
<InPlaceEditorButtons>
<InPlaceEditorButton Content="Save" CssClass="e-primary"></InPlaceEditorButton>
<InPlaceEditorButton Content="Cancel"></InPlaceEditorButton>
</InPlaceEditorButtons>
</SfInPlaceEditor>
Constructors
InPlaceEditorButtton()
Declaration
public InPlaceEditorButtton()
Properties
ChildContent
Gets or sets the child content to be displayed within the button.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | A Microsoft.AspNetCore.Components.RenderFragment representing the content to be rendered. The default value is |
Remarks
This property allows you to define custom content, including other Blazor components or HTML elements. If not specified, the button's text will be determined by the Content property.
Content
Gets or sets the text content to be displayed on the button.
Declaration
public string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String | A |
Remarks
This property is used when you want a simple text-based button. For more complex content, use the ChildContent property.
CssClass
Gets or sets the CSS classes to be applied to the button for custom styling.
Declaration
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String | A |
Remarks
This allows for customization of the button's appearance, such as colors, borders, or layout.
Disabled
Gets or sets a value indicating whether the button is disabled.
Declaration
public bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
A disabled button cannot be clicked and does not raise the OnClick event.
EnableRtl
Gets or sets a value indicating whether to render the button in a right-to-left (RTL) direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
This is useful for internationalization and supporting languages that are read from right to left.
IconCss
Gets or sets the CSS class for an icon to be displayed on the button.
Declaration
public string IconCss { get; set; }
Property Value
Type | Description |
---|---|
System.String | A |
Remarks
The icon's position relative to the text is determined by the IconPosition property.
IconPosition
Gets or sets the position of the icon relative to the button's text.
Declaration
public IconPosition IconPosition { get; set; }
Property Value
Type | Description |
---|---|
IconPosition | An IconPosition enum value. The default is Left. |
Remarks
IsPrimary
Gets or sets a value indicating whether the button should be styled as a primary action.
Declaration
public bool IsPrimary { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Primary buttons are typically used to indicate the main action in a set of buttons, such as "Save" or "Submit."
IsToggle
Gets or sets a value indicating whether the button can be toggled between an active and inactive state.
Declaration
public bool IsToggle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
When a toggle button is clicked, its visual state changes to indicate it is active.
OnClick
Specifies the event handler to be invoked when the button is clicked.
Declaration
public EventCallback<MouseEventArgs> OnClick { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.MouseEventArgs> | An Microsoft.AspNetCore.Components.EventCallback<> that will be executed when the button's click event is triggered. The default value is |
Remarks
This event is typically used to handle the save or cancel logic in the parent component.
Type
Gets or sets the type
attribute of the button element.
Declaration
public ButtonType Type { get; set; }
Property Value
Type | Description |
---|---|
ButtonType | A ButtonType enum value. The default is Button. |