Unable To Close Dialogue Manually With Value

Hi all. New here and just started using the Radzen Components which are awesome. I am trying to open a Dialogue from a button, select an item and pass that back to the page that opened the Dialogue. It all works fine, apart from when I call the DialogService.Close() method, nothing happens

This is the method that opens the Dialogue

    private async Task AddProperty()
        var result = await DialogService.OpenSideAsync<ListContentTypeProperties>("Add Property",
            new Dictionary<string, object> { { "Id", ContentType.Id } },
            new SideDialogOptions { CloseDialogOnOverlayClick = true, Position = DialogPosition.Right, ShowMask = true });
        if (!string.IsNullOrEmpty(result))
            var selectedProperty = result;

And this is my ListContentTypeProperties component

<RadzenListBox FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" 
               Style="width: 100%; height: 100%;"
               InputAttributes="@(new Dictionary<string, object> { { "aria-label", "select property" } })"
        @((context as IContentProperty)?.Name)

@code {
    [Inject] public ExtensionManager ExtensionManager { get; set; } = default!;
    [Inject] public DialogService DialogService { get; set; } = default!;

    [Parameter] public Guid Id { get; set; }

    public IEnumerable<IContentProperty> Properties { get; set; } = Enumerable.Empty<IContentProperty>();
    public string SelectedProperty { get; set; } = string.Empty;

    private Dictionary<string, IContentProperty> AllContentProperties { get; set; } = new();

    protected override void OnInitialized()
        AllContentProperties = ExtensionManager.GetInstances<IContentProperty>(true);
        Properties = AllContentProperties.Select(x => x.Value);

    private async Task OnPropertySelected()
        if (!string.IsNullOrEmpty(SelectedProperty))
            Console.WriteLine($"Attempting to close dialog with selected property: {SelectedProperty}");
            await InvokeAsync(() => {
            Console.WriteLine("No property selected or SelectedProperty is empty");

I presume I need to get reference to the current instance of the Dialogue this component is being opened in? And call close on that?

Anyway. I'm a bit stuck, any help greatly appreciated. As above, it gets the the close line but nothing happens.

Hi @YodasMyDad,

Try the CloseSide method. It should be used for closing side dialogs:

1 Like

:man_facepalming: Thank you. That is now all working perfectly.