[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
   Reporting
  [Expand]Charting
  [Expand]Pivot Grid
   Spreadsheet
   Rich Text Editor
  [Expand]Scheduler
  [Collapse]Site Navigation and Layout
    Floating Action Button
   [Expand]FormLayout
   [Expand]Menu
   [Expand]NavBar
   [Expand]Ribbon
   [Expand]PageControl
   [Expand]TabControl
   [Expand]PopupMenu
   [Expand]Splitter
   [Expand]TreeView
    Panel
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Extensions
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Floating Action Button

The DevExpress ASP.NET MVC Floating Action Button (FloatingActionButtonExtension) appears in front of a container (HTML element or an extension) when an end user interacts with container elements.

Expanded Online Demos

Expanded Visual Elements

Expanded Concept

The floating action button provides two types of actions.

  • Action - Executes an action once an end-user clicks the floating action button.
  • Action Group - The floating action button serves as a container for multiple actions. When pressed, the floating action button expands nested actions.

You can handle end user actions and define the floating action button.

Expanded Features

Container Element

You can associate the floating action button with any HTML element or web control on a page (FloatingActionButtonSettings.ContainerElementID). The floating action button will be displayed in front of the container.

Fixed Position

Use the FloatingActionButtonSettings.VerticalPosition and FloatingActionButtonSettings.HorizontalPosition properties to specify the floating action button's position relative to the container.

Appearance

You can specify an image for each floating action button's type and nested action items.

Element Description
Floating Action Button: Collapse and expand images FABActionGroup.ExpandImage, FABActionGroup.CollapseImage
Action Item: Image FABActionItem.Image

Expanded Implementation Details

Use the ExtensionsFactory.FloatingActionButton helper method to add the Floating Action Button (FloatingActionButtonExtension) extension to a view. The ExtensionsFactory.FloatingActionButton method's parameter provides access to the floating action button's settings (FloatingActionButtonSettings).

Expanded Declaration

The following code illustrates how to add the floating action button to a view.

View code (ASPX):

View code (Razor):

Note

The Partial View should contain only the extension's code.

Expanded Client-Side Functionality

The ASPxClientFloatingActionButton object (the FloatingActionButtonExtension extension's client-side equivalent) provides the floating action button's client-side APIs.

Property Description
ASPxClientFloatingActionButton.SetActionContext, ASPxClientFloatingActionButton.GetActionContext Gets or sets which action/action group is displayed in response to user action.
ASPxClientFloatingActionButton.SetHorizontalPosition, ASPxClientFloatingActionButton.SetVerticalPosition Gets or sets the floating action button's horizontal and vertical position.
ASPxClientFloatingActionButton.SetContainerElement, ASPxClientFloatingActionButton.SetContainerElementID Gets or sets the floating action button's container element.

Is this topic helpful?​​​​​​​