Class DialogPositionData
A class used in the SfDialog to configure the custom position within the document or target.
Implements
Inherited Members
Namespace: Syncfusion.Blazor.Toolkit.Popups
Assembly: Syncfusion.Blazor.Toolkit.dll
Syntax
public class DialogPositionData : SfBaseComponent, IAsyncDisposable
Remarks
The DialogPositionData class allows you to specify custom positioning for the SfDialog component. You can set both X and Y coordinates to position the dialog at a specific location within the viewport or relative to a target element. The position values can be specified as pixels, percentages, or predefined keywords like "center", "top", "bottom", "left", and "right".
Examples
In the following example, position the dialog at the center horizontally and top vertically.
@using Syncfusion.Blazor.Toolkit.Popups
<SfDialog Width="500px" @bind-Visible="Visibility">
<DialogTemplates>
<Content>
<p>
Dialog content
</p>
</Content>
</DialogTemplates>
<DialogPositionData X="center" Y="top">
</DialogPositionData>
</SfDialog>
@code {
private bool Visibility { get; set; } = true;
}
Constructors
DialogPositionData()
Declaration
public DialogPositionData()
Properties
X
Gets or sets the horizontal position (X-coordinate) for positioning the SfDialog.
Declaration
public string X { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A string that specifies the horizontal position of the dialog. This can be:
String.Empty.
|
Remarks
The X property controls the horizontal positioning of the dialog within its container or viewport. When using keywords, "left" positions the dialog at the left edge, "center" centers it horizontally, and "right" positions it at the right edge. Numeric values position the dialog at the specified distance from the left edge of the container.
Y
Gets or sets the vertical position (Y-coordinate) for positioning the SfDialog.
Declaration
public string Y { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A string that specifies the vertical position of the dialog. This can be:
String.Empty.
|
Remarks
The Y property controls the vertical positioning of the dialog within its container or viewport. When using keywords, "top" positions the dialog at the top edge, "center" centers it vertically, and "bottom" positions it at the bottom edge. Numeric values position the dialog at the specified distance from the top edge of the container.