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

open radwindow with radbutton

3 Answers 133 Views
Button
This is a migrated thread and some comments may be shown as answers.
orim
Top achievements
Rank 1
orim asked on 12 Sep 2012, 08:16 AM
Hi
i open a radwindow with radbutton1. I asign the OpenerElementID="radbutton1".
When i disable the radbutton1.enabled="false" i can still open the radwindow when i click on radbutton1.
Whats wrong here.
Thanks for any help

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Sep 2012, 08:41 AM
Hi Orim,

I was not able to replicate the issue in telerik version 2012, 2, 724, 35. Following is the sample code that I tried which worked as expected at my end. Please provide your code if doesn't helps.

ASPX:
<telerik:RadWindow ID="RadWindow1" runat="server" OpenerElementID="RadButton1"></telerik:RadWindow>
<telerik:RadButton ID="RadButton1" runat="server" Enabled="false"></telerik:RadButton>
<asp:Button ID="btn" runat="server" onclick="btn_Click" />

C#:
protected void btn_Click(object sender, EventArgs e)
    {
        RadButton1.Enabled = false;
    }
Note: I tried disabling the RadButton onclick of an asp:Button.

Regards,
Princy.
0
orim
Top achievements
Rank 1
answered on 12 Sep 2012, 09:45 AM
Hi Princy,
i tried both .net 3.5 and .net 4.0 Telerik Controls. The Problem is if i use IE 9 with Browser Mode and Doc Mode IE9
then i can still open the radwindow when the radbutton is disabled - on click.
If i use IE 8, Firefox it does work
0
Accepted
Marin Bratanov
Telerik team
answered on 14 Sep 2012, 10:59 AM
Hi guys,

Let me shed some light on the matter.

The disabled attribute is relevant only for input elements, while the RadButtons wrapper is an anchor element. This means that, according to specifications, setting disabled="disabled" should not affect its behavior. This works like it is supposed to only in IE and this is why you are experiencing the described behavior.

The RadWindow's OpenerElementID property is a simple one that only attaches an event handler for the onclick event to the target. When the target is disabled this event is not fired by the browser (e.g. for a regular button type submit). For an anchor, however, the event will still be fired and the RadWindow will be shown which is the case with the RadButton.

What I can advise is that you use the OnClientClicked or OnClientClicking events of the RadButton (often along with the AutoPostBack property) to attach a function that will open the RadWindow. This help article explains how a RadWindow can be opened and this blog post explains how to work with the RadButton events.


Regards,
Marin Bratanov
the Telerik team
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 their blog feed now.
Tags
Button
Asked by
orim
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
orim
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or