We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Derived forms and designer

I have a GridGroupingControl on a base form. When I make simple changes to the derived forms in the VS designer, the designer will insert code in the derived form setting a number of properties for the GridGroupingControl. This happens even though I havn''t changed any properties of the GridGroupingControl on the derived form. For example, if I simply resize the derived form, a long list of properties will be set for the GridGroupingControl. This is a bit irritating because if I later change these properties on the base form, the changes will not be visible on the derived form. To make the changes visible on the derived form, I need to remove all the unnecesary code inserted by the designer on the derived form. Is there any simple way to make the designer stop setting all these unnecesary properties on the derived form?

4 Replies

AD Administrator Syncfusion Team July 12, 2005 05:09 PM UTC

I added GridGroupingControl to a Form as a protected field. I then added a second form that was derived from the first form, and set the DataSource of the GroupingControl in the derived form''s contructor. In this simple setup, I can see no way to affect the grid from design time of the derived form as there is no reference to it in the derived form''s property window. Changing the size of the derived form does not affect it in my case. In fact, there is no refence to the grid in the designer generated code of teh derived form at all. Now if you have added the GridGroupingControl as a designable Property of the base form, then that is different. We currently do not support visual inheritance for our grids, (only for the tools controls). So, are you doing something to expose the grid at design time in the derived form? I do not know of a way around this that still allows you to design the grid using the designer.


AD Administrator Syncfusion Team July 12, 2005 08:43 PM UTC

I tried to add the grouping control to the base form from code. In this case the control is not visible in the designer on the base form, but it is still visible in the property window on the derived form. (I use VS 2003. Note also that the project must be compiled before the controls on the base form are visible on the derived form.) When I simply resize the derived form, all the properties of the grid that I have set either in the constructor or the in Form.Load on the base form are repeated by the designer in the derived form. In my current project, I have one base form and maybe 20 derived forms. So if I make a change to the grid on the base form, I need to delete the designer generated code in all 20 derived forms for the change to take effect, which is not ideal. I believe I may have found a workaround, though. If I make the grid private on the base form and expose it through a property to the derived form, the designer appears to leave it alone. Anyway, it would be nice if visual intheritance were supported by the grids in a future version.


AD Administrator Syncfusion Team July 13, 2005 12:59 AM UTC

Try declaring the grid to be internal to see if that avoids the problem in the designer. http://www.syncfusion.com/Support/user/uploads/GGC_Design_b42784ab.zip


AD Administrator Syncfusion Team July 14, 2005 09:55 AM UTC

Declaring the grid internal seems to make the designer leave it alone on the derived form, while I can stile set properties from code. I think this solution should work fairly well. I can not use the designer to set properties of the grid on the derived form any longer, but this is not a big issue since they can always be set through code. Thanks for the input.

Loader.
Live Chat Icon For mobile
Up arrow icon