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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Inherit from GridControl

Thread ID:





66863 Aug 3,2007 02:13 PM UTC Aug 3,2007 03:30 PM UTC WinForms 1
Tags: GridControl
Asked On August 3, 2007 02:13 PM UTC


I want to make a derived control that inherits from your GridControl. The purpose is to make a base control with certain settings (like grid style, selection mode, hiden row headers, etc) to use in our project.

When I make my custom control and use it in a form, I get the problem with all the base styles being re-generated by the designer in InitializeComponent(). I have made changes to the base styles in my custom derived grid. I know one solution is to override the property and set the DesignerSerializationVisibility attribute to Hidden. But what if I want the user to be able to change this property? Ideally the code should only be re-generated by the designer if it changes from the custom control.

For simple properties I can override them in my control class and set the DefaultValue attribute to what I want to be default.

Do you have any ideas or tips with this issue?


haneefm [Syncfusion]
Replied On August 3, 2007 03:30 PM UTC

Hi Kjetil,

In your Gridcontrol-derived class try to override these methods using the new keyword and specify DesignerSerializationVisibility.Hidden:

[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new GridRangeStyleCollection RangeStyles
return base.RangeStyles;
base.RangeStyles = value;


Public Shadows Property RangeStyles() As GridRangeStyleCollection
Return MyBase.RangeStyles
End Get
MyBase.RangeStyles = Value
End Set
End Property

Best regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon