Thursday, July 24, 2008
HOME
.NET Product Center
SPREAD FOR .NET BUNDLE
SPREAD FOR WINDOWS FORMS
SPREAD FOR WEB FORMS
INPUT PRO FOR WIN FORMS
SUBSCRIPTIONS
SOA Center
SPREAD FOR BIZTALK SERVER
SPREAD FOR SHAREPOINT SERVER
COM Product Center
DEVELOPER TOOLBOX
DATABASE PACK
SPREAD
TAB PRO
INPUT PRO
LIST PRO
CALENDAR OBJX
BUTTON OBJX
Download Center
TRIALS
UPDATES
Purchase Center
ORDER NOW
GOVT / GSA
LICENSE AGREEMENT
WORLDWIDE RESELLERS
CORPORATE DISCOUNTS
WHY BUY?
Support Center
TECHNICAL SUPPORT
FORUM
SUPPORT OPTIONS
VIDEO LIBRARY
SECTION 508
TRAINING CLASSES
Our Company
CUSTOMERS SAY...
ABOUT US
CONTACT US
JOB OPENINGS
AWARDS
CASE STUDIES
WHY CHOOSE FARPOINT
FarPoint Technologies
(800) 645-5913
fpsales@fpoint.com
»
Spread for Windows Forms
»
Product Tour
»
Models
»
Custom
Creating a Custom Sheet Model
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?
RSS Subscribe
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.