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.
ADAdministrator Syncfusion Team October 28, 2003 08:58 AM
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.
VAVladimir ArkhipovOctober 28, 2003 10:22 AM
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?
ADAdministrator Syncfusion Team October 28, 2003 12:21 PM
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.
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.
ADAdministrator Syncfusion Team October 28, 2003 04:12 PM
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