avoid to hide dialog on esc key press

1 Answer 181 Views
Dialog
Claudio
Top achievements
Rank 2
Bronze
Bronze
Iron
Claudio asked on 01 Jul 2024, 10:03 AM | edited on 01 Jul 2024, 10:03 AM

When i have a TelerikDialog and press ESC key, the dialog is hidden.  

How to avoid this as a default behaviour?

can you add a property for it, for example IgnoreEscapeKey="true"?

there is another way to solve?

 

Thanks

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 04 Jul 2024, 05:36 AM

Hello Claudio,

Thank you for the clear explanation of the scenario you are facing.

To handle the described behavior, use the following approach:

  1. Use one-way binding for the Visible parameter to handle the Dialog visibility manually and define a VisibleChanged event, which will not update the visibility of the Dialog. This configuration is required to prevent an unexpected behavior of the component.
  2. Set the ShowCloseButton parameter to "false".

To see the result from the above approach first-hand, I've prepared this REPL example for you. Please refer to it and let me know if this suits your requirements.

Regards,
Tsvetomir
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
Tags
Dialog
Asked by
Claudio
Top achievements
Rank 2
Bronze
Bronze
Iron
Answers by
Tsvetomir
Telerik team
Share this question
or