Thursday, July 24, 2008  



 FarPoint Technologies
 (800) 645-5913

 fpsales@fpoint.com



     
 »Spread for Windows Forms » Product Tour » Models » Custom

Previous Creating a Custom Sheet Model Next

  Back to Top
 Custom Sheet Model
You can use a sheet model as a template for a new custom model. For example, consider making a custom data model. Using a custom data model requires creating a class which implements ISheetDataModel, then setting an instance of the class into the SheetView.Models.Data property.

ISheetDataModel is the only interface required, assuming that you do not need any of the optional interfaces. All of the optional interfaces are implemented by DefaultSheetDataModel, so if you want any of them implemented on your data model, it may be easier to simply subclass DefaultSheetDataModel.

In BaseSheetDataModel, the Changed event is also implemented for you, along with the overloaded FireChanged method, so you do not need to provide an implementation of the event either. The event itself is the only thing in BaseSheetDataModel which is not virtual. FireChanged and OnChanged are protected members of BaseSheetDataModel and are not part of any interface. They are virtual helper methods for the Changed event. The only difference between FireChanged and OnChanged is that OnChanged takes the EventArgs argument, and FireChanged takes the arguments used to create the EventArgs. FireChanged will not create the EventArgs object unless there is actually a handler attached to the delegate, so it is better to use that in subclasses for firing the event.



    
 Have a question?
Have a Question? Ask Us!
Subscribe to the RSS feed!RSS Subscribe
 

 
SD Times 'TOP 100' Industry Innovator - Read the press release (pdf)

Tour Home
Overview
Appearance
User Interaction
Cell Types
Formulas
Managing Data
Data Binding
Import/Export
Printing
Keyboard Interaction
Shapes
Models
Spread Designer
 
Map

Copyright © 1991-2007 FarPoint Technologies, Inc. All rights reserved. All names are property of their respective owners.