Convert "Telerik.WinControls.Ui.RadDropDownList" to "System.Windows.forms.Control" not possible.

1 Answer 224 Views
DropDownList
Marcus
Top achievements
Rank 1
Marcus asked on 29 Nov 2021, 06:41 PM | edited on 29 Nov 2021, 06:48 PM

Hi, I have a problem with convert "Telerik.WinControls.Ui.RadDropDownList" to "System.Windows.forms.Control"



I used "Control" from "System.Windows.Forms.Control" to find the elements used in an application I'm reverse engineering, and found a "RadDropDownList" as per the attached screenshot:


I would like to change the index of this list, but I can't convert from "Control" to "RadDropDownList".

Can anyone help me?

Translating the print error:
Cannot cast type "System.Windows.Forms.Control" to "Tlerik.WinControls.UI.RadDropDownList"

Adding:

I already tried to cast "Control" to "ComboBox" and got the following error when running the application. So I tried to cast it with "RadDropDownList":

 

Translating the error:

An unhandled exception occurred in the application. If you click continue, the application will ignore this error and try to continue. If you click Terminate, the application will terminate immediately.

Cannot cast an object of type 'Telerik.WinControls.UI.RadDropDownList' to type 'System.Windows.Forms.ComboBox'

 

Marcus
Top achievements
Rank 1
commented on 29 Nov 2021, 06:48 PM | edited

Thanks

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 30 Nov 2021, 12:25 PM

Hi Marcus,

Thank you for the provided images.

I have tried to reproduce this error on my side but to no avail. Upon checking the errors I am not sure what the first error in the popup is saying. It seems that it is related to the DLLs version. May I ask you to check if all Telerik WinForms assemblies referenced in the project are the same version? If this is not the case, could it be possible to isolate this error in a standalone project? This way I can have a better look and get to the bottom of this error.

I am looking forward to your reply.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Marcus
Top achievements
Rank 1
commented on 02 Dec 2021, 05:06 PM

Yes, Dinko. It was the problem, DLLs version. I changed the version and it worked!!

 

Thanks a lot.

Tags
DropDownList
Asked by
Marcus
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or