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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Inherited grid control

Thread ID:





8217 Oct 28,2003 11:59 AM UTC Oct 29,2003 12:19 PM UTC WinForms 5
Tags: GridControl
Vladimir Arkhipov
Asked On October 28, 2003 11:59 AM UTC

Hi, I inherited my grid from GridControl and loaded it into VS toolbox. In my grid constructor I have these methods: this.ControllerOptions &= ~GridControllerOptions.OleDataSource; this.Model.Options.RefreshCurrentCellBehavior = GridRefreshCurrentCellBehavior.RefreshRow; Now when I drag-drop my grid to my form I have VS task(exception): Object type cannot be converted to target type. And all changes I make to my grid in VS designer are not saved. Please help, Vladimir

Administrator [Syncfusion]
Replied On October 28, 2003 01:58 PM UTC

Currently, only the Syncfusion Essential Tools controls support visual inheritance. We will be adding this support for our grids, but it will be some point after the 2.0 release.

Vladimir Arkhipov
Replied On October 28, 2003 03:22 PM UTC

So you are saying that I cannot use my grids (inherited from either GridControl or GridDataBoundGrid) in VS designer? I should always use original grids and manually set up batch of properties every time I use them?

Administrator [Syncfusion]
Replied On October 28, 2003 05:21 PM UTC

I suspect the reason you are getting the null reference is that when your constructor is called at that point during design time, the Model is null. So, this code chokes. this.Model.Options...... If you want to include this code and have it hit at runtime, but not design-time then you will have to put a DesignMode property check before calling it. That may allow this to work. But in general, you will have to until we add additional deigner support for visual inheritance.

Administrator [Syncfusion]
Replied On October 28, 2003 09:12 PM UTC

You should be able to derive a GridControl, and then drop this derived control onto a form and set its properties there (subject to conditions like the null Model problem that I think you are seeing). You can debug such problems by having a second instance of VisStu running with the first instance attached for debugging using the Tools|Debug Processes menu option. Then open this problem form in the first instance, and the exception should generate a break in the second instance

Vladimir Arkhipov
Replied On October 29, 2003 12:19 PM UTC

It Works!!! Thanks!


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

Live Chat Icon For mobile
Live Chat Icon