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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Inherit from GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hei,

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?

Regards
Kjetil

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:

[C#.Net]
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new GridRangeStyleCollection RangeStyles
{
get
{
return base.RangeStyles;
}
set
{
base.RangeStyles = value;
}
}


[VB.Net]

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

Best regards,
Haneef

CONFIRMATION

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.

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

;