Radbutton Requires two clicks to open RadWindow

3 posts, 1 answers
  1. GP
    GP avatar
    58 posts
    Member since:
    Oct 2009

    Posted 06 Apr 2011 Link to this post

    Hi, I have a RadButton that is supposed to open a radwindow when the "OnClientClicked" is fired.  However, the first time this gets fired, nothing happens.  The second time I click on the button...the radwindow opens up.  Am I missing some code?  I am basing this on your demo: http://demos.telerik.com/aspnet-ajax/button/examples/slideshow/defaultcs.aspx.

    Here is the code that I have:
        <telerik:RadCodeBlock ID="rcb1" runat="server">
        <script type="text/javascript">
            function ShowInsertForm() {
                var combo = $find("<%= RadComboBox1.ClientID %>");
                var comboItem = combo.get_selectedItem();
                if (!comboItem) {
                    window.radopen("AddComment.aspx", "UserListDialog");
                else {
                    var string = comboItem.get_text();
                    window.radopen("AddComment.aspx?ID=" + comboItem.get_value(), "UserListDialog");
                return false;
    <telerik:RadButton ID="AddComment" runat="server"
                            AutoPostBack="false" Text="Add Comment" CommandName="Right" OnClientClicked="ShowInsertForm">
        <telerik:RadButton runat="server" ID="btnUpdate" Skin="WebBlue" Text="Update Recipient"></telerik:RadButton>
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" Skin="WebBlue">
                        <telerik:RadWindow ID="UserListDialog" runat="server" Title="Add Comment" Width="755px" Height="460px"
                            ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" />

    I can use a plain old button, and it fires off without a second click, but I would really like to use the radbutton since that will keep my styling the same.

  2. Answer
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 06 Apr 2011 Link to this post

    ShowInsertForm should have the definition of ShowInsertForm(sender, args) I believe is the first thing...

    You also don't need to return anything if AutoPostBack is false, and I would recommended doing it in the ClickING event (not ClickED)as you can cancel the click event if the combo doesnt have an item in it (or whatever else...)

    If both of those fail, startup Firefox\Firebug and check the console tab for script errors.
  3. DevCraft R3 2016 release webinar banner
  4. GP
    GP avatar
    58 posts
    Member since:
    Oct 2009

    Posted 06 Apr 2011 Link to this post

    Yep...I found that right as you were replying.  Thank you.  I changed ShowInsertForm to ShowInsertForm(), and it worked just fine.

    It's the little things that always get ya.

Back to Top