This is a migrated thread and some comments may be shown as answers.

Modal Popup - Close button Click Event

4 Answers 3286 Views
Button
This is a migrated thread and some comments may be shown as answers.
Vishnu
Top achievements
Rank 1
Iron
Veteran
Vishnu asked on 18 Sep 2020, 02:08 PM

I need customized Click event on clicking Modal popup close button.

<WindowActions><WindowAction Name="Close" /></WindowActions>

Instead of above code, I need as below

<WindowActions>
        <WindowAction Icon="@IconName.Close" OnClick="@OnCloseClick" />
 </WindowActions>

 async Task OnCloseClick()
{

}

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 18 Sep 2020, 04:37 PM

Hello Vishnu,

You have a couple of options:

 

 

Regards,
Marin Bratanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Jim
Top achievements
Rank 1
Veteran
answered on 15 Feb 2021, 06:55 PM

What is this component used for?

 

Telerik.Blazor.Components.Popup.TelerikPopup

0
Marin Bratanov
Telerik team
answered on 15 Feb 2021, 07:02 PM

Hi Jim,

This is not a public component that you can use. It is part of the inner workings of our component suite. There simply is no provision in the framework to hide such components from the intellisense, and by definition they must have the public access modifier because they are a razor component. In a future version of the framework it will probably have the feature to mark element ancestry so that tags show up only when applicable and this might reduce the possible components you see in the intellisense.

To add to the original question - you can Follow this item to know when OnClick can be used for the built-in actions of the window: https://feedback.telerik.com/blazor/1505032-fire-onclick-for-built-in-actions-before-the-built-in-action

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Hao
Top achievements
Rank 1
Iron
answered on 26 Oct 2022, 08:39 AM | edited on 26 Oct 2022, 08:55 AM

HI,

Can I close the Dialog box programatically.

The document said Visible is two-way binding but with this snip code, it does not close programatically for me.

I tried to set TriquestraProgressBarVisible from True to False.

Does it needs users to click close?

     ProgressBarVisible = true;
      var id = await _stocktakeScheduleDetailService.SavingStateAsync(Model);
      ProgressBarVisible = false;

 

    <TelerikDialog  @bind-Visible="@ViewModel.ProgressBarVisible">
        <DialogContent>
            Are you sure you want to delete item with 
        </DialogContent>
        <DialogButtons>
        </DialogButtons>
    </TelerikDialog>

 

I did try Loading Container but It could not close programatically

https://docs.telerik.com/blazor-ui/components/loadercontainer/overview

Dimo
Telerik team
commented on 31 Oct 2022, 08:17 AM

@Hao - yes, you can close the Dialog programmatically. Our online demos show this approach in a Button OnClick handler.

Here is a test page that uses your code. I assume that the problem may be related to incorrect Blazor life cycle usage or cross-component parameter values.

Tags
Button
Asked by
Vishnu
Top achievements
Rank 1
Iron
Veteran
Answers by
Marin Bratanov
Telerik team
Jim
Top achievements
Rank 1
Veteran
Hao
Top achievements
Rank 1
Iron
Share this question
or