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

Disable radwindow close button.

2 Answers 549 Views
Window
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 05 Aug 2013, 06:36 PM
Hi guys,

How can I disable the close button of a RadWindow? I have a dedicated button for this and So I want to disable the default button in title bar.

Thanks,
Antony.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Aug 2013, 05:06 AM
Hi Antony,

One option is you can use the OnClientShow event of the RadWindow to disable the close button as shown in the following code.

JavaScript:
<script type="text/javascript">
    function OnClientShow1(sender, args) {
        $telerik.$(".rwCloseButton", sender.get_popupElement()).attr('disabled', 'disabled');
    }
</script>

Another option is you can cancel the RadWindow close button click using the OnClientBeforeClose as shown below.

JavaScript:
<script type="text/javascript">
    function OnClientClose1(sender, args) {
        args.set_cancel(true);
    }
</script>

Thanks,
Shinu.
0
Marin Bratanov
Telerik team
answered on 06 Aug 2013, 01:04 PM
Hi guys,

I advise that you use the Behaviors property of the control to declare only the allowed user interactions: http://demos.telerik.com/aspnet-ajax/window/examples/behaviors/defaultcs.aspx.

You may also find interesting the following idea and the comments right below: http://feedback.telerik.com/Project/108/Feedback/Details/37747-add-disabledbehaviors-property-for-radwindow. You can vote on the idea to raise its priority.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Window
Asked by
Antony
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Marin Bratanov
Telerik team
Share this question
or