Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxWindow.ShowCloseButton Property

Specifies whether the Window’s header displays the Close button.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public bool ShowCloseButton { get; set; }

#Property Value

Type Description
Boolean

true to display the Close button; otherwise, false.

#Remarks

Set the ShowCloseButton property to true to show the Close button in the header. Users can click this button or press Escape to close the window.

Razor
<DxButton RenderStyle="ButtonRenderStyle.Secondary" 
          Click="() => WindowVisible = !WindowVisible">SHOW A WINDOW</DxButton>
<DxWindow @bind-Visible=WindowVisible
          HeaderText="Header"
          BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet metus vel
             nisi blandit tincidunt vel efficitur purus. Nunc nec turpis tempus, accumsan orci auctor,
             imperdiet mauris. Fusce id purus magna."
          Width="max(25vw, 250px)"
          ShowCloseButton=true>
</DxWindow>

@code {
    bool WindowVisible { get; set; } = false;
}

Blazor Window - Show Close Button

You can also use the following templates to implement a custom close action: HeaderTemplate, BodyTemplate, FooterTemplate. In a template, use the context parameter’s CloseCallback property.

See Also