Declined
Last Updated: 13 Oct 2020 06:58 by ADMIN
Bastian
Created on: 03 Sep 2020 10:40
Category: RibbonForm
Type: Bug Report
2
RadRibbonForm: redundant code is generated when a new partial class is created and its designer is opened

Follow the steps:

1.Create an application and add a RadRibbonForm with name RadRibbonForm1.

2. Create a new class with name RadRibbonForm1.Test.cs and make it partial. It should look like a form.

3. Double click the new class. It will open the designer and some code will be generated in the class which prevents the application from building. The attached gif file with RadRibbonForm illustrates better the specific steps.

2 comments
ADMIN
Dimitar
Posted on: 13 Oct 2020 06:53

Hello,

Step 3 is not valid. Designing the form must happen only by double-clicking the main form class RadRibbonForm1.cs. 

To illustrate that this is not a Telerik-related issue try the same steps with an MS Form. Add Form1.Test.cs file and add some controls to the partial Form1.Test.cs opened at design time -> a compile-time error is shown: 
Error CS0111 Type 'Form1' already defines a member called 'InitializeComponent' with the same parameter types.
Designing a form from a different partial class is not valid action!

The Windows Forms Designer does not support dividing a designable type's definition into more than two partial implementations. This restriction includes creating a new class file that contains a third partial definition of the type, as well as adding a third partial class definition of the type in either the main file or the designer file. 

Here are some resources for similar problems:
https://stackoverflow.com/questions/21822980/a-partial-class-has-multiple-formhttps://social.msdn.microsoft.com/Forums/ie/en-US/79910eaa-84e7-472d-95ee-4b8ddfbf99f0/multiple-partial-class-files-cause-problems-with-forms-designer?forum=winformshttps://stackoverflow.com/questions/37923301/add-partial-form-class-below-windows-form-nodehttps://stackoverflow.com/questions/2485851/winform-partial-classes

Regards,
Dimitar
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/.

ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 03 Sep 2020 10:49

Hello, Bastian,

The possible solution that I can suggest is to use a RadForm and add a RadRibbonBar from the toolbox instead of using a RadRibbonForm. The attached gif file illustrates who to do it.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
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/.

Attached Files: