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

Inherited grid control

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

5 Replies

AD Administrator Syncfusion Team 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.


VA Vladimir Arkhipov 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?


AD Administrator Syncfusion Team 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.


AD Administrator Syncfusion Team 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


VA Vladimir Arkhipov October 29, 2003 12:19 PM UTC

It Works!!! Thanks!

Loader.
Up arrow icon