Spread Windows Forms Developer's Guide
Total Page:16
File Type:pdf, Size:1020Kb
Spread Windows Forms Developer’s Guide 0 Developer's Guide This guide provides introductory conceptual material and how-to explanations for routine tasks for developers using Spread Windows Forms. It describes how an application developer would use the properties and methods in Spread to create spreadsheets on Windows Forms, bind to databases, and otherwise create a grid on data-intensive applications for the .NET platform. Getting Started Understanding the Product Understanding the Spreadsheet Objects Understanding the Underlying Models Customizing the Sheet Appearance Customizing Row, Column, and Cell Appearance Customizing Sheet Interaction Customizing Row or Column Interaction Customizing Interaction with Cell Types Customizing Interaction in Cells Managing Data Binding Managing Data on a Sheet Managing Keyboard Interaction Managing Events from User Actions Managing File Operations Managing Printing Working with the Chart Control Using Touch Support with the Component For more information, be sure to look at the additional helpful resources: For sample information, refer to Getting Started. For complete API reference information, refer to the Assembly Reference (on-line documentation). For a complete list of documentation, refer to the Spread Windows Forms Documentation (on-line documentation). Copyright © GrapeCity, Inc. All rights reserved. Spread Windows Forms Developer’s Guide 1 1 Table of Contents Developer's Guide 0 1. Table of Contents 1-21 Getting Started 22 Handling Installation 22 Installing the Product 22 Licensing a Trial Project after Installation 22 End-User License Agreement 22-23 Creating a Build License 23-24 Handling Redistribution 24-26 Product Requirements 26 Using Windows Regional Settings or Options 26-27 Using Satellite Assemblies for Languages 27 Working with the Component 27 Adding a Component to a Visual Studio 2015 or 2017 Project 27-29 Adding a Component to a Visual Studio 2013 Project 29-31 Understanding Parts of the Component 31-32 Using Smart Tags Drop-Down 32-34 Using Verbs in the Property Window 34-36 Working with Collection Editors 36-37 Adding Support for High DPI Settings 37-39 Understanding the Spread Wizard 39-40 Starting the Spread Wizard 40 Using the Spread Wizard 40-41 Getting More Practice 41 Finding the Documentation 41-43 Getting Technical Support 43 Tutorial: Creating a Checkbook Register 43-44 Adding Spread to the Checkbook Project 44 Copyright © GrapeCity, Inc. All rights reserved. Spread Windows Forms Developer’s Guide 2 Setting Up Rows and Column of the Register 44-46 Setting the Cell Types of the Register 46-48 Adding Formulas to Calculate Balances 48-49 Understanding the Product 50 Product Overview 50-51 Feature Overview 51-52 Camera Shapes 52-53 Cell Types for Cell Functionality 53 Chart Controls on a Sheet 53 Child Controls on a Sheet 53 Column Footers and Group Footers 53 Conditional Formatting 53 Data Binding 53 Excel Support with Import and Export Capabilities 54 External Variable 54 Filtering Data on a Sheet 54 Formula Text Box (Formula Bar) 54 Formula Provider Control 54 Functions and Formulas 54-55 Gradients for Button Cells, Headers, and More 55 Grouping Rows in the Display 55 Grouping Rows or Columns in an Outline 55 Headers with Multiple Columns and Rows 55 Hierarchical Display 55 HitTest for Locating the Cursor 55-56 Indicators and Icons in the Interface 56 Ink Notation Support 56 Keyboard Action Mapping 56 Multiple Sheets 56 Copyright © GrapeCity, Inc. All rights reserved. Spread Windows Forms Developer’s Guide 3 Name Box Control 56 Notes for Cells 56-57 Panes or Viewports 57 Printing and PDF 57 Quick Start Wizard 57 Right-to-Left Layouts 57 Row Preview 57 Searching and Search Dialog 57-58 Shapes, Drawing, and Annotations (Freehand Drawing) 58 Skins and Styles for Customized Appearance 58 Sorting Rows or Columns 58 Spannable Cells 58 Sparklines 58-59 Spread Designer 59 Status Bar 59 Tables 59 Tab Strip and Sheet Name Tabs 59 Text Rendering with GDI 59-60 Title and SubTitle 60 Touch Support 60 Undo and Redo Actions 60 Validation 60 Visual Styles for XP Themes 60 Namespace Overview 60-61 Concepts Overview 61 Shortcut Objects 61-64 Object Parentage 64 Formatted versus Unformatted Data 64-65 Cell Types 65-67 Copyright © GrapeCity, Inc. All rights reserved. Spread Windows Forms Developer’s Guide 4 Underlying Models 67 Understanding the Spreadsheet Objects 68 Working with Sheets 68 Working with the Active Sheet 68-69 Working with Multiple Sheets 69-70 Adding a Sheet 70-71 Working with 1-Based Indexing 71-72 Copying and Inserting a Sheet 72-73 Moving a Sheet 73-74 Removing a Sheet 74-75 Showing or Hiding a Sheet 75-76 Working with Rows and Columns 76 Customizing the Number of Rows or Columns 76-78 Adding a Row or Column 78-79 Removing a Row or Column 79-80 Showing or Hiding a Row or Column 80-81 Working with Headers 81 Understanding Headers 81-82 Creating a Header with Multiple Rows or Columns 82-85 Showing or Hiding Headers 85-87 Working with Cells 87 Working with the Active Cell 87-88 Creating a Range of Cells 88-89 Understanding the Underlying Models 90 Understanding the Types of Sheet Models 90 Understanding the Sheet Model Classes and Interfaces 90-92 Finding More Details on the Sheet Models 92-93 Understanding the Data Model 93-94 Understanding the Axis Model 94-95 Copyright © GrapeCity, Inc. All rights reserved. Spread Windows Forms Developer’s Guide 5 Understanding the Selection Model 95-96 Understanding the Span Model 96 Understanding the Style Model 96-99 Creating a Custom Sheet Model 99-100 Understanding the Optional Interfaces 100-101 Customizing the Sheet Appearance 102 Customizing the Appearance of the Overall Component 102 Setting the Component to the Original Appearance 102-103 Applying a Skin to the Component 103-105 Creating a Custom Skin for a Component 105-108 Customizing the Renderers 108-112 Customizing the Dimensions of the Component 112-113 Customizing the Outline of the Component 113-114 Customizing the Display of the Pointer 114-115 Customizing Painting of Parts of the Component 115-116 Using XP Themes with the Component 116-117 Handling Right-to-Left Layouts 117-118 Applying Theme to Customize the Appearance 118-119 Customizing the Individual Sheet Appearance 120 Setting the Background Colors for a Sheet 120-122 Setting a Background Image for a Sheet 122-123 Displaying Grid Lines on a Sheet 123-126 Adding a Title and Subtitle to a Sheet 126-127 Displaying a Footer for Columns or Groups 127-131 Applying a Skin to a Sheet 131-133 Creating a Custom Skin for a Sheet 133-135 Customizing the Sheet Corner Appearance 135-136 General Style of the Sheet Corner 136-138 Text Display in the Sheet Corner 138-139 Copyright © GrapeCity, Inc. All rights reserved. Spread Windows Forms Developer’s Guide 6 Table Display in the Sheet Corner 139-141 Customizable Cell in the Sheet Corner 141-142 Cell Spans in the Sheet Corner 142-143 Header Count Synchronization in the Sheet Corner 143-144 Drawing (Rendering) Style 144-145 Customizing Row, Column, and Cell Appearance 146 Customizing the Row or Column Appearance 146 Setting the Row Height or Column Width 146-148 Resizing the Row or Column to Fit the Data 148-149 Using Auto Row Height 149-151 Finding Rows and Column That Have Data 151 Creating Alternating Rows and Columns 151-155 Customizing the Appearance of Headers 155-156 Customizing the Default Header Labels 156-158 Customizing Header Label Text 158-160 Customizing the Style of Header Cells 160-162 Adding a Gradient to Header Cells 162-163 Customizing the Header Grid Lines 163-166 Setting the Height or Width of Header Cells 166-167 Creating a Span in a Header 167-169 Customizing the Appearance of a Cell 169-170 Coloring a Cell 170-172 Setting a Background Image to a Cell 172-174 Aligning Cell Contents 174-176 Resizing the Cell to Fit the Data 176-177 Resizing the Data to Fit the Cell 177-178 Customizing Cell Borders 178 Creating and Customizing Cell Borders 178-182 Creating Borders with Diagonal Lines 182-184 Copyright © GrapeCity, Inc. All rights reserved. Spread Windows Forms Developer’s Guide 7 Creating a Complex Border with Multiple Lines 184-186 Creating a Span of Cells 186-188 Allowing Cells to Merge Automatically 188-190 Allowing Cell Data to Overflow 190-192 Creating and Applying a Style for Cells 192-195 Working with Pattern and Gradient Fill Effects 195-196 Using Sparklines 196 Adding a Sparkline to a Cell 196-198 Customizing Markers and Pointers 198-200 Specifying Horizontal and Vertical Axes 200-201 Working with Sparklines 201-204 Customizing Sheet Interaction 205 Customizing Interaction with the Overall Component 205 Customizing the Scroll Bars of the Component 205-209 Customizing the Scroll Bar Tips 209-211 Customizing the Sheet Name Tabs of the Component 211-216 Customizing the User Interface Images 216-218 Allowing the User to Zoom the Display of the Component 218 Customizing the Scale Mode 218-219 Adding a Context Menu to a Component 219-220 Adding a Status Bar 220-221 Hosting the Component on a Web Page 222 Customizing Clipboard Operation Options 222-224 Customizing Undo and Redo Actions 224-225 Locating the Pointer Using HitTest 225 Customizing Interaction Based on Events 225-226 Handling Events of Subeditors 226 Customizing the User Error Messages 226 Customizing Interaction with a Sheet 226-227 Copyright © GrapeCity, Inc. All rights reserved. Spread Windows Forms Developer’s Guide 8 Customizing Viewports 227-231 Customizing Split Boxes 231-233 Customizing the Position in the Display 233-234 Placing Child Controls on a Sheet 234-235