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

Header Item Click Issue

14 Answers 49 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Richard asked on 08 Dec 2012, 11:41 AM
This is a difficult one to describe and I can't provide a project as the issue is intermittent. 

I have a number of menus through out my project, some use data binding and some a straight xaml. All of them at some time and with increasing frequency are experiencing what I think is a bug.

When I click on the header menu item to open the menu as a dropdown it seems to automatically click one of the menu items. 
For example I have a menu of 10 items, sometimes clicking this menu does not open the menu , it randomly selects one of the first 3 items and runs them.

It's almost like the mouse down event opens in the menu and the mouse up event registers as a click on one of the menu items. But it happens so fast you can't see the menu open and close.

Any ideas? 

Thanks,
Richard

14 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 10 Dec 2012, 09:49 AM
Hi Richard,

Thanks for reporting this. Are you using different threads in your application or Thread.Sleep? We've reproduced a similar problem and it is in our to-do list, but it is dedicated to different processes in one application and usage of Thread.Sleep. Maybe you have faced the same problem?

Looking forward to hearing from you.

Greetings,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 10 Dec 2012, 10:13 AM
Hi Rosen 

Thanks for the reply, I'm not explicitly using different threads or thread.sleep. I to have a timer on the parent main.xmal and there would be some async jobs running. I wonder if they use thread.sleep internally and if that could be the issue? 

Is there a work around available ? 

Cheers,
Richard
0
Rosen Vladimirov
Telerik team
answered on 10 Dec 2012, 11:20 AM
Hello Richard,

Unfortunately the issue is quite complicated and we have to investigate it further to have fix or even good workaround. As you have said it is intermittent and debugging it is quite a difficult task. But you can try using Dispatcher or DispatcherTimer in your application instead of Timer, this could do the trick for your case. If you are already using DispatcherTimer, could you send us a small part of the code where it is declared and used? Also code of the Tick event handler will be very helpful.

Thanks in advance for your help and understanding.

Kind regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 10 Dec 2012, 11:35 AM
Hi Rosen,

This is on the Main silverlight page for the whole application, the pages with the menu's are content pages within this page. 

Here is a snippet of the dispatch timer getting declared and started along with the tick event. The tick event checks the server for some user messages and pops these up as toast notifications. Please let me know if you spot something wrong in there. 

Cheers,
Richard

private readonly TimeSpan _checkForNewEventsSchedule = new TimeSpan(0, 0, 0, 30);
private DispatcherTimer CheckForNewEventsTimer { get; set; }
 
public MainPage()
{
    // Set the Current Telerik Theme
    StyleManager.ApplicationTheme = new Windows7Theme();
 
    InitializeComponent();
     
    CheckForNewEventsTimer = new DispatcherTimer { Interval = _checkForNewEventsSchedule };
    CheckForNewEventsTimer.Tick += CheckForNewEventsTimerTick;
    CheckForNewEventsTimer.Start();
}
 
 
void CheckForNewEventsTimerTick(object sender, EventArgs e)
{
    if (!NetworkInterface.GetIsNetworkAvailable()) return;

    if (LoggedInUser != null && Application.Current.IsRunningOutOfBrowser)
        AdminProxy.GetUsersMessagesAsync();
}
0
Rosen Vladimirov
Telerik team
answered on 11 Dec 2012, 07:38 AM
Hi Richard,

Your code seems correct. It looks like getting messages from the server is taking a little bit longer than expected and if you click on RadMenu while you are still waiting for an answer from the server, you get the error behavior. We are still investigating what is causing this and we will try to provide a permanent fix as soon as we figure it out.

We are really sorry for the caused inconvenience.

Regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 11 Dec 2012, 09:36 AM
Thanks Rosen,

I'll increase my timer for now and that show at least reduce the number of incidents users are having. Is there a bug ticket that I can subscribe so that I know when it has been resolved ? 

Cheers,
Richard
0
Rosen Vladimirov
Telerik team
answered on 11 Dec 2012, 09:46 AM
Hello Richard,

We think we can offer you a workaround that should fix your problem. First of all change the DispatcherTimer with Timer as the DispatcherTimer is working on the UI Thread, so with your code on each 30ms the UI Thread is blocked to do some operations. The other thing you should do is using Dispatcher in your CheckForNewEventsTimerTick - for example you can wrap this code:
if (LoggedInUser != null && Application.Current.IsRunningOutOfBrowser)
        AdminProxy.GetUsersMessagesAsync();
in Dispatcher.BeginInvoke(...).

Could you try this in your application and inform us if it helps? Looking forward to hearing from you.

Kind regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 11 Dec 2012, 10:08 AM
Thanks Rosen,  I have made the changes you have suggested, it will take a while to notice if the issue has gone away but I'll be sure to report back here If I don't see it again this week.

Much appreciated. 
Richard
0
Rosen Vladimirov
Telerik team
answered on 11 Dec 2012, 10:52 AM
Hello Richard,

Thank you for your cooperation. I'll be waiting for your reply.

Kind regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 15 Jan 2013, 11:01 AM
Hi Rosen,

I'm still having this same issue regardless of how I set up the timer. However , I do have some more information on it. 

My page looks like 

---------------------------------
Tool Bar | Item 1 | Item 2 | Item 3
---------------------------------

Grid
-----------------------
-----------------------
-----------------------
-----------------------
-----------------------


With nothing selected in the grid I can click the tool bar menus and it works ok.
If I select some rows, especially if I select all rows, and click the tool bar, 90% of the time I get the phantom menu item click issue.

It's driving me (and my users) crazy, have you any more ideas?

Cheers,
Richard
0
Rosen Vladimirov
Telerik team
answered on 17 Jan 2013, 09:26 AM
Hello Richard,

On each 30 seconds you are blocking the UIThread to do some action and if you click on RadMenuItem at this time, you will receive this unexpected behavior. I would suggest you to use only Timer (not DispatcherTimer), to get the data which you have to place in the UI, and after GetUserMessagesAsync() is completed, to update your UI (you should use Dispatcher.BeginInvoke to do it). I'm attaching a simple project where you will notice that using a DispatcherTimer is causing the problem, but using Timer only is working.

Hopefully this helps.

Regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 17 Jan 2013, 10:27 AM
Hi Rosen,

I don't think my timer is the issue any more, I disabled it and the problem remains. 

I can visit the affected page and click the menu items over and over for a few minutes and never experience the problem, then I select my grid, "ctrl +a"  and click a menu item, about 75% of the time this will trigger the issue with the menu. 

I'm a bit snowed under with work right now but I'll see if I can introduce the issue to your project with the addition of a grid on the weekend.

Cheers,
Richard
0
Rosen Vladimirov
Telerik team
answered on 18 Jan 2013, 01:24 PM
Hi Richard,

Thank you very much for your cooperation. We have reproduced the issue and we have fixed it. The fix will be included in our next internal build.

We have updated your Telerik points as a small sign of our appreciation for your efforts.

All the best,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 18 Jan 2013, 01:29 PM
Fantastic news !! I'll be keeping an eye out for that internal build. 
Thanks for fixing this, my users will have to find something else to complain about now ;)

Richard

Tags
Menu
Asked by
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Rosen Vladimirov
Telerik team
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or