open radwindow with radbutton

4 posts, 1 answers
  1. orim
    orim avatar
    29 posts
    Member since:
    Mar 2012

    Posted 12 Sep 2012 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Sep 2012 Link to this post

    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.

    <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" />

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

  3. orim
    orim avatar
    29 posts
    Member since:
    Mar 2012

    Posted 12 Sep 2012 Link to this post

    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
  4. Answer
    Marin Bratanov
    Marin Bratanov avatar
    3908 posts

    Posted 14 Sep 2012 Link to this post

    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.

    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.
Back to Top