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

RadWindow BringToFront Bug

11 Answers 218 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rashad Rivera
Top achievements
Rank 1
Rashad Rivera asked on 09 May 2012, 10:35 PM
Hello All,

Found another bug in the RadWindow control.  The attached exception is thrown once in a while due to an unchecked conidtion in the WindowHostBase class.

The fix is below but you will have to compile it yourself until they get around to fixing their code product. 

1) In the 'Telerik.Windows.Controls.InternalWindow.WindowHostBase' class you will see the BringToFront method defined as:
public virtual void BringToFront()
{
    // FindIndexToAdd finds an index for a new item, not for old which needs to be moved. That's why we subtract 1.
    var targetIndex = this.FindIndexToAdd() - 1;
    var currentIndex = hosts.IndexOf(this);
 
    if (targetIndex != currentIndex)
    {
        hosts.RemoveAt(currentIndex);
        hosts.Insert(targetIndex, this);
    }
}

replace this function with:
public virtual void BringToFront() {
 
    // FindIndexToAdd finds an index for a new item, not for old which needs to be moved. That's why we subtract 1.
    var targetIndex = this.FindIndexToAdd() - 1;
    var currentIndex = hosts.IndexOf(this);
 
    if (targetIndex != currentIndex && targetIndex > 0) {
        if (currentIndex > 0)
            hosts.RemoveAt(currentIndex);
        hosts.Insert(targetIndex, this);
    }
}

 and the issue goes away.

- Rashad Rivera, Omegus Prime, LLC

11 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 15 May 2012, 09:09 AM
Hi Rashad,

Thank you for reporting this issue and providing the fix. Although sometimes mistakes are made, our clients' feedback is very crucial for improving our products. We will do our best to fix this issue for our next release ( Q2 2012 ).

Please, excuse us for the inconvenience.

All the best,
Georgi
the Telerik team

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

0
DSamani
Top achievements
Rank 1
answered on 08 May 2014, 06:18 PM
This is still not fixed in Telerik_UI_for_WPF_2014_1_0331_Dev_Hotfix...
0
DSamani
Top achievements
Rank 1
answered on 08 May 2014, 06:19 PM
Or the latest internal build.
0
Rashad Rivera
Top achievements
Rank 1
answered on 09 May 2014, 01:12 AM
That must be why I did not renew my license.  =D

Sorry for bluntness, but I was tired of the bugs. 
0
Georgi
Telerik team
answered on 13 May 2014, 08:06 AM
Hi Byron,

We have researched the issue and ti seems like the exception is in the mentioned code, but the issue leading to the exception is somewhere else. So if we apply the fix suggested by Rashad we will just workaround it and the issue could manifest again.
So our goal is to get to the source of the exception and fix it there, but so far we were not able to debug it as we were not able to reproduce it.
Therefore it would be very helpful if you can provide a simple project where the issue can be reproduced so we get to the bottom of it.

Please, excuse us for the inconvenience caused.


Regards,
Georgi
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Rashad Rivera
Top achievements
Rank 1
answered on 26 Jun 2014, 04:05 PM
Georgi,

I know your just trying to help, but not fixing it is akin to saying "We know it don't work, just code around it so we don't have to". 

In all honesty, Telerik's policy of not treating every bug as a hot item erodes customer confidence in your product.  This is why I said what I said about not renewing.  I mean am I to tell my customers that they need to deal with the bug for 2+ years because "Telerik was unable to reproduce the problem...".  Seriously, I applied the fix myself, performed an internal build, and called it a day.  No way am I going to look bad to my customers because of Telerik's failed policies.

- Sorry if it hurts, but the Truth often does
  Rashad Rivera
0
Kalin
Telerik team
answered on 04 Jul 2014, 01:41 PM
Hello Rashad,

I can assure you that our main goal is to keep the customers satisfied and we are giving our best for doing that on daily bases. However I investigated the situation here and I'm afraid since we are not able to confirm that there is a bug in the piece of code you provided, we cannot simply apply the desired fix blindly. We carefully researched the source code and tested any possible scenarios that can reproduce the issue, but we didn't manage to do it. That is why Georgi kindly asked you for a sample project in his last post as in cases like this we strongly rely on our customers help in order to reproduce and resolve the issue. At last I can also assure you that if you help us to reproduce it on our side by providing a sample project or the exact steps to reproduce, we will deeply investigate the scenario and definitely consider the suggested improvement.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Mike
Top achievements
Rank 1
answered on 02 Dec 2014, 10:41 PM
I am seeing this problem also. I was seeing in the 2014.2 release, so I just installed the latest 2014.3.1021.40 and am still seeing the issue. Here is the weird part, and frankly the part that makes it hard to submit code that demonstrates the issue, it only happens on one PC.

On my main development machine I don't have this error occur. I have several test machines where it does not occur. However, on only one of my systems, this error occurs every time.

I create an instance of a the rad window. Call Activate() on that window. And then the application crashes. It took some doing but I finally got a stack trace on the crash an it is this.

Stack Trace:
  at System.ThrowHelper.ThrowArgumentOutOfRangeException()
  at System.Collections.Generic.List`1.RemoveAt(Int32 index)
  at Telerik.Windows.Controls.InternalWindow.WindowHostBase.BringToFront()
  at Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.BringToFront()
  at Telerik.Windows.Controls.WindowBase.BringToFront()
  at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
  at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

The OS for the machine with the error is Windows 7. So I have tried it on several other Windows 7 systems and there are no problems. However, for some reason on this particular system whenever we call Activate() on the window the app crashes.
0
Rashad Rivera
Top achievements
Rank 1
answered on 03 Dec 2014, 04:36 AM
Mike,

Sorry to say, but I don't think they are every going to fix it.  Just do what I did which is get the latest build, fix this (and any other bugs you know of), and use that in your products.  Telerik does not like it, but neither do my customers when my stuff breaks. 

- Rashad Rivera
​
0
Rashad Rivera
Top achievements
Rank 1
answered on 03 Dec 2014, 04:40 AM
Mike,

Sorry to say, but I don't think they will fix it.  Just do what I did which was get the latest build, fix this and any other bugs you find and use the output binaries and use it in your product.  Telerik does not like that, but then my customers don't like bugs either. 

- Rashad Rivera
0
Vladi
Telerik team
answered on 05 Dec 2014, 12:50 PM
Hello,

As previously state by Kalin and Georgi we have not been able to reproduce the discussed exception on our side. In all of our tests done by our development and QA teams no such ArgumentOutOfRangeException has been observed. As we do our best to provide flawless experience to our clients we have applied a fix for the mentioned BringToFront method which would handle the false scenarios in production mode (non debug mode). We also added a Debugg.Assert check in that method in order to still be able to detect the source of the false index scenarios. Such fix should make the control behave completely safe without any exception but still allow our internal tests to detect the scenarios which have not been observed on our side.

The fix for this issue should be available in our next internal build. We would like to encourage you to try to provide to us more details which could lead us to observing the issue in order to make sure that the source of that false behavior is also handled. All information like:
  • The PC's hardware details. How much RAM does it have, what is its CPU and GPU configuration
  • The specific Windows OS version, does it have the latest OS updates applied
  • The .NET framework version which is applied to that PC's environment
  • And any other PC/environment configuration specific information

Thank you all for your involvement on this matter.


Regards,
Vladi
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Window
Asked by
Rashad Rivera
Top achievements
Rank 1
Answers by
Georgi
Telerik team
DSamani
Top achievements
Rank 1
Rashad Rivera
Top achievements
Rank 1
Kalin
Telerik team
Mike
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or