Layout Blazor API

Layout Properties

NameTypeDefaultDescription
ContextMenuDataSourceobjectN/ASpecifies the list of selectable options that will appear within the context menu, allowing users to interact with or perform actions based on their selection.
DisabledboolfalseDetermines whether the element is interactive or inactive. When enabled, the element can receive user input and respond to actions. When disabled, the element becomes non-interactive and does not respond to user input or events.
DataSourceIEnumerable<object>N/ASets or retrieves the data source associated with the Layout component. This property allows you to define the input data that the Layout will use to render its content, or to access the current data source being used.
UnlockKeystring""Sets or retrieves the unlockKey, a unique code or token required to grant access to and activate the product’s full functionality.
Localestring"en"Specifies or retrieves the current language setting. This property is typically used together with the messages property to display localized content based on the selected language. Setting this value changes which language messages are used, while getting it returns the currently active language code (e.g., "en", "fr", "es").
MessagesobjectN/ADefines an object containing string values that represent messages or labels corresponding to various password strength states (e.g., "weak", "medium", "strong"). This is typically used to provide user feedback on password strength during password creation or validation processes.
OrientationOrientationOrientation.VerticalSets or retrieves the main orientation of the Layout component. This orientation determines how child Splitters within the Layout are arranged—either horizontally or vertically—by default. All Splitters inside the Layout will inherit this orientation unless a specific orientation is defined for them individually in the dataSource configuration.
ReadonlyboolfalseIf the element is set to "readonly", users cannot modify its value, but they can still highlight and copy its contents. However, they cannot type, edit, or otherwise change the value within the field. The field remains focusable and selectable, but direct user input is disabled.
AllowLiveSplitboolfalseIndicates whether the splitting process occurs in real-time (live) or is performed as a pre-processed operation before use.
RightToLeftboolfalseSets or retrieves a value that determines whether the element's layout direction is configured for right-to-left (RTL) languages, such as Arabic or Hebrew, enabling proper alignment and rendering for locales that use RTL text.
SelectedIndexobjectN/ASpecifies which item is currently selected from a list or collection. This property typically holds the identifier, index, or value of the selected item, allowing the application to reference or display the chosen option.
Themestring""Specifies the theme to be applied. The theme controls the overall appearance and style of the element, including colors, fonts, and visual layout, ensuring a consistent look and feel across the user interface.
UnfocusableboolfalseWhen set to true, this property prevents the element from receiving keyboard focus, making it impossible for users to select the element using tab navigation or other focus-related interactions.

Layout Methods

NameTypeArgumentsDescription
CreateLayoutItemvoidobject type, object positionInserts a new item element into the Layout component, positioning it within the existing structure according to the component's layout configuration. This action updates the Layout to include the new item as part of its content, ensuring proper rendering and alignment with other elements.Args: dynamic type - The index of an item to be removed or an instance of Smart.SplitterItem.,object position - A string that represents the position where the new item will be created.
CreateLayoutItemvoidobject typeInserts a new item element into the Layout component, positioning it within the existing structure according to the component's layout configuration. This action updates the Layout to include the new item as part of its content, ensuring proper rendering and alignment with other elements.
GetDataSourceAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;DataSource&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
GetItemvoidobject indexReturns the Layout item located at the specified index within the collection. The index is passed as a parameter, and the function retrieves the corresponding Layout item from the list or array. This allows you to access a particular Layout item by its position in the sequence.Args: int index - The index of an item.
GetItemvoidint indexReturns the Layout item located at the specified index within the collection. The index is passed as a parameter, and the function retrieves the corresponding Layout item from the list or array. This allows you to access a particular Layout item by its position in the sequence.Args: int index - The index of an item.
GetItemvoidstring indexReturns the Layout item located at the specified index within the collection. The index is passed as a parameter, and the function retrieves the corresponding Layout item from the list or array. This allows you to access a particular Layout item by its position in the sequence.Args: int index - The index of an item.
GetSelectedIndexAsync()Task<object>'N/A'Gets the &quot;SelectedIndex&quot; property as Task&lt;object&gt;.
MoveChildrenvoidobject oldItem, object newItemTransfers all child elements or nodes from a specified source item to a designated target item, effectively moving the entire group of children so they become nested under the target item instead of the source.Args: dynamic oldItem - The source item that will have it's content removed.,dynamic newItem - The host item that will have it's content replaced.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
RefreshvoidN/AAutomatically updates and redraws the layout to reflect any recent changes, ensuring all components are properly arranged and displayed according to the latest data or configuration.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.

Layout Events

NameTypeDescriptionEvent Detail
OnStateChangeEventCallback<Event>This event is triggered whenever there is a change in the Layout's state. Examples include actions such as adding a new item, removing an existing item, or any other modification that alters the structure or arrangement of the Layout.dynamic item- The Splitter item that was the target of a change., dynamic type- A description of the operation that has cause the change.
StateChangedevent LayoutStateChangedEventHandlerThis event is triggered whenever there is a change in the Layout's state. Examples include actions such as adding a new item, removing an existing item, or any other modification that alters the structure or arrangement of the Layout.LayoutStateChangedEventArgs
OnChangeEventCallback<Event>This event is triggered whenever the user changes the current selection, such as by highlighting different text or choosing a new item from a list. It occurs immediately after the selection has been modified, allowing you to respond to changes in user input or interface focus.dynamic oldSelectedIndex- The Splitter item that was previously selected., dynamic selectedIndex- The Splitter item that is currently selected.
Changedevent LayoutChangedEventHandlerThis event is triggered whenever the user changes the current selection, such as by highlighting different text or choosing a new item from a list. It occurs immediately after the selection has been modified, allowing you to respond to changes in user input or interface focus.LayoutChangedEventArgs
OnClosingEventCallback<Event>This event is triggered right before the context menu is closed. Within the event handler, you can call event.preventDefault() to cancel the closing operation, allowing you to execute custom logic or prevent the menu from closing based on certain conditions.N/A
Closingevent LayoutClosingEventHandlerThis event is triggered right before the context menu is closed. Within the event handler, you can call event.preventDefault() to cancel the closing operation, allowing you to execute custom logic or prevent the menu from closing based on certain conditions.LayoutClosingEventArgs
OnCloseEventCallback<Event>This event is triggered when the context menu is closed by the user, either by selecting an option or clicking outside the menu.N/A
Closedevent LayoutClosedEventHandlerThis event is triggered when the context menu is closed by the user, either by selecting an option or clicking outside the menu.LayoutClosedEventArgs
OnOpeningEventCallback<Event>This event is fired just before the context menu appears, typically when a user right-clicks on an element. By calling event.preventDefault() within the event handler, you can prevent the default context menu from opening, allowing you to implement a custom context menu or handle the action in a different way.N/A
Openingevent LayoutOpeningEventHandlerThis event is fired just before the context menu appears, typically when a user right-clicks on an element. By calling event.preventDefault() within the event handler, you can prevent the default context menu from opening, allowing you to implement a custom context menu or handle the action in a different way.LayoutOpeningEventArgs
OnOpenEventCallback<Event>This event is triggered whenever the context menu (typically accessed by right-clicking or a similar user action) is opened by the user.N/A
Openedevent LayoutOpenedEventHandlerThis event is triggered whenever the context menu (typically accessed by right-clicking or a similar user action) is opened by the user.LayoutOpenedEventArgs
OnMenuItemClickEventCallback<Event>This event is triggered whenever a user selects and clicks an option from the context menu. It occurs after the user has opened the context menu—typically via right-click or a long press—and chosen a specific menu item. The event provides details about the selected option, enabling you to handle custom actions or respond dynamically based on the user's selection.dynamic target- The Splitter item that was the target of the context menu opening., dynamic item- The Context menu item that was clicked., string label- The label of the context menu that was clicked., dynamic value- The value of the context menu that was clicked.
MenuItemClickedevent LayoutMenuItemClickedEventHandlerThis event is triggered whenever a user selects and clicks an option from the context menu. It occurs after the user has opened the context menu—typically via right-click or a long press—and chosen a specific menu item. The event provides details about the selected option, enabling you to handle custom actions or respond dynamically based on the user's selection.LayoutMenuItemClickedEventArgs

Enums

Orientation

Orientation.Horizontal
Orientation.Vertical