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

RadButton Click event not always fired

5 Answers 106 Views
Window
This is a migrated thread and some comments may be shown as answers.
Richard Harrigan
Top achievements
Rank 1
Richard Harrigan asked on 03 Oct 2011, 06:04 PM
Hi,

This button click event failure is happening with many of my modal radwindows's but I explain a representative example.

I press a Menu Button ("Sign On") which brings up a RadWindow where the user may enter thre user id and password.  If the user presses cancel the RadWindow is closed (window.Closed()) and disappears properly.    I then press the sign on button again and nothing happens.  I click it again and the RadWindow appears.  An interesting point is that if I address stop on the click event the RadWindow will appear on the first click. 

This also happens on RadButton clicks where the button is on the RadWindow form.  In many instances more than two clicks are required.  I also tried modeless windows but have the same problem.

It is almost like these windows are not actually be cleared out?

Thanks
Rich

<telerik:RadMenu Name="radMenu" Grid.Row="0" HorizontalAlignment="Right" >
            <telerik:RadMenuItem Name="menuSignOn"
                                 Header="Sign On"
                                 Click="menu_Click">
            </telerik:RadMenuItem>
        </telerik:RadMenu>
 
 
----- Create Window ------
 
#region SignOn
 
            if (((RadMenuItem)source).Name == "menuSignOn")
            {
                String tabName = ((RadMenuItem)source).Header as String;
                if (tabName == "Sign On")
                {
                    this.signOnWindow.Content = new SignOn();
                    this.signOnWindow.Tag = this;
                    this.signOnWindow.Height = 200;
                    this.signOnWindow.Width = 325;
                    this.signOnWindow.Header = "Sign On";
                    this.signOnWindow.ResizeMode = ResizeMode.NoResize;
                    this.signOnWindow.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterScreen;
                    this.signOnWindow.ShowDialog();
                }
                else
                {
                    RadMenuItem subMenu = SetMenuItem(this.radMenu, "menuFile", false);
                    subMenu = SetMenuItem(this.radMenu, "menuExecute", false);
                    subMenu = SetMenuItem(this.radMenu, "menuDesignMode", false);
                    subMenu = SetMenuItem(this.radMenu, "menuSignOn", true);
                    subMenu.Header = "Sign On";
                }
            }
 
            #endregion SignOn
 
 
---- Close RadWindow ----
 
 
 private void btnConnect_Click(object sender, RoutedEventArgs e)
        {
            // Put in code to call server to validate user
 
            RadWindow window = RadWindow.GetParentRadWindow(this);
            window.DialogResult = true;
            window.Close();
        }
 
        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            RadWindow window = RadWindow.GetParentRadWindow(this);
            window.DialogResult = false;
            window.Close();
        }
 
 
--- Callback ----
 
 #region signOnWindow_Closed
 
        void SignOnWindow_Closed(object sender, WindowClosedEventArgs e)
        {
            if (e.DialogResult == null)
                return;
            RadMenuItem subMenu = SetMenuItem(this.radMenu, "menuFile", true);
            SetSubMenuItem(subMenu, "menuSave", false);
            SetSubMenuItem(subMenu, "menuSaveAs", false);
            SetSubMenuItem(subMenu, "menuClose", false);
            SetSubMenuItem(subMenu, "menuExport", false);
            subMenu = SetMenuItem(this.radMenu, "menuExecute", false);
            subMenu = SetMenuItem(this.radMenu, "menuDesignMode", false);
            subMenu = SetMenuItem(this.radMenu, "menuSignOn", true);
            subMenu.Header = "Sign Off";
        }
 
#endregion signOnWindow_Closed

 

5 Answers, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 05 Oct 2011, 04:43 PM
Hi Richard Harrigan,

I tried to reproduced this issue, using the mentioned scenario without any success. I have attached a sample project. We want to investigate this, so it would be great if you modify it and resend it back to us.

Also when using multiple regular RadWindows (non-modal) it is expected the first click not to fire the RadButton's event. We use Popup to display the RadWindow. So when two or more RadWindows are displayed at the same time, the first click will focus the RadWindow and the second will fire the RadButton's event. 

Regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Richard Harrigan
Top achievements
Rank 1
answered on 05 Oct 2011, 06:21 PM
Hi,

I tested your program and experienced the same problem.  However in the xaml you had GotFocus="RadWindow_GotFocus" which did not compile?  I assume this is needed to make your example work.  Please explain.


Thanks
Rich
0
Ivo
Telerik team
answered on 06 Oct 2011, 07:16 AM
Hi Richard Harrigan,

The RadWindow_GotFocus is there, because I made some tests, and I forgot to remove it. Could you please create a short movie demonstrating the issue you are experiencing and send it to us into a support ticket?

Regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Richard Harrigan
Top achievements
Rank 1
answered on 06 Oct 2011, 05:35 PM
Hi,

I re-tested your example but this time instead of using the mouse I used the space bar to click a button.in the RadWindow.  I could not make it fail and when I retried the mouse again I got intermittant failures.  Have you ever heard of this kind of problem with a mouse?  I am using a Microsoft "Bluetooth" Notebook Mouse 5000.  I will replace the mouse and retry.
Thanks

Rich
0
Ivo
Telerik team
answered on 07 Oct 2011, 07:51 AM
Hi Richard Harrigan,

No, we are not aware of such a problem using modal Windows. It should not be different with another mouse. Could you please capture a short video and send it to us via a support ticket?

All the best,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Window
Asked by
Richard Harrigan
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Richard Harrigan
Top achievements
Rank 1
Share this question
or