Completed
Last Updated: 12 Sep 2019 09:32 by ADMIN
Release R3 2019 (LIB 2019.2.819)
Greg
Created on: 13 Aug 2019 12:43
Category: RadialGauge, LinearGauge, BulletGraph
Type: Bug Report
1
RadLinearGauge: System.ArgumentException when creating a LinearGradientBrush with height 0

Please run the attached sample project and follow the steps illustrated in the attached gif file. The following exception occurs:

System.ArgumentException
  HResult=0x80070057
  Message=Rectangle '{X=0,Y=35,Width=156.3333,Height=0}' cannot have a width or height equal to 0.
  Source=System.Drawing
  StackTrace:
   at System.Drawing.Drawing2D.LinearGradientBrush..ctor(RectangleF rect, Color color1, Color color2, Single angle, Boolean isAngleScaleable)
   at System.Drawing.Drawing2D.LinearGradientBrush..ctor(RectangleF rect, Color color1, Color color2, Single angle)
   at Telerik.WinControls.UI.Gauges.LinearGaugeBrushFactory.CreateBrush(GaugeVisualElement owner, GaugeBrushType type)
   at Telerik.WinControls.UI.Gauges.LinearGaugeBar.Paint(Graphics graphics, Rectangle boundingRectangle)
   at Telerik.WinControls.UI.Gauges.LinearGaugeBar.PaintElement(IGraphics graphics, Single angle, SizeF scale)
   at Telerik.WinControls.RadElement.DoOwnPaint(IGraphics graphics, Single angle, SizeF scale)
   at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.PaintChild(RadElement child, IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.VisualElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.PaintChild(RadElement child, IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.VisualElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadControl.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at Telerik.WinControls.RadControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

IMPORTANT: If both colors are changed at design time and you set the Value of RadLinearGauge to 0, this will provoke a similar error leading Visual Studio to crash.

Workaround: specify a minimum width/height for the gauge:

this.radLinearGauge1.MinimumSize = new Size(1, (int)this.linearGaugeBar1.Offset+1);

 

 

24 comments
ADMIN
Dimitar
Posted on: 12 Sep 2019 09:32

Hello Michel,

Ok, thanks. I will investigate this in the ticket.  

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Greg
Posted on: 11 Sep 2019 16:06

Hi Dimitar,

That didn't work - I also tried deleting both the bin and obj folders, to be sure. Note that the project is simply a sample project created by Nadya, and I haven't modified it, except to add the new references. But yes, I'll post it in a private thread, which this was originally (she made it public for some reason,) and I'll address it to you.

Thanks

ADMIN
Dimitar
Posted on: 11 Sep 2019 13:25

Hello Greg,

You can try the following:

  • Close the designer
  • Restart Visual Studio
  • Clean and rebuild the project, you can run it as well.
  • Open the designer

If the above does not work, please open a new support ticket (this is a public thread) and attach your project. This way we will be able to properly investigate this. 

Do not hesitate to contact us if you have other questions.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Greg
Posted on: 11 Sep 2019 13:15

Hi Dimitar,

That worked, but only partially. That is, I added Telerik.WinControls, which was previously missing, and that resolved the previous error ("RootRadElement does not exist".) Now I can run the sample program, but I unable to open the designer for the form. I receive the error in the attached image. I also tested another project that worked before installing the LIB version, and I get the same error when trying to open the form designer. All referenced assemblies are the xxx.40 versions.

I looked in the Bin40 folder for a dll named Telerik.Winforms.UI.RadForm, but there isn't one.

Any other suggestions?

Thanks,

Greg

Attached Files:
ADMIN
Dimitar
Posted on: 11 Sep 2019 10:27

Hello Greg,

The required assemblies (for all Telerik WinForms projects) are Telerik.WinControls, Telerik.WinControls.UI, TelerikCommon.dll. In your case, you need to add the Telerik.WinControls.UI.Design.dll as well. 

In addition, the assmbly version must end with 40 if your project target framework is .NET 4.0 or higher. The assemblies with this version are located in the Bin40 folder. 

Let me know how this works for you.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Greg
Posted on: 10 Sep 2019 17:01

Hi Dimitar,

I added the reference to UI.Design.dll, but that didn't help - the error still persists ("RootRadElement does not exist in the namespace Telerik.Wincontrols".) I also tried adding a reference to TelerikCommon.dll, but that didn't work either. Is there another assembly that should be referenced for that type?

Thanks,

Greg

ADMIN
Dimitar
Posted on: 10 Sep 2019 11:16

Hello Greg,

Using the LIB version would not install the design assmbly in the GAC. Which I believe is causing the issues in this case. Coud you please add a reference to Telerik.WinControls.UI.Design.dll assembly and test this again?

In addition, the official release is scheduled for the next week and the fix will be included there.

I hope this helps. Should you have any other questions, do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Greg
Posted on: 06 Sep 2019 12:32

Hi Nadya,

That didn't work. In fact, it only made things worse. There are many errors now - see attached image.

Thanks

Attached Files:
ADMIN
Nadya | Tech Support Engineer
Posted on: 05 Sep 2019 10:30
Hello, Greg,

According to the attached picture I can see that you have the underlined error line in the Designer.cs file. I assume that when replacing the references this line code remains from the old suits of references. Could you, please, remove the unnecessary line code from the Designer.cs file and see how it works?

I am looking forward to your reply.

Regards,
Nadya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Greg
Posted on: 03 Sep 2019 12:30
Thanks Nadya. One problem remains after replacing the dlls and adding new references. In the "Labels" sample project that you sent to me, there's still an unresolved reference to Telerik.WinControls.RootRadElement. Please see the attached image and let me know what to do about that.
Attached Files:
ADMIN
Nadya | Tech Support Engineer
Posted on: 02 Sep 2019 12:10
Hello, Greg,

After downloading the LIB from your profile, you should have a zip file on your machine which contains dlls (Telerik_UI_For_WinForms_2019_2_819_Trial_dlls.zip). As you have found out, there is not a msi installer file provided. Instead you have all dlls in Bin/Bin40 folder. All you have to do is to replace the current Telerik dlls with the same downloaded from the last LIB.

1. From your Solution Explorer, find the Telerik dlls (Telerik.WinControls, Telerik.WinControls.UI and Telerik.Common) and remove them. You should remove the licenses.licx file as well:



2. Next, by right click on the References section add the new dlls (Telerik.WinControls, Telerik.WinControls.UI and Telerik.Common), which you can find in the Bin/Bin40 folder according to which .NET framework version you use in your application.



3. Rebuild the project and you will have the dlls applied.

Please let me know if there is something else I can help you with. 

Regards,
Nadya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Greg
Posted on: 29 Aug 2019 18:16
Thanks very much - I guess I didn't notice that before. I've downloaded the zip file and extracted it to a temporary folder, and now I just need some instructions as to how to install them, because I don't see any sort of included installer. Should I simply overwrite the existing folders/files in c:\program files (x86)\Progress\Teleric UI with the new ones? And do I need to do something in .Net to use them?
ADMIN
Nadya | Tech Support Engineer
Posted on: 29 Aug 2019 04:45
Hello, Greg,

According to the attached picture I can see that you are on the right place to find the LIB from your profile account. You should click on the block showing your current version of the the Telerik UI for WinForms. For your convenience, I prepared a gif file demonstrating the exact steps where to find the LIB and download it.

Should you have further questions please let me know.

Regards,
Nadya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files:
Greg
Posted on: 27 Aug 2019 12:35

Hi Nadya,

I don't have access to any LIBs, at least not that I can see from my account. Perhaps I'm looking in the wrong place, but I don't see anything about LIBs. Attached is a screen shot of my available Downloads. If you can be more specific about where to look, that would be helpful, as I don't see anything under the Support or other menu options for LIBs.

Thank you

Attached Files:
ADMIN
Nadya | Tech Support Engineer
Posted on: 27 Aug 2019 12:13
Hello, Greg,

We have contacted our Sales team and they have activated a new trial on your behalf with activation date 20-Jul-2019. You are expected to have access to the specific LIB now. Could you please give it a try and see whether the LIB version 2019.2.819 is available for downloading from your account? 

I am looking forward to your reply.

Regards,
Nadya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files:
Greg
Posted on: 26 Aug 2019 19:36

Hi Nadya,

My trial has been extended, but I'm unable to download the LIB because I don't have access. Please send instructions.

Thank you

Greg
Posted on: 22 Aug 2019 14:20
Great Nadya. I appreciate your effort to resolve this. I'll try it once the trial is extended.
ADMIN
Nadya | Tech Support Engineer
Posted on: 22 Aug 2019 11:47
Hello, Greg,

RadLinearGauge supports negative values. I have prepared a sample project with RadLinearGauge showing values from -0.0005 to +0.0005. After the issue has already been addressed, now you can resize it and no exception occurs. The fix will be introduced in the next official release as well, which is scheduled for the middle of September. Meanwhile, feel free to use the previously specified LIB. You can find the sample project attached to this thread. The result is demonstrated below:



Additional information about working with labels you can find here: https://docs.telerik.com/devtools/winforms/controls/gauges/lineargauge/elements/working-with-labels

As to your trial extension request, I have escalated this thread to the sales team. They will contact you as soon as possible in order to extend your trial period. Thus, you will be able again to download the Latest Internal Build, version 2019.2.819 and use it in your application. 

Please feel free to contact us in case of any difficulty. We will be happy to assist you.

Regards,
Nadya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files:
Greg
Posted on: 21 Aug 2019 23:52

I found this problem while using a trial version of Telerik Winforms, and apparently the latest internal builds can only be accessed by licensed users. I am NOT a licensed user, and I certainly don't want to pay for the product while the issues I've identified are still outstanding.

Additionally, my trial has now expired. About a week ago, I emailed my Progress sales rep, and I requested an extension of the trial, but I haven't heard back from him.

Please let me know how I can extend the trial and download/test the latest internal build that you posted.

Thank you

Greg
Posted on: 19 Aug 2019 21:18

Hi Nadya,

Thanks for applying the fixes. By your description, it seems that negative range values can’t be used at all for the Range? The documentation is very limited – I can’t find any documentation at all for LabelFormat. Can you show me an example of how to set the displayed label values from -0.0005 to +0.0005, with 10 divisions, for a range of 0.0 to 100.0?

Regards,

Greg

 

ADMIN
Nadya | Tech Support Engineer
Posted on: 19 Aug 2019 11:04
Hello, Greg,

We addressed the minimum width exception as well as the height exception we have already discussed. I can inform you that the fix concerning this is already available in the Latest Internal Build version 2019.2.819. Feel free to download it from your account and use it in your application. 

According to the question about the negative values, RadLinearGauge offers the LabelFormat property which allows you to format the labels text. Thus, you can control which numeric format to be displayed in the labels. You can set the LabelFormat property of the LinearGaugeLabel to N5:

this.linearGaugeLabels1.LabelFormat = "N5";

After downloading the latest version and applying the correct LabelFormat you can achieve the desired result.

Do not hesitate to contact us if you have other questions.

Regards,
Nadya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Greg
Posted on: 15 Aug 2019 16:36

Hi Nadya,

I'm not sure if you saw my other comment, but there's another problem... The minimum width exception is also thrown when the Range is set to a small value.

For my use, I need to set the range of the gage from -0.0005 to +0.0005, and these values cause an exception. In fact, even much greater values will cause an exception to be generated (-1 to +1, for example.)

I haven't been able to find a workaround for this problem.

 

ADMIN
Nadya | Tech Support Engineer
Posted on: 14 Aug 2019 07:31
Hello, Greg,

I completely understand your concerns and I confirm that this is a workaround for the problem, not a solution. The issue is currently in development and a fix will be introduced as soon as possible in one of the next Latest Internal Builds. Please make sure that you follow this item. Thus, you will get notified once a status change occurs.

I hope this information helps. Should you have any other questions, I will be glad to help.

Regards,
Nadya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Greg
Posted on: 13 Aug 2019 16:30

That's not a solution. Suppose I have a gauge for a gas tank going from 0% (empty) to 100% (full.) You're suggesting that I should specify a minimum width greater than 0 for an empty condition, and less than 100 for a full condition. While that's certainly a workaround, it's not a solution. When the tank is empty, a value of zero should be displayed and the bar should be hidden or not drawn at all. And when it's full, the value should be 100 and the bar should consume the entire gauge display region, not something less.

Can you please have your developers fix the control so it works as advertised?