Welcome to ComponentOne FlexGrid for .NET

Untitled Document ComponentOne TrueDBGrid for .NET Untitled Document E-mail sent to documentation@componentone.com is for documentation feedback only. We welcome any suggestions to help improve our documentation.

Welcome to ComponentOne FlexGrid for .NET

ComponentOne FlexGrid™ for .NET includes C1FlexGrid, a full-featured grid control that allows you to display, format, and edit data quickly and easily.

FlexGrid for .NET incorporates the latest in data-binding technology -- ADO.NET and ComponentOne DataObjects -- integrating seamlessly with the Microsoft .NET Framework.

ComponentOne custom controls are innovative, flexible, and powerful. If you like FlexGrid, make sure you check out our other award-winning products, which are described in the ComponentOne Products section.

ComponentOne has a user-friendly distribution policy. We want every programmer to obtain a copy of FlexGrid for .NET to try for as long as they wish. Those who like the product and find it useful may buy a license for a reasonable price. The only restriction is that unlicensed copies of FlexGrid for .NET will display a ComponentOne banner every time they are loaded to remind developers to license the product.

We are confident that you will like ComponentOne FlexGrid For .NET. If you have any suggestions or ideas for new features that you'd like to see included in a future version, or ideas for new controls, please call us or write:

Corporate Headquarters

ComponentOne LLC
201 South Highland Avenue
3rd Floor
Pittsburgh, PA 15206 • USA
412.681.4343
412.681.4384 (Fax)

http://www.componentone.com

Overview

Differences Between the .NET and ActiveX Versions of FlexGrid

Differences Between ComponentOne FlexGrid for .NET and ComponentOne True DBGrid for .NET

What's New in ComponentOne FlexGrid for .NET

What's New in Version 2.5

Installation

END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

Licensing FAQs

Technical Support

Redistributable Files

Namespaces

Creating a .NET Project

Adding the C1FlexGrid Component to the Toolbox

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Overview

Overview

The ComponentOne FlexGrid For .NET package consists of two controls:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid Control

C1FlexGrid Control

C1FlexGrid is a powerful, full-featured grid. It provides new ways to display, edit, format, organize, summarize, and print tabular data. It will read and write grids from and to compressed binary files or text files (compatible with Microsoft Access and Excel). C1FlexGrid provides all the basics plus advanced features such as outline trees, sorting, cell merging, masked editing, translated combo and image lists, and automatic data aggregation.

C1FlexGrid can be used in bound mode, where it displays data from any .NET data source, including ADO.NET and ComponentOne DataObjects, or in unbound mode, where the grid itself manages the data.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridClassic Control

C1FlexGridClassic Control

C1FlexGridClassic is a control that derives from C1FlexGrid and provides an object model that is virtually 100% identical to the VSFlexGrid ActiveX control. C1FlexGridClassic was developed to allow easy migration of existing VSFlexGrid projects.

The source code for C1FlexGridClassic is provided as a sample. You can use it as a reference that shows how to use the C1FlexGrid control as a base class in the development of custom grid controls.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Differences Between the .NET and ActiveX Versions of FlexGrid

Differences Between the .NET and ActiveX Versions of FlexGrid

C1FlexGrid and C1FlexGridClassic

In the ActiveX product, we supplied several versions of the FlexGrid control (ADO, DAO, unbound, Unicode, etc.). In the .NET product, there are two versions: C1FlexGrid and C1FlexGridClassic.

C1FlexGrid is not a simple port of the ActiveX control. It is a brand new grid control, written from the ground up in C#, with the same design principles but with a new object model that is more modern, clean, and powerful than the one in the ActiveX control. The C1FlexGrid control can be bound to ADO.NET data sources or used in unbound mode.

To keep the highest level of source-code compatibility with existing applications, and to make the learning curve as smooth as possible for VSFlexGrid users, we also offer the C1FlexGridClassic control.

C1FlexGridClassic is a control that uses C1FlexGrid as a base class and exposes an object model that is virtually identical to the one in VSFlexGrid. We supply the source code to C1FlexGridClassic so you can see exactly how to use the new object model. You can also use it as an example and create your own grid using the C1FlexGrid as a base class.

If you are writing new applications, you should use the C1FlexGrid control. If you are porting existing applications that use the VSFlexGrid ActiveX and want to change as little code as possible, then use the C1FlexGridClassic control.

Rows, Cols Collections

The ActiveX control has Rows and Cols properties that are used to get or set the number of rows and columns on the grid. In the C1FlexGrid control, these properties return row and column collections. The collections have read/write properties that return the number of elements and fixed elements in each collection.

This is probably the most visible change between the controls. Using the ActiveX control, you would write:

Dim r%, c%

c = 1

For r = fg.FixedRows To fg.Rows - 1

Debug.Print fg.TextMatrix(r,c)

Next

Using the C1FlexGrid control, this becomes:

Dim r%, c%

c = 1

For r = fg.Rows.Fixed To fg.Rows.Count - 1

Debug.Print fg(r,c)

Next

Note also that the TextMatrix property was replaced with indexers.

Styles

In the ActiveX control, you can customize the appearance of individual cells or cell ranges using the Cell property. For example, to give the second row a red background, you would write:

fg.Cell(flexcpBackColor, 2, 0, 2, fg.Cols-1) = vbRed

The C1FlexGrid control uses a CellStyle object to customize cell appearance. To make the second row red, you would write:

Dim redStyle As CellStyle = fg.Styles.Add("Red")

redStyle.BackColor = vbRed

fg.Rows(2).Style = redStyle

But this requires three lines of code instead of one! What's the advantage? The main advantage of the new approach is that the new style is an object that can be changed or assigned to new ranges. For example, if you decide to give the red cells a white forecolor and a bold font, you can write:

fg.Styles("Red").ForeColor = vbWhite

fg.Styles("Red").Font = new Font("Arial", 9, FontStyle.Bold)

This will change the appearance of all cells that use the "Red" style. The previous approach would require either (1) clearing all styles and setting everything up again from scratch or (2) scanning all cells in the grid to detect which cells are red, then changing those.

CellStyle objects are used consistently throughout the control, so instead of BackColorFixed and ForeColorSel you can now write Styles.Fixed.BackColor and Styles.Highlight.ForeColor.

CellRange

The Cell property is one of the most powerful elements of the VSFlexGrid object model. It allows you to get or set any property of any cell or cell range with a single command. However, handling colors, text, values, etc. using a single property means using Variants, and this prevents the compiler from catching many subtle problems in case you make mistakes.

The C1FlexGrid replaces the Cell property with a CellRange object that exposes type-safe properties and methods used to access the properties of a cell range. For example, instead of writing:

fg.Cell(flexcpPicture, 5, 5, 10, 10) = theImage

You would write:

Dim rg As CellRange

rg = fg.GetCellRange(5,5,10,10)

rg.Image = theImage

The new approach has two significant advantages:

· It is type-safe, so if the variable theImage contained a string instead of an image, you would get a compiler error instead of a runtime error.

· You get command-completion when writing the code because the types for each property are known.

Typed columns

In the ActiveX version, the ColDataType allowed you to set the type of data that each column contained. This information was used mainly for sorting columns that contained dates or numbers.

The .NET version has a Cols[i].DataType property that determines the type of data the column holds. By default, the DataType for all columns is "object", which means you can store anything in any column. You can set the data type to specific types, however, and the grid will try to coerce any data stored in the grid to the proper type. For example:

fg.Cols[2].DataType = typeof(int);

fg[1,2] = "12"; // ok, value will be set to 12

fg[2,2] = "hello"; // bad value, fire GridError event and ignore

This code would assign the integer 12 to cell (1,2). Cell (2,2) would retain its original value, because the string "hello" cannot be converted to an integer.

If you want to store values of mixed types in a column, you have two options:

1. S the column's DataType property to "object".

2. Use the SetData method with the "coerce" parameter set to false to store a value or object without checking the data type.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Differences Between ComponentOne FlexGrid for .NET and ComponentOne True DBGrid for .NET

Differences Between ComponentOne FlexGrid for .NET and ComponentOne True DBGrid for .NET

Many customers ask what the difference is between our grid components. While both are robust, easy-to-use grid controls that allow you to browse, edit, add, delete, and manipulate tabular data, there are several reasons why you may want to use one over the other.

Both components can be used in bound or unbound mode, but C1FlexGrid allows you to work more easily in unbound mode. With C1FlexGrid you can customize trees and take advantage of its cell merging capabilities. You can also derive from it to create customized grids.

ComponentOne True DBGrid for .NET is better suited for data binding and, therefore, offers more features in that area, including split views and built-in hierarchical binding and grouping.

If you plan to use your grids mainly in bound mode and require advanced features such as splits and hierarchical views, C1TrueDBGrid is the right choice. However, if you plan to work with your grids in unbound mode or need to customize the grid beyond what the object model offers, C1FlexGrid is a better choice.

If you have additional questions about ComponentOne FlexGrid for .NET and ComponentOne True DBGrid for .NET, please visit our web site at http://www.componentone.com.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


What's New in ComponentOne FlexGrid for .NET

What's New in ComponentOne FlexGrid for .NET

This documentation was last revised on August 11, 2005.

Overview of What's New in ComponentOne FlexGrid for .NET

New features have been added to FlexGrid for .NET that allow the user more flexibility, such as:

· Added support for multi-column combos.

· Improved ScrollTips works more reliably.

· Improved CellLabels avoid interference with column resizing.

· Improved style persistence mechanism.

· Improved Excel export filter handling of local currencies.

· Improved AddNew behavior for greater consistency with other grids (TrueDBGrid, Microsoft DataGrid, Microsoft Access).

· Revealed useful methods that were internal or protected.

· Improved security handling to allow running inside of Internet Explorer.

· Added ExtendLastCol setting to PrintGridFlags enumeration.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Feature Overview

Feature Overview

Added support for multi-column combos

Multi-column combos are implemented with DataMaps that implement the new IC1MulticolumnDictionary interface.

The MultiColumnDictionary class has implements IC1MultiColumnDictionary and can be used as a multi-column data map based on string data or on data sources (any object that implements ITypedList).

The MultiColumnDictionary class has two constructors.

One constructor takes a string that contains a pipe-delimited list of items.

Each item contains a tab-delimited list of columns. For example:

· Visual Basic

· C#

· Delphi

The other constuctor takes four parameters: a data source, the name of the column that contains the data stored in the grid, a list of fields to display in the dropdown list, and the index of the column that should be shown in the grid when the list is closed. For example:

· Visual Basic

· C#

· Delphi

Improved AddNew behavior for greater consistency with other grids (TrueDBGrid, Microsoft DataGrid, Microsoft Access)

Before, a new row was added when the cursor moved into the new row template. Now, a new row is added when the user starts editing the new row template.

Revealed useful methods that were internal or protected

The following methods were either internal or protected and are now visible:

IsCellFixed(int row, int col) | Bool
IsCellCursor(int row, int col) | Bool
IsCellHighlighted(int row, int col) | Bool
IsCellValid(int row, int col) | Bool
HitTestInfo HitTest() | No parameters, use the current mouse position.
SetCellStyle(int row, int col, string styleName) | Void, set the style by name.
Styles.Add(string name, string basedOn) | CellStyle, create style by name.

Added ExtendLastCol setting to PrintGridFlags enumeration

This new setting causes the grid to extend the last column on each printed page. It can be used with the PrintGrid method and also with C1PrintDocument. For example:

· Visual Basic

· C#

· Delphi

Note that this is completely independent of the ExtendLastCol grid property, which has no effect on printing.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


What's New in Version 2.5

What's New in Version 2.5

Version 2.5 of the C1FlexGrid includes two major new features and several useful additions.

Support for Custom Editors

Save and Load Microsoft™ Excel files

Automatic Clipboard Support

Custom Behavior for Cell Merging and Grouping

Easier Access to Data Source Objects

More Powerful CellStyle class

New Events

More Speed

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Support for Custom Editors

Support for Custom Editors

You can now use any .NET control as a grid editor. Simply assign an instance of the control to a column's Editor property and the grid will use the control to edit cells in that column.

You can customize the behavior of the custom editors by implementing the IC1EmbeddedEditor interface (defined in C1.Common.dll) thereby improving the integration between the grid and external editors. All controls in the C1Input library now implement IC1EmbeddedEditor and can be used as grid editors (no code is required).

We also provide samples that show how you can use UIType editor classes as grid editors (see the "CustomEditors" in our on-line sample library).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Save and Load Microsoft™ Excel files

Save and Load Microsoft™ Excel files

The SaveGrid and LoadGrid methods now have overloaded versions that allow you to save and load Microsoft Excel files (.xls). The grid uses pure .NET code and does not require Excel to be installed on the computer.

There are also specialized methods called SaveExcel and LoadExcel that provide additional control, allowing you to save grids into specific sheets of Excel workbooks.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Automatic Clipboard Support

Automatic Clipboard Support

The new AutoClipboard property allows the grid to automatically handle the standard clipboard keys to cut, copy, paste, and delete cell values.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Custom Behavior for Cell Merging and Grouping

Custom Behavior for Cell Merging and Grouping

The new CustomComparer property allows you to specify an IComparer class used to determine whether adjacent cells should be merged or grouped.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Easier Access to Data Source Objects

Easier Access to Data Source Objects

The new Row.DataSource property allows easy access to the row's data source. For example, when the grid is bound to an ADO.NET DataView, you can easily get the DataViewRow object attached to each grid row.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


More Powerful CellStyle class

More Powerful CellStyle class

The CellStyle class has a new Editor property that allows you to specify custom editors, and a new Render method that allows you to use the style to paint strings and images into any Graphics object.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


New Events

New Events

The grid now fires events before and after the user adds or removes rows, which allows you to monitor or cancel these actions (BeforeAddRow, AfterAddRow, CancelAddRow, BeforeDeleteRow, and AfterDeleteRow).

There are also new events to support unbound data columns (GetUnboundValue and SetUnboundValue).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


More Speed

More Speed

Version 2.5 has several optimizations that make the grid paint and scroll significantly faster than before.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Installation

Installation

To install FlexGrid for .NET, run the C1FlexGrid.msi installation file provided in the distribution CD (or downloaded from the Web), and follow the instructions.

The installation program will create the directory C:\Program Files\ComponentOne Studio.NET, which contains the following subdirectories:

bin | Contains copies of all binaries (DLLs, EXEs) in the ComponentOne Visual Studio.NET package.
Common | Contains support and data files that are used by many of the demo programs.
Help | Contains online documentation for all Studio components.
C1FlexGrid | Contains samples and tutorials for the C1FlexGrid component.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Installing Demonstration Versions

Installing Demonstration Versions

If you wish to try FlexGrid for .NET and do not have a registration key, install the product as usual but do not provide a registration key.

The only difference between unregistered (demonstration) and registered (purchased) versions of our products is that registered versions will stamp every application you compile so a ComponentOne banner will not appear when your users run the applications.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Uninstalling FlexGrid for .NET

Uninstalling FlexGrid for .NET

To uninstall FlexGrid for .NET, open the Control Panel application and select Add or Remove Programs. Select FlexGrid for .NET and click the Remove button.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

IMPORTANT-READ CAREFULLY: This End User License Agreement (this "EULA") contains the terms and conditions regarding your use of the SOFTWARE (as defined below). This EULA contains material limitations to your rights in that regard. You should read this EULA carefully and treat it as valuable property.

I. THIS EULA.

1. Software Covered by this EULA. This EULA governs your use of the ComponentOne, LLC ("C1") software product(s) enclosed or otherwise accompanied herewith (individually and collectively, the "SOFTWARE"). The term "SOFTWARE" includes, to the extent provided by C1: 1) any revisions, updates and/or upgrades thereto; 2) any data, image or executable files, databases, data engines, computer software, or similar items customarily used or distributed with computer software products; 3) anything in any form whatsoever intended to be used with or in conjunction with the SOFTWARE; and 4) any associated media, documentation (including physical, electronic and on-line) and printed materials (the "Documentation").

2. This EULA is a Legally Binding Agreement Between You and C1. If you are acting as an agent of a company or another legal person, such as an officer or other employee acting for your employer, then "you" and "your" mean your principal, the entity or other legal person for whom you are acting. However, importantly, even if you are acting as an agent for another, you may still be personally liable for violation of federal and State laws, such as copyright infringement.

This EULA is a legally binding agreement between you and C1. You intend to be legally bound to this EULA to the same extent as if C1 and you physically signed this EULA. By installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms and conditions contained in this EULA. If you do not agree to all of the terms and conditions contained in this EULA, you may not install or use the SOFTWARE. If, for whatever reason, installation has begun or has been completed, you should cancel installation or un-install the SOFTWARE, as the case may be. (You may click on the "exit" button or its equivalent to immediately abort installation.) If you do not agree to all of these terms and conditions, then you must promptly return the SOFTWARE to the place of business from which you obtained it in accordance with any return policies of such place of business. Return policies may vary between or among resellers, and you must comply with your particular reseller's return policies as agreed at the point of purchase. If the place of business from which you purchased the SOFTWARE does not honor a complete refund for a period of thirty (30) days from the date of proof of purchase, then you may return the SOFTWARE directly to C1 for a period of thirty (30) days from the date of your purchase. To return the product directly to C1, you must obtain a C1 Return Authorization Number by contacting C1, and you must forward all items purchased, including the proof of purchase, directly to C1. The return must be postage-prepaid, and post-marked within thirty (30) days from the proof of purchase, time being of the essence. The return option to C1 is only available to the original purchaser of an unopened factory packaged item.

II. YOUR LICENSE TO DEVELOP AND TO DISTRIBUTE.

As provided in more detail below, this EULA grants you two licenses: 1) a license to use the SOFTWARE to develop other software products (the "Development License"); and 2) a license to use and/or distribute the Developed Software (the "Distribution License"). Both of these licenses (individually and collectively, the "Licenses") are explained and defined in more detail below.

1. Definitions. The following terms have the respective meanings as used in this EULA:

"Network Server" means a computer with one or more computer central processing units (CPU's) that operates for the purpose of serving other computers logically or physically connected to it, including, but not limited to, other computers connected to it on an internal network, intranet or the Internet. "Web Server" means a type of Network Server that serves other computers more particularly connected to it over an intranet or the Internet.

"Developed Software" means those computer software products that are developed by or through the use of the SOFTWARE. "Developed Web Server Software" means those Developed Software products that reside logically or physically on at least one Web Server and are operated (meaning the computer software instruction set is carried out) by the Web Server's central processing unit(s) (CPU). "Developed Legacy Software" means those Developed Software products that are not Developed Web Server Software, including, for example, stand-alone applications and applications accessed by a file server only. "Redistributable Files" means the SOFTWARE files or other portions of the SOFTWARE that are provided by C1 and are identified as such in the Documentation for distribution by you with the Developed Software. "Developer" means a human being or any other automated device using the SOFTWARE in accordance with the terms and conditions of this EULA.

"Developer Seat License" means that each Developer using or otherwise accessing the programmatic interface or the SOFTWARE must obtain the right to do so by purchasing a separate End User License.

"Source Code" shall mean computer software code or programs in human readable format, such as a printed listing of such a program written in a high-level computer language. The term "Source Code" includes, but is not limited to, documents and materials in support of the development effort of the SOFTWARE, such as flow charts, pseudo code and program notes.

2. Your Development License. You are hereby granted a limited, royalty-free, non-exclusive right to use the SOFTWARE to design, develop, and test Developed Software, on the express condition that, and only for so long as, you fully comply with all terms and conditions of this EULA.

The SOFTWARE is licensed to you on a Developer Seat License basis.

The Developer Seat License means that you may perform an installation of the SOFTWARE for use in designing, testing and creating Developed Software by a single Developer on one or more computers, each with a single set of input devices, so long as such computer/computers is/are used only by one single Developer at any given time and not concurrently. Conversely, you may not install or use the SOFTWARE on a computer that is a network server or a computer at which the SOFTWARE is used by more than one Developer. You may not network the SOFTWARE or any component part of it, where it is or may be used by more than one Developer unless you purchase an additional Development License for each Developer. You must purchase another separate license to the SOFTWARE in order to add additional developer seats, whether the additional developers are accessing the SOFTWARE in a stand-alone environment or on a computer network.

In all cases, you may not use C1's name, logo, or trademarks to market your Developed Software without the express written consent of C1; (b) you must include the following C1 copyright notice in your Developed Software documentation and/or in the "About Box" of your Developed Software, and wherever the copyright/rights notice is located in the Developed Software (“Portions Copyright © ComponentOne, LLC 1991-2002. All Rights Reserved.”); (c) agree to indemnify, hold harmless, and defend C1, its suppliers and resellers, from and against any claims or lawsuits, including attorney's fees that may arise from the use or distribution of your Developed Software; (d) you may use the SOFTWARE only to create Developed Software that is significantly different than the SOFTWARE.

3. Your Distribution License.

License to Distribute Developed Software. Subject to the terms and conditions in this EULA, you are granted the license to use and to distribute Developed Software on a royalty-free basis, provided that the Developed Software incorporates the SOFTWARE as an integral part of the Developed Software in machine-language compiled format (customarily an ".exe", or ".dll", etc.). You may not distribute, bundle, wrap or subclass the SOFTWARE as Developed Software which, when used in a "designtime" development environment, exposes the programmatic interface of the SOFTWARE. You may distribute, on a royalty-free basis, Redistributable Files with Developed Software only.

4. Specific Product Limitations. Notwithstanding anything in this EULA to the contrary, if the license you have purchased is for any of the following products, then the following additional limitations will apply:

a. ComponentOne Reports for .NET Designer Edition. ComponentOne Reports for .NET Designer Edition includes at least: 1) one dynamic link library (c1.win.c1reportdesigner.dll) file known as C1ReportDesigner Component, 2) one executable (ReportDesigner.exe) file known as C1ReportDesigner Application and, 3) the Source Code of the C1ReportDesigner Application. The C1ReportDesigner Component is subject to the general terms and restrictions set forth in this EULA. The C1ReportDesigner Application is an executable file used to design and prepare reports; the C1ReportDesigner Application may be distributed, free of royalties, only in conjunction with the Developed Software.

Subject to the terms and conditions in this EULA, C1 hereby grants you the right to use the C1ReportDesigner Application Source Code. You are hereby also granted the right to modify such Source Code and to create derivative works that are based on the licensed Source Code. You may distribute the derivative works that you develop, solely in object code format and exclusively in conjunction with and/or as a part of the Developed Software. You are expressly not granted the right to distribute, disclose or otherwise make available to any third party the licensed Source Code, any modified version, derivative work, or any portion thereof, in source code format.

C1 shall retain all right, title and interest in and to the licensed Source Code, and all C1 updates, modifications or enhancements thereof. Nothing herein shall be deemed to transfer any ownership or title rights in and to the licensed Source Code from C1 to you.

SOURCE CODE IS LICENSED TO YOU AS IS. C1 DOES NOT AND SHALL NOT PROVIDE YOU WITH ANY TECHNICAL SUPPORT FOR YOUR SOURCE CODE LICENSE.

b. VSView Reporting Edition. VSView Reporting Edition includes at least one executable file listed as “VSRptX.exe” (where X indicates the version number i.e.7,8, etc.), known as “Designer.” The file "VSRptX.exe”, or any upgrade or future versions of the Designer, are subject to the restrictions set forth in this EULA and may not be distributed with your Developed Software or in any other way.

c. Doc-to-Help and ComponentOne Natural Search. You may use Doc-To-Help to create online help, manuals or other documentation in electronic or printed format (the "Output Documents"). You may distribute and incorporate in such Output Documents those files identified in the documentation as Redistributable Files. Except for those specific Redistributable Files, you MAY NOT distribute the SOFTWARE, in any format, to others.

d. Studio Products. You may not share the component parts of the Studio Products licensed to you with other Developers, nor may you allow the use and/or installation of such components by other Developers.

e. ComponentOne Response and SOAP Channel. ComponentOne Response is intended to be installed on a Network Server. C1 grants to you the following rights to the SOFTWARE: a) Installation: You may install one copy of the SOFTWARE on a single Network Server; b) Use: When installed and initialized, the SOFTWARE creates a database file which contains the embodiment of a solution knowledge base (the database hereinafter referred to as the "Knowledge Base").

You may use the SOFTWARE to create Knowledge Bases on one Network Server only. To create or to operate Knowledge Bases in more than one Network Server, you must purchase one additional SOFTWARE license for each additional Network Server.

5. Updates/Upgrades; Studio Subscription. Subject to the terms and conditions of this EULA, the Licenses are perpetual. Updates and upgrades to the SOFTWARE may be provided by C1 from time-to-time, and, if so provided by C1, are provided upon the terms and conditions offered at that time by C1 in its sole discretion. C1 may provide updates and upgrades to the SOFTWARE for free or for any charge, at any time or never, and through its chosen manner of access and distribution, all in C1's sole and complete discretion.

C1 licenses certain of its separately-licensed products bundled together in a product suite, called the C1 "Studio" product line (the "Studio Products"). The exact separately-licensed products that are bundled into the Studio Products may change from time-to-time in C1's sole discretion. If the SOFTWARE is identified as a C1 "Studio" product, then the SOFTWARE is one of the Studio Products. The SOFTWARE and the Studio Products are revised from time-to-time (meaning, for example, revised with updates, upgrades and, in the case of Studio products, possibly changes to which specific products are included in the bundle). For you to be entitled to receive any such revisions to the SOFTWARE or the Studio Products, as the case may be, you must have a valid SOFTWARE license or a valid Studio subscription. The original purchaser of the SOFTWARE or of a Studio product receives a one-year subscription from the date of purchase of the SOFTWARE. After one year, the Studio subscription and/or the SOFTWARE license must be renewed to continue to be entitled to receive the SOFTWARE and/or the Studio Products revisions as the case may be.

6. Serial Number. Within the packaging of the SOFTWARE, a unique serial number (the "Serial Number") is included, which allows for the registration of the SOFTWARE. The Serial Number is subject to the restrictions set forth in this EULA and may not be disclosed or distributed either with your Developed Software or in any other way. The disclosure or distribution of the Serial Number shall constitute a breach of this EULA, the effect of which shall be the automatic termination and revocation of all the rights granted herein.

7. Evaluation Copy. If you are using an "evaluation copy" or similar version, specifically designated as such by C1 on its website or otherwise, then the Licenses are limited as follows: a) you are granted a license to use the SOFTWARE for a period of thirty (30) days counted from the day of installation (the "Evaluation Period"); b) upon completion of the Evaluation Period, you shall either i) delete the SOFTWARE from the computer containing the installation, or you may ii) contact C1 or one of its authorized dealers to purchase a license of the SOFTWARE, which is subject to the terms and limitations contained herein; and c) any Developed Software may not be distributed or used for any commercial purpose.

III. INTELLECTUAL PROPERTY.

1. Copyright. You agree that all right, title, and interest in and to the SOFTWARE (including, but not limited to, any images, photographs, animations, video, audio, music, text, and “applets” incorporated into the SOFTWARE), and any copies of the SOFTWARE, and any copyrights and other intellectual properties therein or related thereto are owned exclusively by C1, except to the limited extent that C1 may be the rightful license holder of certain third-party technologies incorporated into the SOFTWARE. The SOFTWARE is protected by copyright laws and international treaty provisions. The SOFTWARE is licensed to you, not sold to you. C1 reserves all rights not otherwise expressly and specifically granted to you in this EULA.

2. Backups. You may either: (a) copy the SOFTWARE solely for backup or archival purposes; or (b) install the SOFTWARE on a single computer, provided you keep the original solely for backup or archival purposes. Notwithstanding the foregoing, you may not copy the Documentation.

3. General Limitations. You may not reverse engineer, decompile, or disassemble the SOFTWARE, except and only to the extent that applicable law expressly permits such activity notwithstanding this limitation.

4. Software Transfers. You may not rent or lease the SOFTWARE. You may transfer the SOFTWARE to another computer, provided that it is completely removed from the computer from which it was transferred. You may permanently transfer all of your rights under the EULA, provided that you retain no copies, that you transfer all the SOFTWARE (including all component parts, the media and printed materials, any dates, upgrades, this EULA and, if applicable, the Certificate of Authenticity), and that the recipient agrees to the terms and conditions of this EULA as provided herein. If the SOFTWARE is an update or upgrade, any transfer must include all prior versions of the SOFTWARE.

5. Termination. Without prejudice to any other rights it may have, C1 may terminate this EULA and the Licenses if you fail to comply with the terms and conditions contained herein. In such an event, you must destroy all copies of the SOFTWARE and all of its component parts.

6. Export Restrictions. You acknowledge that the SOFTWARE is of U.S. origin. You acknowledge that the license and distribution of the SOFTWARE is subject to the export control laws and regulations of the United States of America, and any amendments thereof, which restrict exports and re-exports of software, technical data, and direct products of technical data, including services and Developed Software. You agree that you will not export or re-export the SOFTWARE or any Developed Software, or any information, documentation and/or printed materials related thereto, directly or indirectly, without first obtaining permission to do so as required from the United States of America Department of Commerce's Bureau of Export Administration ("BXA"), or other appropriate governmental agencies, to any countries, end-users, or for any end-uses that are restricted by U.S. export laws and regulations, and any amendments thereof, which include, but are not limited to, the following:

Restricted Countries: Restricted Countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, Montenegro, North Korea, Serbia, Sudan, and Syria.

Restricted End-Users: Any End-User whom you know or have reason to know will use SOFTWARE or Developed Software in the design, development, or production of missiles and missile technology, nuclear weapons and weapons technology, or chemical and biological weapons. Any national of any of the Restricted Countries, wherever located, who intends to transmit or transport the SOFTWARE or Developed Software to one of the Restricted Countries.

Restricted End-Uses: Any use of SOFTWARE and Developed Software related to the design, development, or production of missiles and missile technology, nuclear weapons and weapons technology, or chemical and biological weapons.

These restrictions change from time to time. You represent and warrant that neither the BXA nor any other United States federal agency has suspended, revoked or denied your export privileges. C1 acknowledges that it shall use reasonable efforts to supply you with all reasonably necessary information regarding the SOFTWARE and its business to enable you to fully comply with the provisions of this Section. If you have any questions regarding your obligations under United States of America export regulations, you should contact the Bureau of Export Administration, United States Department of Commerce, Exporter Counseling Division, Washington DC. U.S.A. (202) 482-4811, http://www.bxa.doc.gov.

7. U.S. Government Restricted Rights. The SOFTWARE and documentation are provided with RESTRICTED RIGHTS. For solicitations issued before December 1, 1995, by the United States of America, its agencies and/or instrumentalities (the "Government"), other than the Department of Defense, the use, duplication or disclosure of the software and documentation provided to the Government under this EULA shall be subject to the RESTRICTED RIGHTS as set forth in subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at 48 CFR ch.1 52.227-19. For solicitations issued before September 29, 1995, by the Department of Defense, the use, duplication or disclosure of the software and documentation provided under this EULA shall be subject to the RESTRICTED RIGHTS as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at 48 CFR ch.2 252.227-7013. You will comply with any requirements of the Government to obtain such RESTRICTED RIGHTS protection, including without limitation, the placement of any restrictive legends on the SOFTWARE, and any license agreement used in connection with the distribution of the SOFTWARE. Manufacturer is ComponentOne, LLC, 201 South Highland Avenue, 3rd Floor, Pittsburgh, Pennsylvania 15206 USA. For solicitations issued by the Government on or after December 1, 1995 and the Department of Defense on or after September 29, 1995, the only rights provided in the software and documentation provided herein shall be those contained in this EULA. Under no circumstances shall C1 be obligated to comply with any Governmental requirements regarding the submission of or the request for exemption from submission of cost or pricing data or cost accounting requirements. For any distribution of the SOFTWARE that would require compliance by C1 with the Government's requirements relating to cost or pricing data or cost accounting requirements, you must obtain an appropriate waiver or exemption from such requirements for the benefit of C1 from the appropriate Government authority before the distribution and/or license of the SOFTWARE to the Government.

IV. WARRANTIES AND REMEDIES.

1. Limited Warranty. C1 warrants that the original media, if any, are free from defects for ninety (90) days from the date of delivery of the SOFTWARE. EXCEPT AS OTHERWISE PROVIDED IN THE PRECEDING SENTENCE, AND TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, C1 EXPRESSLY DISCLAIMS ANY WARRANTY FOR THE SOFTWARE, DOCUMENTATION AND ANYTHING ELSE PROVIDED BY C1 HEREBY AND C1 PROVIDES THE SAME IN “AS IS” CONDITION WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE AND DOCUMENTATION REMAINS WITH YOU. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS. YOU MAY HAVE OTHERS WHICH VARY FROM STATE TO STATE.

2. Limited Remedy. C1's entire liability and your exclusive remedy under this EULA shall be, at C1's sole option, either (a) return of the price paid for the SOFTWARE; (b) repair the SOFTWARE through updates distributed online or otherwise in C1's discretion; or (c) replace the SOFTWARE with SOFTWARE that substantially performs as described in the SOFTWARE documentation, provided that you return the SOFTWARE in the same manner as provided in Section I.2 for return of the SOFTWARE for non-acceptance of this EULA. Any media for any repaired or replacement SOFTWARE will be warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer. THESE REMEDIES ARE NOT AVAILABLE OUTSIDE OF THE UNITED STATES OF AMERICA. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL C1 BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFIT, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF C1 HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME STATES/JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES IN CERTAIN CASES, THE ABOVE LIMITATION MAY NOT APPLY TO YOU.

V. MISCELLANEOUS.

1. This is the Entire Agreement. This EULA (including any addendum or amendment to this EULA included with the SOFTWARE) is the final, complete and exclusive statement of the entire agreement between you and C1 relating to the SOFTWARE. This EULA supersedes any prior and contemporaneous proposals, purchase orders, advertisements, and all other communications in relation to the subject matter of this EULA, whether oral or written. No terms or conditions, other than those contained in this EULA, and no other understanding or agreement which in any way modifies these terms and conditions, shall be binding upon the parties unless entered into in writing executed between the parties, or by other non-oral manner of agreement whereby the parties objectively and definitively act in a manner to be bound (such as by continuing with an installation of the SOFTWARE, "clicking-through" a questionnaire, etc.) Employees, agents and other representatives of C1 are not permitted to orally modify this EULA.

2. You Indemnify C1. You agree to indemnify, hold harmless, and defend C1 and its suppliers and resellers from and against any and all claims or lawsuits, including attorney's fees, which arise out of or result from your breach of any of the terms and conditions of this EULA.

3. Interpretation of this EULA. If for any reason a court of competent jurisdiction finds any provision of this EULA, or any portion thereof, to be unenforceable, that provision of this EULA will be enforced to the maximum extent permissible so as to effect the intent of the parties, and the remainder of this EULA will continue in full force and effect. Formatives of defined terms shall have the same meaning of the defined term. Failure by either party to enforce any provision of this EULA will not be deemed a waiver of future enforcement of that or any other provision. Except as otherwise required or superseded by law, this EULA is governed by the laws of the Commonwealth of Pennsylvania, without regard to its conflict of laws principles. The parties consent to the personal jurisdiction and venue of the Commonwealth of Pennsylvania, in the County of Allegheny, and agree that any legal proceedings arising out of this EULA shall be conducted solely in such Commonwealth. If the SOFTWARE was acquired outside the United States, then local law may apply.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Licensing FAQs

Licensing FAQs

This section describes the main technical aspects of licensing. It may help the user to understand and resolve licensing problems he may experience when using ComponentOne .NET and ASP.NET products.

What is Licensing?

How does Licensing Work?

Common Scenarios

Troubleshooting

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


What is Licensing?

What is Licensing?

Licensing is a mechanism used to protect intellectual property by ensuring that users are authorized to use software products.

Licensing is not only used to prevent illegal distribution of software products. Many software vendors, including ComponentOne, use licensing to allow potential users to test products before they decide to purchase them.

Without licensing, this type of distribution would not be practical for the vendor or convenient for the user. Vendors would either have to distribute evaluation software with limited functionality, or shift the burden of managing software licenses to customers, who could easily forget that the software being used is an evaluation version and has not been purchased.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


How does Licensing Work?

How does Licensing Work?

ComponentOne uses a licensing model based on the standard set by Microsoft, which works with all types of components.

NOTE: The Compact Framework components use a slightly different mechanism for licensing than the other ComponentOne components due to platform differences.

When a user decides to purchase a product, he receives an installation program and a Serial Number. During the installation process, the user is prompted for the serial number that is saved on the system. (Users can also enter the serial number by clicking the "License" button on the About Box of any ComponentOne product.)

When a licensed component is added to a form or web page, Visual Studio asks the newly created component for licensing information. The component looks for licensing information stored in the system and generates a key, which Visual Studio saves in two files:

1. a "<projectName>.licenses" resource file which contains the actual key and

2. a "licenses.licx" file that contains references to those resources.

These files are automatically added to the project.

Note that the licenses.licx file is usually not shown in the Solution Explorer; it appears if you press the "Show All Files" button in the Solution Explorer's toolbox, or select "Project | Show All Files" from Visual Studio's main menu.

Later, when the component is created at run time, it gets passed the key that was created at design time and can decide whether to simply accept the key, to throw an exception and fail altogether, or to display some information reminding the user that the software has not been licensed.

All ComponentOne products are designed to display licensing information if the product is not licensed. None will throw licensing exceptions and prevent applications from running.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Common Scenarios

Common Scenarios

Creating components at design time

Creating components at run time

Inheriting from licensed components

Using licensed components in console applications

Using licensed components in Visual C++ applications

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating components at design time

Creating components at design time

This is the most common scenario and also the simplest: the user adds one or more controls to the form, the licensing information is stored in the licenses.licx file, and the component works.

Note that the mechanism is exactly the same for Windows Forms and Web Forms (ASP.NET) projects.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating components at run time

Creating components at run time

This is also a fairly common scenario. You do not need an instance of the component on the form, but would like to create one or more instances at run time.

In this case, the project will not contain a licenses.licx file (or the file will not contain an appropriate key for the component) and therefore licensing will fail.

To fix this problem, add an instance of the component to a form in the project. This will create the licenses.licx file and things will then work as expected. (The component can be removed from the form after the licenses.licx file has been created).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Inheriting from licensed components

Inheriting from licensed components

If a component that inherits from a licensed component is created, the licensing information to be stored in the form is still needed. This can be done in two ways:

1. Add a LicenseProvider attribute to the component.

This will mark the component as licensed. When a component is added to a form, Visual Studio will create and manage the licenses.licx file, and the base class will handle the licensing process as usual. No additional work is needed. For example:

[LicenseProvider(typeof(LicenseProvider))]

class MyGrid: C1.Win.C1FlexGrid.C1FlexGrid

{

// ...

}

2. Add an instance of the base component to the form.

This will embed the licensing information into the licenses.licx file as in the previous scenario, and the base component will find it and use it. As before, the extra instance can be deleted after the licenses.licx file has been created.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using licensed components in console applications

Using licensed components in console applications

When building console applications, there are no forms to add components to, and therefore Visual Studio won't create a licenses.licx file.

In these cases, create a temporary Windows Forms application and add all the desired licensed components to a form. Then close the Windows Forms application and copy the licenses.licx file into the console application project.

Make sure the licensex.licx file is configured as an embedded resource. To do this, right-click the licenses.licx file in the Solution Explorer window and select Properties. In the property window, set the "Build Action" property to "Embedded Resource".

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using licensed components in Visual C++ applications

Using licensed components in Visual C++ applications

It seems there is a bug in VC++ 2003. The licenses.licx is ignored during the build process, therefore the licensing information is not included in VC++ applications.

To fix this problem, extra steps must be taken to compile the licensing resources and link them to the project. Note the following:

1. Build the C++ project as usual. This should create an exe file and also a licenses.licx file with licensing information in it.

2. Copy the licenses.licx file from the app directory to the target folder (Debug or Release).

3. Copy the C1Lc.exe utility and the licensed dlls to the target folder. (Don't use the standard lc.exe, it has bugs.)

4. Use C1Lc.exe to compile the licenses.licx file. The command line should look like this:

c1lc /target:MyApp.exe /complist:licenses.licx /i:C1.Win.C1FlexGrid.dll

5. Link the licenses into the project. To do this, go back to Visual Studio, right-click the project, select properties, and go to the Linker/Command Line option. Enter the following:

/ASSEMBLYRESOURCE:Debug\MyApp.exe.licenses

6. Rebuild the executable to include the licensing information in the application.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Troubleshooting

Troubleshooting

We try very hard to make the licensing mechanism as unobtrusive as possible, but problems may occur for a number of reasons.

Below is a description of the most common problems and their solutions.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


I have a licensed version of a ComponentOne product but I still get the splash screen when I run my project.

I have a licensed version of a ComponentOne product but I still get the splash screen when I run my project.

If this happens, there must be a problem with the licenses.licx file in the project. It either doesn't exist, contains wrong information, or is not configured correctly.

First, try a full rebuild ("Rebuild All" from the Visual Studio Build menu). This will usually rebuild the correct licensing resources.

If that fails, follow these steps:

1. Open the project and go to the Solution Explorer window.

2. Click the "Show All Files" button on the top of the window.

3. Find the licenses.licx file and delete it.

4. Close the project and reopen it.

5. Open the main form and add an instance of each licensed control.

6. Check the Solution Explorer window, there should be a licenses.licx file there.

7. Rebuild the project using the "Rebuild All" option (not just "Rebuild").

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


I have a licensed version of a ComponentOne product on my web server but the components still behave as unlicensed.

I have a licensed version of a ComponentOne product on my web server but the components still behave as unlicensed.

There is no need to install any licenses on machines used as servers and not used for development.

The components must be licensed on the development machine, therefore the licensing information will be saved into the executable (.exe or .dll) when the project is built. After that, the application can be deployed on any machine, including web servers.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


I downloaded a new build of a component that I have purchased, and now I'm getting the splash screen when I build my projects.

I downloaded a new build of a component that I have purchased, and now I'm getting the splash screen when I build my projects.

Make sure that the license key is still valid. If you licensed the component over a year ago, your subscription may have expired. In this case, you have two options:

Option 1 - Renew your subscription to get a new license key.

If you choose this option, you will receive a new key that you can use to license the new components (from the installation utility or directly from the About Box).

The new subscription will entitle you to a full year of upgrades and to download the latest maintenance builds directly from http://prerelease.componentone.com/.

Option 2 – Continue to use the components you have.

Subscriptions expire, products do not. You can continue to use the components you received or downloaded while your subscription was valid.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Technical Support

Technical Support

ComponentOne FlexGrid for .Net is developed and supported by ComponentOne LLC, a company formed by the merger of APEX Software Corporation and VideoSoft. You can obtain technical support using any of the following methods:

ComponentOne Web site

ComponentOne HelpCentral

Internet e-mail

Peer-to-Peer newsgroup

Documentation

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ComponentOne Web site

ComponentOne Web site

The ComponentOne Web site at www.componentone.com provides a wealth of information and software downloads for FlexGrid for .Net users, including:

· Descriptions of the various support options available through the ComponentOne Service Team.

· Answers to frequently asked questions (FAQ's) about our products, organized by functionality. Please consult the FAQ's before contacting us directly, as this can save you time and also introduce you to other useful information pertaining to our products.

· Free product updates, which provide you with bug fixes and new features.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ComponentOne HelpCentral

ComponentOne HelpCentral

ComponentOne HelpCentral is the new online resource for Visual Studio developers and Help authors. Visit HelpCentral to get information on ComponentOne products, view online demos, get Tech Tips and answers to frequently asked questions (FAQ's), search the ComponentOne knowledgebase and more!

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Internet e-mail

Internet e-mail

For technical support through the Internet, e-mail us at:

Support.FlexGrid.NET@componentone.com

To help us provide you with the best support, please include the following information when contacting ComponentOne:

· Your ComponentOne product serial number.

· The version and name of your operating system.

· Your development environment and its version.

For more information on technical support, go to:

www.componentone.com/support

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Peer-to-Peer newsgroup

Peer-to-Peer newsgroup

ComponentOne also sponsors peer-to-peer newsgroups for users. ComponentOne does not offer formal technical support in this newsgroup, but instead sponsors it as a forum for users to post and answer each other's questions regarding our products. However, ComponentOne may monitor the newsgroups to ensure accuracy of information and provide comments when necessary. You can access the newsgroup from the ComponentOne Web site at http://helpcentral.componentone.com/Newsgroups.aspx.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Documentation

Documentation

ComponentOne documentation is available with each of our products in HTML Help, Microsoft Help 2.0 (.NET, ASP.NET and Mobile Device products only), and PDF format. All of the PDFs are also available on HelpCentral. If you have suggestions on how we can improve our documentation, please email the Documentation team. Please note that e-mail sent to the Documentation team is for documentation feedback only. Technical Support and Sales issues should be sent directly to their respective departments.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Redistributable Files

Redistributable Files

ComponentOne FlexGrid for .NET is developed and published by ComponentOne LLC. You may use it to develop applications in conjunction with Microsoft Visual Studio or any other programming environment that enables the user to use and integrate the control(s). You may also distribute, free of royalties, the following Redistributable Files with any such application you develop to the extent that they are used separately on a single CPU on the client/workstation side of the network:

· C1.Common.dll

· C1.Win.C1Flexgrid.Classic.dll

· C1.Win.C1Flexgrid.dll

Site licenses are available for groups of multiple developers. Please contact Sales@ComponentOne.com for details.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Namespaces

Namespaces

Namespaces organize the objects defined in an assembly. Assemblies can contain multiple namespaces, which can in turn contain other namespaces. Namespaces prevent ambiguity and simplify references when using large groups of objects such as class libraries.

The general namespace for ComponentOne Windows products is C1.Win. The namespace for the FlexGrid control is C1.Win.C1FlexGrid. The following code fragment shows how to declare a C1FlexGrid control using the fully qualified name for this class:

· Visual Basic

· C#

· Delphi

Namespaces address a problem sometimes known as namespace pollution, in which the developer of a class library is hampered by the use of similar names in another library. These conflicts with existing components are sometimes called name collisions.

For example, if you create a new class named Column, you can use it inside your project without qualification. However, the C1FlexGrid assembly also implements a class called Column. So, if you want to use the C1FlexGrid class in the same project, you must use a fully qualified reference to make the reference unique. If the reference is not unique, Visual Studio .NET produces an error stating that the name is ambiguous. The following code snippet demonstrates how to declare these objects:

· Visual Basic

· C#

· Delphi

Fully qualified names are object references that are prefixed with the name of the namespace where the object is defined. You can use objects defined in other projects if you create a reference to the class (by choosing Add Reference from the Project menu) and then use the fully qualified name for the object in your code.

Fully qualified names prevent naming conflicts because the compiler can always determine which object is being used. However, the names themselves can get long and cumbersome. To get around this, you can use the Imports statement (import in C#) to define an alias — an abbreviated name you can use in place of a fully qualified name. For example, the following code snippet creates aliases for two fully qualified names, and uses these aliases to define two objects:

· Visual Basic

· C#

· Delphi

If you use the Imports statement without an alias, you can use all the names in that namespace without qualification provided they are unique to the project.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating a .NET Project

Creating a .NET Project

This topic demonstrates how to create a new .NET project.

1. From the File menu in Microsoft Visual Studio .NET, select New and click Project. The New Project dialog box opens.

2. Under Project Types, choose either Visual Basic Projects or Visual C# Projects, and select Windows Application from the list of Templates in the right pane.

3. Enter or browse for a location for your application in the Location field and click OK.

A new Microsoft Visual Studio .NET project is created in the specified location. In addition, a new Form1 is displayed in the Designer view.

4. Double-click the C1FlexGrid components from the Toolbox to add them to Form1. For information on adding a component to the toolbox, see Adding the C1FlexGrid Component to the Toolbox.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Adding the C1FlexGrid Component to the Toolbox

Adding the C1FlexGrid Component to the Toolbox

When you install C1FlexGrid, the following new components will appear in the Visual Studio’s toolbox customization dialog box:

· C1FlexGrid

· C1FlexGridClassic

C1FlexGrid is the component that provides new ways to display, edit, format, organize, summarize, and print tabular data.

The C1FlexGridClassic component allows easy migration of existing VSFlexGrid projects.

In order to use these components, you must add it to the Visual Studio Toolbox:

1. Open the Visual Studio IDE (Microsoft Development Environment). Make sure the Toolbox is visible (select Toolbox in the View menu, if necessary). Right-click the Toolbox to open the toolbox context menu.

If you want the C1FlexGrid and C1FlexGridClassic components to appear on their own tab in the Toolbox, select Add Tab from the context menu and type in the tab name, for example, “C1FlexGrid”. Select the tab where you want the component to appear, and right-click that tab and select Customize Toolbox from the context menu. The Customize Toolbox dialog box will open.

2. In the Customize Toolbox dialog box, go to the .NET Framework Components tab. Sort the list by Namespace (click the Namespace column header) and check the check box for the component belonging to namespace C1.Win.C1FlexGrid.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using the C1FlexGrid Control

Using the C1FlexGrid Control

The C1FlexGrid control allows you to display, edit, group and summarize data in a grid format. The grid can be bound to a data source or it can manage its own data.

The C1FlexGrid control has a rich object model with the following elements:

The following sections walk you through the main features in the C1FlexGrid control:

Layout | Describes how to set up the grid dimensions and layout.
Selection | Describes the concepts of "current cell" and "selection".
Editing Cells | Describes how to implement simple text editing, drop-down lists and combo lists, cell buttons, editing masks, and data validation.
Formatting Cells | Describes how to customize the appearance of the grid by formatting numbers, dates, and boolean values, or by changing fonts, colors, alignment, and pictures for individual cells or ranges.
Merging Cells | Describes how to change the grid display so that cells with similar contents are merged, creating "grouped" views that highlight relationships in the data.
Outlining and Summarizing | Describes how to add subtotals to grids and how to build outline trees.
Data Binding | Discusses the basic aspects of ADO/OLEDB and DAO data-binding.
Saving, Loading, and Printing | Describes how you can save the contents or formatting of a grid and re-load it later, or exchange grid data with other applications such as Microsoft Access and Excel. This section also shows how you can print grids.
Property Groups | Presents a map of the main C1FlexGrid properties cross-referenced by function.

Layout

Selection

Data Binding

Storing and Retrieving Data

Cell Ranges

Cell Images

Formatting Cells

Editing Cells

Outlining and Summarizing

Merging Cells

Saving, Loading, and Printing

FlexGrid Property Groups

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout

Layout

A C1FlexGrid control consists of rows and columns. The collections of rows and columns is exposed by the Rows and Cols properties.

When the grid is bound to a data source, the number of rows and columns is determined by how much data is available in the data source. In unbound mode, you can set them to arbitrary values using the Count property in the collections. For example, the code below sets the grid dimensions to 500 rows by 10 columns:

· Visual Basic

· C#

· Delphi

There are two basic types of rows and columns: fixed and scrollable. Fixed rows remain on the top of the grid when the user scrolls the grid vertically, and fixed columns remain on the left of the grid when the user scrolls the grid horizontally. Fixed cells are useful for displaying row and column header information. (The counts returned by the Count property include fixed and scrollable cells)

You can set the number of fixed rows and columns using the Fixed property in the Rows and Cols collections. For example, the code below creates a grid with two fixed rows and no fixed columns:

· Visual Basic

· C#

· Delphi

The Rows and Cols collections also contain methods for inserting, deleting, and moving rows and columns on the grid. You can use their Item property (an indexer) to access individual elements (rows and columns) in each collection.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Editing Columns with the C1FlexGrid Column Editor

Editing Columns with the C1FlexGrid Column Editor

If you prefer, you can set up the grid columns at design time instead of writing code to do it. Select the grid in .Net, go to the Properties window and click the ellipsis button next to the Cols property, or right-click the control and select the Edit Columns menu. This will bring up the Column Editor shown below:

In bound mode, the editor can be used to select which fields in the DataSource should be displayed, their order, column captions, widths, and alignment. In unbound mode, the editor is also used to select column data types.

The editor allows you to perform the following actions:

· Reorder Columns: You can move columns to new positions by dragging them by the header cells with the mouse.

· Adjust Column Widths: You can adjust column widths with the mouse, by dragging the right edge of the header cells with the mouse. You can also select multiple columns by shift-clicking the header cells, and then set all column widths at once using the property window. Setting the column width to –1 restores the default width.

· Set Column Properties: Whenever one or more columns are selected, you can see and edit their properties in the property grid on the left of the editor.

· Insert or Remove Columns: Use the toolbar to insert columns before or after the selection (useful mostly in unbound mode), or to remove columns.

· Use the Toolbar to Perform Common Tasks: The table below describes the function of the buttons on the toolbar:

These buttons are toggles that control the property grid. The first one determines whether the properties for the selected columns should be displayed in alphabetical or categorized order. The second determines whether the property grid should display s description for the properties selected.

Undo: Cancels all changes and reverts the grid columns to their original state.

Insert Column: Insert columns to the left or to the right of the selection. These buttons are enabled only of the grid is not bound to a data source.

Remove Column: Removes the selected column.

Column Width: Make all selected columns have the same width, make them wider or narrower.

Make Visible: Makes all columns visible. If you change the Visible property of a column to false, it will be hidden, and therefore you won't be able to select it with the mouse. Use this button to show all columns so you can select and edit them.

Alignment: Align column content to the left, center, or right. These buttons only affect the scrollable area of the grid. To set the alignment for the header columns, select the columns and set the TextAlignFixed property.

AutoResize: This toggle button determines whether the grid should automatically resize all columns to fit their contents when the grid is bound to a data source.

Reload from Datasource: Resets all columns with information from the current DataSource. This button is useful when the grid is bound to a data source and you want to start editing from scratch. The button is disabled when the grid is not bound to a data source.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Selection

Selection

The grid has a cursor cell, which displays a focus rectangle while the grid is active. The user may move the cursor with the keyboard or the mouse, and edit the contents of the cell if the grid is editable.

You can get or set the current cell in code using the Row and Col properties. Setting either of these properties to –1 hides the cursor.

The grid supports extended selections, rectangular ranges of cells defined by two opposing corners: the cursor cell and the cell selection cell. You can get or set the selection cell in code using the RowSel and ColSel properties. You can also set the selection in code using the Select method.

NOTE: When the cursor cell changes, the selection is automatically reset. To create extended selections in code, either set Row and Col before RowSel and ColSel, or use the Select method.

The appearance of the selection is controlled by the following properties:

1. FocusRect determines the type of focus rectangle that is drawn to indicate the cursor cell.

2. HighLight determines when the selection should be highlighted (always, when the control has the focus, or never).

3. HighLight and Focus are cell styles that determine the appearance of the selection (font, color, and border).

The type of selection available is determined by the SelectionMode property. By default, the grid supports regular range selections. You can modify this behavior to prevent extended selections, to select by row, by column, or in listbox mode (listbox mode allows you to select individual rows).

When using the listbox selection mode, you can get or set the selection status for individual rows using theSelected property. You can also retrieve a collection of selected rows using the Selected property. For example, the code below selects all rows that satisfy a condition:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Data Binding

Data Binding

Data binding is a process that allows one or more data consumers to be connected to a data provider in a synchronized manner. If you move the cursor on a data-bound grid, other controls connected to the same data source will change to reflect the new current record. If you edit a value on a data-bound grid, other controls connected to the same data source will change to reflect the new value.

C1FlexGrid supports data binding to ADO.NET data source objects such as DataTable, DataView, DataSet, and DataViewManager.

C1FlexGrid also supports data binding to ComponentOne DataObjects components such as C1ExpressTable, C1ExpressVew, C1ExpressConnection, C1DataView, C1DataTableSource and C1DataSet.

To bind the grid to a data source, assign the data source object to the grid's DataSource property. If the data source object contains more than one table, you must also set the DataMember property a string that specifies which table should be used.

Alternatively, you can assign both properties simultaneously with a single call to the SetDataBinding method.

When you assign a new data source to the grid, it will automatically refresh its columns to bind to the columns available in the data source. You can then customize the columns by moving, hiding, or deleting them. You can also set column properties such as their Width, EditMask and Format.

For an example of reordering the grid columns after binding to a data source, see the ColumnOrder sample in our on-line sample library.

For details about creating ADO.Net data source objects, please refer to the .NET Framework documentation.

For details about using ComponentOne DataObjects, see the C1DataObjects documentation included in the ComponentOne Studio for .NET.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Storing and Retrieving Data

Storing and Retrieving Data

The C1FlexGrid can be used in bound or unbound mode. In bound mode, the grid is connected to a data source, and all the data displayed on the grid comes from the data source. In this mode, changing data on the grid changes it in the underlying data source. In unbound mode, the grid manages its own data source.

In either bound or unbound modes, the easiest way to access data in the C1FlexGrid is using the Row and Column indexers. The indexers allow you to specify a cell in a row or column from which to get or set the data stored there. For example, the following code selects the data in the second cell of a row:

· Visual Basic

· C#

· Delphi

The Item property is another easy way to access data in the C1FlexGrid. The Item property is an indexer that takes row and column indices and gets or sets the data stored in the cell. (You can also use column names as indices). For example, the following code stores row numbers in the first grid column:

· Visual Basic

· C#

· Delphi

When you assign a value to a cell, the grid tries to convert that value into the column's specified DataType. If the conversion fails, the grid fires the GridError event and does not change the cell. You can override this behavior using the SetData method and setting the coerce parameter to False.

When you retrieve data using the indexers, the grid returns the actual data stored in the cell. To retrieve a string containing the formatted version of the data (what the grid displays to the user), use the GetDataDisplay method.

You can also set and retrieve the contents of the selection using the Clip property. This property is especially useful in handling the clipboard and drag-drop operations. By default, the Clip property returns a string with tab characters (Chr(9)) between cells and return characters (Chr(13)) between rows. To use different delimiters, change the ClipSeparators property.

Finally, you can set and retrieve the contents of arbitrary cell ranges using CellRange objects.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Cell Ranges

Cell Ranges

CellRange objects allow you to work on arbitrary groups of cells as a single unit. For example, the code below creates a CellRange object, clears the data in the range, and assigns it a custom style:

· Visual Basic

· C#

· Delphi

The CellRange object has a StyleNew property that retrieves the range style, if one exists, or creates a new one, assigns it to the range, and returns it. This property is convenient in situations where you don't need full-fledged control over formatting. For example, if all you want to do is give the range a red background, you can write:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Cell Images

Cell Images

Each grid cell can display images in addition to the data stored in the cell. This can be done in two ways:

1. You can assign an Image object to a cell using the SetCellImage method. This method allows you to assign arbitrary images to each cell, and is useful if the images are not related to the data in the cell. For example, you may want to use a picture as an indicator that the data in the cell is invalid.

2. You can assign an ImageMap to the column and the grid will automatically map the cell data into a corresponding image. This method is useful in situations where the image contains a representation of the data. For example, the images may contain icons that represent product types.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Formatting Cells

Formatting Cells

One of the main strengths of the C1FlexGrid control is the ability to customize almost every aspect of the appearance of the entire grid and individual cells.

Cell content

Cell appearance

Conditional formatting

Owner-drawn cells

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Cell content

Cell content

To control how the content of the cells is formatted, set the Format property to a format string similar to the ones you use with the String.Format method in the .NET framework. For example, the code below shows short dates on column one and currency values on column two:

· Visual Basic

· C#

· Delphi

You can also use custom formats like the ones used in the Visual Basic Format function (e.g., "#,###", etc.).

You can retrieve the raw grid data using the indexers or the GetData method. To retrieve the formatted data, use the GetDataDisplay method instead. For example:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Cell appearance

Cell appearance

The appearance of the cells (alignment, font, colors, borders etc) is handled with CellStyle objects. The grid has a Styles property that holds the collection of styles used to format the grid. This collection has some built-in members that define the appearance of grid elements, such as fixed and scrollable cells, selection, focus cell, etc. You can change these styles to modify the way the grid looks, and you can also create your own custom styles and assign them to cells, rows, or columns.

Changing the built-in styles is the simplest way to change the appearance of the grid. For example, the code below displays the selection as bold green characters over a red background:

· Visual Basic

· C#

· Delphi

You can also create your own styles and assign them to cells, rows and columns. For example, the code below creates a custom cell style and assigns it to every fifth row:

· Visual Basic

· C#

· Delphi

Here's an example that shows how you can create custom styles and assign them to columns, rows, and cell ranges:

· Visual Basic

· C#

· Delphi

If you prefer, you can set up styles at design time instead of writing code to do it. Just select the grid, go to the Properties window and click the button next to the Styles property. The grid will display the style editor dialog shown below:

The style editor lets you modify existing styles and add new custom ones, which may later be assigned to cells, rows, and columns.

Use the Add button to add a custom style. You can see how your new style appears in the preview area above the style properties.

The Remove button removes the selected custom style. You can rename custom styles by selecting them on the list and typing the new name. The Clear button removes all custom styles and restores the built-in styles to their default values.

The AutoFormat button brings up a secondary dialog that allows you to select a complete set of predefined styles. Here's what the AutoFormat dialog looks like:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Conditional formatting

Conditional formatting

To format cells based on their contents, you can use the CellChanged event to select a style for the cell based on its contents. For example, the code below creates a new style for large currency values and applies it to cells based on their contents:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Owner-drawn cells

Owner-drawn cells

Even though the CellStyle objects offer a lot of control over the cell appearance (back and foreground colors, alignment, font, margins, borders, etc.), sometimes that is not enough. You may want to use a gradient background, or draw some custom graphics directly into a cell. In these cases, you can use the DrawMode property and the OwnerDrawCell event to gain total control over how each cell is drawn.

The DrawMode property determines whether or not the OwnerDrawCell event is fired. The event allows you to override every visual aspect of the cell. The parameters in the OwnerDrawCell event allow you to change the data that is displayed, the style used to display the data, or to take over completely and draw whatever you want into the cell.

You can change the text and image that will be shown in the cell by setting the e.Text and e.Image parameters in the event handler. You can also change the style that will be used to display the cell by setting the e.Style property.

Note that you should not modify the properties of the Style parameter because that might affect other cells. Instead, assign a new CellStyle object to the Style parameter. For example, instead of setting e.Style.ForeColor = Color.Red, assign a whole new style to the parameter using e.Style = _flex.Styles["RedStyle"].

You can also use your own drawing code to draw into the cell, and even combine your custom code with calls to the e.DrawCell method. For example, you could paint the cell background using GDI calls and then call e.DrawCell to display the cell borders and content.

For an example of advanced OwnerDraw code, see the RtfGrid sample in our on-line sample library.

The code below shows an example. It uses a gradient brush to pain the background of the selected cells. First, the code sets the DrawMode property, declares a LinearGradientBrush object and updates the brush whenever the grid is resized:

· Visual Basic

· C#

· Delphi

The second step is handling the OwnerDrawCell event and using the custom brush for painting the cell background. In this example, the foreground is handled by the grid itself, using the DrawCell method in the event argument:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Editing Cells

Editing Cells

By default, the C1FlexGrid control allows users to edit cells by typing into them. You can prevent users from editing the grid by setting the AllowEditing property to False. You can also prevent users from editing specific columns by settings the AllowEditing property to False. (When the grid is bound to a data source, it detects which columns are editable and automatically sets the AllowEditing property.)

To start editing a cell, the user can:

· Start typing into the cell. This replaces the contents of the cell.

· Press F2 or Enter. This puts the grid in edit mode and puts the current cell contents in the editor.

· Double-click a cell. This has the same effect as pressing F2, but selected the character near the click.

The basic editing mode allows users to type values into the cells. If the column being edited has a specific data type, values entered by the user are converted into the proper data type automatically. If the user types a value that cannot be converted into the proper data type, the grid fires a GridError event and ignores the edits.

The basic editing is sufficient for many applications, but the C1FlexGrid has properties and events that allow you to control the editing process and provide selection lists, editing buttons, and advanced validation control.

Starting with version 2.5, the C1FlexGrid also has built-in support for external editors. This allows you to use any control as a grid editor (for example, you can now use the C1Input controls as grid editors).

These features are described below.

Editing with Lists and Combos

Checkboxes

Value-Mapped Lists

Cell Buttons

Masks

Validation

Using Custom Editors

Creating Custom Editors

Controlling Edit Mode

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Editing with Lists and Combos

Editing with Lists and Combos

In many applications, cells have a well-defined list of possible values. In these cases, you can let users select the value from a drop-down list. To do this, build a string containing all the choices separated by pipe characters (e.g., "True|False|Don't know") and assign it to the ComboList property. Each column may have a different list. Setting the ComboList property causes the grid to display a drop-down box next to the cell. The user can click the box (or press F2) to display the list of choices available for that cell.

Another common situation is where cells have a list of common values, but users should be allowed to type something else as well. This can be accomplished with drop-down combos, a combination of text box and drop-down list. To create combos, just start the choice list with a pipe character (e.g. "|True|False|Don't know"), then assign it to the ComboList property as before.

For example, the code below would cause the grid to display a drop-down combolist containing color names on column one, and a drop-down combo on column two. When editing column one, the user must pick a value from the list. When editing column two, the user can pick a value or type in something else:

· Visual Basic

· C#

· Delphi

In some cases, cells in the same column may need different lists. For example, a property list may show properties on the first column and their values on the second. The values depend on the property, so valid choices change from one row to the next. In these cases, you should trap the BeforeEdit event and set the ComboList property to the appropriate list for the current cell. The ComboList property applies to the whole grid.

The built-in ComboBox provides an auto-search feature by default. As the user types a value, the selection will move to the next match. You can disable this feature using the EditOptions property and control the time before the grid resets the auto-search buffer using the AutoSearchDelay property.

The built-in ComboBox also has an auto-cycle feature like the editors in the Visual Studio property window. When you double-click a cell that has a list associated with it, the grid will automatically select the next value. You can also disable this feature using the EditOptions property.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Checkboxes

Checkboxes

By default, the grid displays values in Boolean columns as checkboxes (the type of the column is determined by the DataType property of the Column object). If you don't want Boolean values displayed as checkboxes, set the column's Format property to a string containing the values that should be displayed for True and False values. For example:

· Visual Basic

· C#

· Delphi

In unbound mode, you can use the GetCellCheck and SetCellCheck properties to add checkboxes to any cells. The checkboxes will be displayed along with any text in the cell, and you can set their position using the column's ImageAlign property.

There are two types of check boxes: Boolean and tri-state. Boolean check boxes toggle between the CheckEnum.Checked and CheckEnum.Unchecked states. Tri-state check boxes cycle through the settings CheckEnum.TSChecked and CheckEnum.TSUnchecked and CheckEnum.TSGrayed.

If the cell has a check box and the AllowEditing property is set to True, the user can change the state of the check boxes by clicking them with the mouse or by pressing the SPACE or ENTER keys.

By default, toggling the value of checkbox with the mouse or keyboard will toggle all selected checkboxes. You can disable this feature using the EditOptions property.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Value-Mapped Lists

Value-Mapped Lists

The ComboList property described above ensures that cell values are selected from a list. The value selected by the user is converted into the appropriate type for the column and stored in the grid, exactly as if the user had typed the value.

In many cases, cells can assume values from well-defined lists, but you want to display a user-friendly version of the actual value. For example, if a column contains product codes, you may want to store the code but display the product name instead.

This is accomplished with the DataMap property. This property contains a reference to an IDictionary object that establishes the mapping between what is stored in the grid and what is visible to the user (the IDictionary interface is defined in the System.Collections namespace, and is implemented by the Hashtable class among others).

For example, the code below creates a data map that contains color values and their names. The colors are stored in the grid, and their names are displayed to the user:

· Visual Basic

· C#

· Delphi

Any class that implements IDictionary can be used as a DataMap. For example, Hashtable, ListDictionary, and SortedList all provide valid data maps. The difference is that when they are used in editable columns, the order of the items in the drop down list will depend on the class.

The SortedList class sorts items by key, Hashtable uses an arbitrary order, and ListDictionary keeps the order in which items were added to the list. Because of this, ListDictionary is usually the best choice for DataMaps.

Note that the keys in the data map must be of the same type as the cells being edited. For example, if a column contains short integers (Int16), then any data maps associated with the column should have short integer keys. Using regular integers (Int32) as keys would not work.

The example below shows the difference:

· Visual Basic

· C#

· Delphi

Also, if the column's DataType property is set to an enumeration, the grid will automatically build and use a data map with the names of each value in the enumeration. For example, the following code creates an enumeration containing countries. The country values are stored in the grid, and their names are displayed to the user:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Cell Buttons

Cell Buttons

Certain types of cells may require sophisticated editors other than text boxes or drop-down lists. For example, if a column contains file names or a color, it should be edited with a dialog box.

In these cases, you should set the ComboList property to an ellipsis ("…"). The control will display a button next to the cell and will fire the CellButtonClick event when the user clicks on it. You can trap the event, show the dialog, and update the cell's contents with the user's selection.

If you add a pipe character before the ellipsis, then the user will also be allowed to edit the cell contents by typing into the cell.

By default, the cell buttons display the ellipsis. You can assign pictures to the cell buttons using the CellButtonImage property.

The example below shows how you can use cell buttons to display a calendar for editing date columns. The example assumes that you have a MonthCalendar control named "cal" on the form:

· Visual Basic

· C#

· Delphi

This code sets up the column so the user can click a button or edit the date by typing. The next step is the code that handles clicks on the cell button:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Masks

Masks

The C1FlexGrid control also supports masked editing. This type of editing uses an input mask to provide a template and automatically validate the input as the user types. The mask is specified by the EditMask property, which can be used with regular text fields and with drop-down combo fields.

Mask strings have two types of characters: literal characters, which become part of the input, and template characters, which serve as placeholders for characters belonging to specific categories (e.g. digits or alphabetic). For example, the code below assigns a "(999) 999-9999" editing mask to column one, which holds phone numbers (the digit "9" is a placeholder that stands for any digit):

· Visual Basic

· C#

· Delphi

Setting the EditMask property to a non-empty string causes it to use the built-in masked editor, even if the column contains date/time values (usually, a DateTimePicker control is used to edit these columns). This is especially convenient if you have DateTime columns that hold times only (not dates). In these cases, you can set the following properties to use a masked editor instead of the DateTimePicker control:

· Visual Basic

· C#

· Delphi

For details on the syntax used to build the mask strings, see the EditMask property in the control reference section.

If different cells in the same column need different masks, trap the BeforeEdit event and set the EditMask property to an appropriate value for the current cell.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Validation

Validation

In many cases, edit masks alone are not enough to ensure that the data enters by the user was valid. For example, a mask won't let you specify a range of possible values, or validate the current cell based on the contents of another cell.

In these cases, trap the ValidateEdit event and see if the value contained in the Editor.Text property is a valid entry for the current cell (at this point, the cell still has the original value in it). If the input is invalid, set the Cancel parameter to True and the grid will remain in edit mode until the user types a valid entry.

For example, the code below validates input into a currency column to ensure that values entered are between 1,000 and 10,000:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using Custom Editors

Using Custom Editors

The built-in editors provide a lot of flexibility and power, but in some cases you may want to use external controls as specialized editors. For example, you may want to use the C1NumericInput control that provides a drop-down calculator for entering numbers, or an editor for selecting from multi-column lists, or a specialized control that you wrote to edit your business objects.

Any control that derives from the base Control class can be used as a basic grid editor. Controls that implement the IC1EmbeddedEditor interface (defined in C1.Common.dll) can provide better integration with the grid and more advanced features. For details on the IC1EmbeddedEditor interface, see the Editor property.

To use a control as a custom editor, all you have to do is associate an instance of the control with a grid column or a style using its Editor property. You can do this at design time (using the column editor) or at run time. After that, the control will be automatically used by the grid.

To define custom editors at design time, add an instance of the editor control to the form, then right-click the grid and select Edit Columns. Select the columns that should use the custom editor and set their Editor properties to the name of the new editor control.

For example, to use a NumericUpDown control as a grid editor, follow these steps:

1. Add a C1FlexGrid control to the form.

2. Add a NumericUpDown control to the form and set its BorderStyle property to "None".

3. Right-click the grid and select the Edit Columns menu option.

4. In the column editor, select the first scrollable grid column and set its Editor property to "numericUpDown1".

Run the project and edit some values in the first column. Notice how the grid positions and initializes the NumericUpDown control so you can edit cell values. When you are done editing a cell, click a different cell or press the TAB key to move to the next one. Notice how the new value is applied to the cell.

You can also assign custom editors to the grid at run time, using code.

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating Custom Editors

Creating Custom Editors

Any control that derives from the Control base class can be used as a grid editor. This is possible because the grid knows enough about the base class to access properties such as Text and Bounds, and events such as Leave and TextChanged. In many cases this level of support is adequate.

In some cases, however, you may want to use controls that do not follow the base class that closely. For example, a DateTimePicker control has a Value property that should be used to retrieve the edited value instead of Text. In these cases, you can implement one or more methods in the IC1EmbeddedEditor interface to override the default behavior. For example, all controls in the C1Input library support IC1EmbeddedEditor and therefore integrate closely with C1FlexGrid (and also C1TrueDBGrid).

The IC1EmbeddedEditor interface is fairly simple, and because the grid binds to it using late binding, you don't even have to implement all its members. Only implement the ones that make sense to your editor control.

The interface does provide enough flexibility to allow virtually any control to be used as a grid editor. You can even use UITypeEditor classes as grid editors. To do this, you need a wrapper class that:

1. Derives from Control (UITypeEditor doesn't).

2. Implements the IC1EmbeddedEditor interface.

3. Encapsulates the appropriate UITypeEditor.

We provide source code for this wrapper class in the CustomEditors sample.

Using the UITypeEditor wrapper class, you can use any UITypeEditors with the C1FlexGrid. .NET provides several UITypeEditors for editing colors, fonts, file names, etc. You can also write your own UITypeEditors, in some cases that is easier than writing a control.

For an example of using built-in, custom, and UITypeEditor editors with the C1FlexGrid, see the CustomEditors sample in our on-line sample library.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Controlling Edit Mode

Controlling Edit Mode

You can determine whether the grid is in edit mode by reading the value of the Editor property. If this property returns null, the grid is not in edit mode. Otherwise, the grid is in edit mode and the property returns a reference to the control that is being used to edit the cell (the control may be a TextBox, a ComboBox, or other type of control).

You can put the grid in edit mode programmatically using the StartEditing method, and finish editing using the FinishEditing method.

You can control the editing process further by handling the editing events fired by the grid. In the process of editing a cell, the grid fires the following sequence of events:

BeforeEdit Event

This event fires whenever an editable cell is selected. It allows you to prevent the cell from being edited by setting the event's Cancel parameter to True. You can also modify the ComboList property so the appropriate drop-down button gets painted in the cell.

Note that the user might not actually start editing after this, he could simply move the selection to a different cell or control.

StartEdit Event

This event is similar to BeforeEdit, except the user has actually typed a key or clicked the dropdown button in the cell and really is about to start editing. You can still cancel the editing at this point.

Note that the Editor property is still null at this point, because the control hasn't yet determined the type of editor that should be used. You can assign custom editors to the Editor property at this point.

SetupEditorEvent

This event fires after the editor control has been created and configured to edit the cell, but before it is displayed. You can change the editor properties at this point (for example, set the maximum length or password character to be used in a TextBox editor). You can also attach your own event handlers to the editor.

ValidateEdit Event

This event fires when the user is done editing, before the editor value gets copied back into the grid. You can examine the original value by retrieving it from the grid (the event provides the coordinates of the cell). You can examine the new value about to be assigned to the grid through the Editor properties (e.g., Editor.Text). If the new value is not valid for the cell, set the Cancel parameter to True and the grid will remain in edit mode.

If instead of keeping the cell in edit mode you would rather restore the original value and leave edit mode, set Cancel to True and then call the FinishEditing method.

AfterEdit Event

This event fires after the new value has been applied to the cell and the editor has been deactivated. You can use this event to update anything that depends on the cell value (for example, subtotals or sorting).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Outlining and Summarizing

Outlining and Summarizing

The FlexGrid control has methods and properties that allow you to summarize data and display it in a hierarchical manner. To summarize data and add aggregate values, use the Subtotal method. To display hierarchical views of the data, use the Tree property.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating Subtotals

Creating Subtotals

The Subtotal method adds subtotal rows that contain aggregate data for the regular (non-subtotal) rows.

Subtotal supports hierarchical aggregates. For example, if your grid contains sales data, you may Subtotal to get aggregate sales figures by Product, Region, and Salesperson. The code below illustrates this:

· Visual Basic

· C#

· Delphi

When the Subtotal method adds rows with the aggregate information, it automatically assigns subtotal styles to the new rows (there are built-in styles for 5 levels of subtotals). You can customize the appearance of the subtotal rows by changing the properties of the outline styles at design time with the style editor or at run time with code. For example:

· Visual Basic

· C#

· Delphi

After executing this code, the grid would look like this:

The Grand Total row contains the total sales for all products, regions, and sales personnel. It was created using a –1 for the groupOn parameter in the call to the Subtotal method. The other subtotals show total sales by product and region. They were created using a values 0 and 1 for the groupOn parameter.

You may also calculate aggregates other than sums (e.g. averages or percentages), and calculate several aggregates for each row (e.g. gross and net sales).

Subtotal rows created by the Subtotal method differ from regular rows in three aspects:

1. Subtotal rows can be automatically removed by invoking the Subtotal method with the flexSTClear parameter. This is useful to provide dynamic views of the data, where the user may move columns and re-sort the data, making it necessary to recalculate the subtotals.

2. Subtotal rows can be used as nodes in an outline, allowing you to collapse and expand groups of rows to present an overview of the data or to reveal its details. To see the outline tree, you need to set the Column and Tree.Style properties to define the position and appearance of the outline tree.

3. Subtotal rows can be treated as nodes in a tree. You can get a Node object for any subtotal row through the Node property.

4. When the grid is bound to a data source, the subtotal rows do not correspond to actual data. If you move the cursor in the data source, subtotal rows will be skipped in the grid.ey

The outline tree allows users to collapse and expand sections of the grid by clicking on the nodes. You can use outline trees to display many types of information, not only aggregates. The next topic shows how you can create a custom outline tree to display directory information.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating Custom Trees

Creating Custom Trees

To create outline trees without using the Subtotal method, you need to follow these steps:

1. Add rows to the grid.

2. Turn some rows into outline nodes by setting their IsNode property to true.

3. Get the Node object for each node row and set its Level property to define the node's position in the tree hierarchy. Higher values mean the node is deeper (more indented) into the outline tree.

For example, the code below creates a directory tree:

· Visual Basic

· C#

· Delphi

The code above initializes the grid layout and calls the AddDirectory routine that does the job of populating the grid and setting up the tree structure:

· Visual Basic

· C#

· Delphi

AddDirectory is a recursive routine that traverses the current directory and all its subdirectories. In this sample, the tree size is limited to four directory levels in order to save time. In a real application, the routine should be changed to populate tree branches only when they are expanded (see the FlexGrid Tutorials).

This code creates a grid that looks like this:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Merging Cells

Merging Cells

The C1FlexGrid control allows you to merge cells, making them span multiple rows or columns. This capability can be used to enhance the appearance and clarity of the data displayed on the grid. The effect of these settings is similar to the HTML <ROWSPAN> and <COLSPAN> tags.

To enable cell merging, you must do two things:

1. Set the grid's AllowMerging property to a value other than none. (The effect of each setting is explained in the reference section).

2. If you want to merge columns, set the AllowMerging property to true for each column that you would like to merge. If you want to merge rows, set the AllowMerging property to true for each row that you would like to merge

Merging will occur if adjacent cells contain the same non-empty string. There is no method to force a pair of cells to merge. The merging is done automatically based on the cell contents. This makes it easy to provide merged views of sorted data, where values in adjacent rows present repeated data.

Cell merging has several possible uses. For example, you can use it to create merged table headers, merged data views, or grids where the text spills into adjacent columns.

Merged table headers

Merged data views

Spilling Text

Custom Merging

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Merged table headers

Merged table headers

To create merged table headers, you must start by setting the grid's AllowMerging property to FixedOnly. Then, designate the rows and columns that you want to merge by setting the row and column's AllowMerging properties. Finally, assign the text to the header cells so that the cells you want to merge have the same contents.

The code below shows an example:

· Visual Basic

· C#

· Delphi

This is the result:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Merged data views

Merged data views

Cell merging works the same way when the grid is bound to a data source. The code below shows an example (the code uses a DataAdapter object that was created at design time):

· Visual Basic

· C#

· Delphi

This is the result:

Notice how merging the cells has the effect of visually grouping the data and making the information on the table easier to understand.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Spilling Text

Spilling Text

The AllowMerging property has two settings that operate differently from the others that don't require you to set the AllowMerging property on specific rows and columns.

1. The Spill setting causes text that is too long to fit in a cell to spill into empty adjacent cells. The resulting behavior is similar to the one in Microsoft Excel. If you type a long entry into a cell and the adjacent cell is empty, the entry will spill to occupy as much room as needed.

For example, the picture below shows what a grid might look like when AllowMerging is set to Spill and the user types entries of varying lengths:

2. The Nodes setting is similar to Spill but only applies to outline nodes. This setting is useful when data is organized into groups, and the node rows contain information in a format different from the data rows.

For example, the picture below shows what a grid might look like when the data is grouped and summarized using the Subtotal method, and then AllowMerging is set to Nodes:

This image is similar to the one in the previous topic that described subtotals. The difference is that the subtotal rows (nodes) now spill onto empty adjacent cells, improving the appearance of the grid.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Custom Merging

Custom Merging

You can customize the default merging behavior in two ways:

1. Assign a custom IComparer class to the CustomComparer property.

By default, the grid will merge adjacent cells that contain the same non-null value. String comparisons are case-sensitive and blanks are included.

If you wanted the grid to merge cells using a case-insensitive comparison and trimming blanks, you could write a custom class that implements IComparer and assign it to the CustomComparer property.

2. Write a new class that derives from the C1FlexGrid and override the GetMergedRange virtual method, providing your own custom merging logic.

For examples that show how to implement custom merging logic, see the CustomMerge samples in our on-line sample library.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Saving, Loading, and Printing

Saving, Loading, and Printing

The C1FlexGrid control has methods that allow you to save, load, and print grids.

Saving and Loading Grids to Text Files

Saving and Loading Microsoft Excel Files

Loading Grids from Databases

Printing Grids

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Saving and Loading Grids to Text Files

Saving and Loading Grids to Text Files

The SaveGrid method saves the grid contents to a text file. The method has parameters that control the type of delimiter to use (e.g. commas, tabs, custom delimiters), whether to save the fixed cells or only the scrollable cells, and the type of encoding to used (e.g. ASCII or Unicode). The resulting text files can later be loaded back into the control, or into other applications that support comma or tab-delimited files (for example, Microsoft Excel).

The LoadGrid method loads data from text files. You can load text files created with the SaveGrid method or with other applications.

The format of the text files is fairly simple. Cell contents are saved as formatted strings (exactly as they are displayed on the screen). If the cell text contains quote characters or cell separator characters, the cell is enclosed in quotes. Any quote characters contained in the cell text are doubled. This is the also the convention used in Microsoft Excel text files.

Text files do not contain pictures or formatting information.

The SaveGrid method has a flags parameter that allows you to specify whether you want to save the entire grid or only certain parts (scrollable, visible, or selected).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Saving and Loading Microsoft Excel Files

Saving and Loading Microsoft Excel Files

Starting with version 2.5, you can use the SaveGrid and LoadGrid methods to save and load Microsoft Excel files (.xls) as well as text files. This allows you to save formatting information in addition to the data.

To save and load Excel files using the SaveGrid and LoadGrid methods, simply set the format parameter to FileFormatEnum.Excel and call the methods as usual. You don't need to have Microsoft Excel installed on your computer.

Excel files contain "workbooks", which are made up of "worksheets". The SaveGrid and LoadGrid methods always save books with a single sheet, and load the first sheet from existing books. If you want additional control over which sheets to load or save, use the SaveExcel, LoadExcel, and LoadExcelSheetNames methods instead. The process of saving and loading Excel files will convert most data types and formatting information, including row and column dimensions, fonts, colors, formats, and cell alignment. However, not all formatting elements can be converted. For example, the grid will load the values in Excel cells, but it will not load the underlying formulas. Other features such as frozen and merged cells, images, data maps, and cell borders are not translated either.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Loading Grids from Databases

Loading Grids from Databases

You can also load grid data from a database. This is different from data binding, which keeps a live connection between one or more controls and the underlying data source. To load data from a database, you can use DataReader objects, as shown below:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Printing Grids

Printing Grids

Use the PrintGrid method to print the contents of the grid. The method has parameters that allow you to select the scaling mode, whether to display print/preview dialogs, set headers and footers, etc.

The PrintParameters property exposes additional printing properties such as the font to use for headers and footers, and a .NET Framework PrintDocument object that can be used to select the printer, paper size and orientation, margins, etc.

The code below uses the PrintParameters property to set up the page orientation, margins, header and footer fonts. Then it calls the PrintGrid method to display a print preview dialog:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FlexGrid Property Groups

FlexGrid Property Groups

The C1FlexGrid control has a rich set of properties, methods, and events. You do not have to know all of them in order to use the control effectively.

The reference below shows the most important properties, methods, and events grouped by usage type. Some elements appear in more than one group. For details on specific elements, please refer to the reference part of this document.

1) Grid Layout

Rows, Cols, AutoSizeCols, ScrollBars, ScrollTrack

2) Cursor and Selection

SelectionMode, Select, ShowCell, Row, Col, RowSel, ColSel, , MouseRow, MouseCol, BeforeRowColChange, AfterRowColChange, BeforeSelChange, AfterSelChange, KeyActionTab, KeyActionEnter

3) Editing

AllowEditing, ComboList, EditMask, BeforeEdit, StartEdit, ValidateEdit, AfterEdit, StartEditing, FinishEditing, Editor, CellButtonClick, KeyDownEdit, KeyPressEdit, KeyUpEdit, ChangeEdit

4) Getting and Setting Values

Item (indexer), GetData, GetDataDisplay, SetData, GetCellRange, GetCellImage, SetCellImage, Clip, FindRow, Aggregate, CellChanged

5) User Interface

AllowEditing, AllowMerging, AllowResizing, AllowDragging, AllowSorting, BeforeSort, AfterSort, AutoSearch, AutoSearchDelay BeforeDragColumn, AfterDragColumn, BeforeDragRow, AfterDragRow, BeforeResizeColumn, AfterResizeColumn, BeforeResizeRow, AfterResizeRow, ScrollTips, ScrollTipText, BeforeScrollTip

6) Outlining and Summarizing

Subtotal, Tree, IsNode, Level, Collapsed, BeforeCollapse, AfterCollapse

7) Merging Cells

AllowMerging, GetMergedRange

8) Data Binding

DataSource, DataMember, AfterDataRefresh, AutoResize, GridError

9) Saving, Loading, and Printing Grids

LoadGrid, SaveGrid, LoadExcel, SaveExcel, ClipSeparators, PrintGrid

10) OLE Drag Drop

DragMode, DropMode, BeforeMouseDown

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FlexGrid Samples

FlexGrid Samples

The following samples are included with this product. Various product samples and demos may include other ComponentOne controls. Although the samples included are used to demonstrate product features and how the control may be integrated with the rest of the ComponentOne product line, some controls used in the samples may not be included with the purchase of an individual product.

The ComponentOne Samples are also available at http://helpcentral.componentone.com/ProductResources.aspx?View=Samples.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Visual Basic Samples

Visual Basic Samples

AutoSizeEdit | Resize the editor while the user types. This sample uses the C1FlexGrid control.
BarChart | Draw bar charts using the grid cells. This sample uses the C1FlexGrid control.
Benchmark | Compares data-binding performance for FlexGrid and MSDataGrid. This sample uses the C1FlexGrid and C1TrueDBGrid controls.
Blinker | Use CellStyles to make cells blink. This sample uses the C1FlexGrid control.
BoundDelete | Deletes rows from a bound FlexGrid. This sample uses the C1FlexGrid control.
BoundFinishEdit | Commit changed to DataRow after editing. This sample uses the C1FlexGrid control.
BoundImage | Bind the grid to image fields stored as OLE objects. This sample uses the C1FlexGrid control.
CellBorders | Use OwnerDraw to provide custom cell borders. This sample uses the C1FlexGrid control.
CellDataType | Assign cell types (and editors) on a per-cell basis. This sample uses the C1FlexGrid control.
CellMerging | Shows various types of cell-merging in a FlexGrid control. This sample uses the C1FlexGrid control.
Clipboard | Add clipboard support to the FlexGrid control. This sample uses the C1FlexGrid control.
ColumnEditor | Expose the FlexGrid design-time column editor in your controls. This sample uses the C1FlexGrid control.
CustomDataMap | Customize the options in drop-down lists when using DataMaps. This sample uses the C1FlexGrid control.
CustomEditor | Implement your own cell editor. This sample uses the C1FlexGrid control.
CustomMerge | Implement your own merging logic to create a TV-guide display. This sample calls the C1.Win.C1FlexGrid namespace.
CustomMerge2 | Implement your own merging logic to mix merging modes. This sample calls the C1.Win.C1FlexGrid namespace.
CustomMerge3 | Shows how to customize grouping by overriding the GetData method. This sample calls the C1.Win.C1FlexGrid namespace.
CustomMerge4 | Shows how to customize grouping by overriding the GetData method. This sample calls the C1.Win.C1FlexGrid namespace.
CustomPrint | Use the CreateImage method to print grids with arbitrary row and column breaks. This sample uses the C1FlexGrid control.
CustomTree | Use the C1FlexGrid control to build a tree. This sample uses the C1FlexGrid control.
DataIndex | Use the Row.DataIndex property to get the underlying data row. This sample uses the C1FlexGrid control.
DataMap | Use data-mapped columns when bound to a data source. This sample uses the C1FlexGrid control.
DataReader | Populate a grid from a DataReader. This sample uses the C1FlexGrid control.
DataTable | Bind to a DataTable, add and remove rows. This sample uses the C1FlexGrid control.
DataTableDictionary | Shows how to build DataMaps from DataTable objects. This sample uses the C1FlexGrid control.
DBDynamicStyles | Assign styles to grid cells based on their contents. This sample uses the C1FlexGrid control.
DBImageField | Show images stored in a DataTable. This sample uses the C1FlexGrid control.
DBSchemaChange | Test grid response to changes in the data source object. This sample uses the C1FlexGrid control.
DBTree | Display bound data in a hierarchical tree view. This sample uses the C1FlexGrid control.
DragDrop | Customize automatic Drag & Drop. This sample uses the C1FlexGrid control.
DragRow | Drag rows between grids. This sample uses the C1FlexGrid control.
DynamicStyles | Assign styles to a cell based on the contents of another cell. This sample uses the C1FlexGrid control.
Editing | Edit cells using textboxes, lists, masks, and checkboxes. This sample uses the C1FlexGrid control.
FlexByRow | Set up a grid in 'transposed' format. This sample uses the C1FlexGrid control.
FlexGroup | Implement Outlook-style grouping and filtering using the FlexGrid. This sample uses the C1FlexGrid control.
FreezeBottom | Show frozen rows at the bottom of a grid. This sample uses the C1FlexGrid control.
GridChart | Attach a FlexGrid to a C1Chart control. This sample uses the C1FlexGrid and C1Chart controls.
HierData | Bind to hierarchical data sources (master-detail style). This sample uses the C1FlexGrid control.
Hyperlink | Add hyperlinks to cells in the FlexGrid. This sample uses the C1FlexGrid control.
MapAndGroup | Shows grouping and sorting behavior when using data-mapped columns. This sample uses the C1FlexGrid control.
MergeStyles | Merge CellStyles assigned to rows, columns, and cells. This sample uses the C1FlexGrid control.
MultiColumnDropDown | Multi-column drop-down editor for use with the C1FlexGrid. This sample uses the C1FlexGrid control.
Outline | Hide repeated data in an outline. This sample uses the C1FlexGrid control.
PrintPreview | Provide print preview with the C1PrintPreview control (in three ways). This sample uses the C1FlexGrid, C1PrintDocument, C1PrintPreview, and PreviewToolBarButton controls.
ProductTree | Build a custom tree with product information. This sample uses the C1FlexGrid control.
RTFGrid | Display RTF text in grid cells. This sample uses the C1FlexGrid control.
ScrollPosition | Shows how the ScrollPosition property works. This sample uses the C1FlexGrid control.
SelectionMode | Shows the effect of the SelectionMode property. This sample uses the C1FlexGrid control.
Sorting | Shows several sorting techniques. This sample uses the C1FlexGrid control.
Splits | Split a C1FlexGrid into multiple views. This sample uses the C1FlexGrid control.
StartEditing | Implement a grid that stays in cell-editing mode. This sample uses the C1FlexGrid control.
Styles | Shows how you can use Styles to customize the appearance of the C1FlexGrid. This sample uses the C1FlexGrid control.
Subtotals | Create subtotals for multiple columns. This sample uses the C1FlexGrid control.
Transpose | Transpose data in a grid. This sample uses the C1FlexGrid control.
TreeCheck | Add checkboxes to a grid tree. This sample uses the C1FlexGrid control.
TreeNode | Manage an outline tree using the FlexGrid Node objects. This sample uses the C1FlexGrid control.
Tut_Analyze | Provide dynamic sorting and grouping. This sample uses the C1FlexGrid control.
Tut_Edit | Edit cells using textboxes, lists, masks, and checkboxes. This sample uses the C1FlexGrid control.
Tut_XMLTree | Populate the grid from an XML document. This sample uses the C1FlexGrid control.
Validate | Use the ErrorProvider control with the FlexGrid. This sample uses the C1FlexGrid control.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C# Samples

C# Samples

Analyze | Provide dynamic data sorting and grouping. This sample uses the C1FlexGrid control.
AutoSizeEdit | Resize the editor while the user types. This sample uses the C1FlexGrid control.
BarChart | Draw bar charts using the grid cells. This sample uses the C1FlexGrid control.
Benchmark | Compares data-binding performance for FlexGrid and MSDataGrid. This sample uses the C1FlexGrid and C1TrueDBGrid controls.
BoundDelete | Deletes rows from a bound FlexGrid. This sample uses the C1FlexGrid control.
BoundFinishEdit | Commit changed to DataRow after editing. This sample uses the C1FlexGrid control.
BoundImage | Bind the grid to image fields stored as OLE objects. This sample uses the C1FlexGrid control.
BoundImageMap | Use the ImageMap property with a data-bound grid. This sample uses the C1FlexGrid control.
CellBorders | Use OwnerDraw to provide custom cell borders. This sample uses the C1FlexGrid control.
CellDataType | Assign cell types (and editors) on a per-cell basis. This sample uses the C1FlexGrid control.
CellLabels | Show labels when text is too long to fit a cell. This sample uses the C1FlexGrid control.
Clipboard | Add clipboard support to the FlexGrid control. This sample uses the C1FlexGrid control.
ColumnEditor | Expose the FlexGrid design-time column editor in your controls. This sample uses the C1FlexGrid control.
ColumnOrder | Position columns dynamically. This sample uses the C1FlexGrid control.
CustomData | Implement a custom data source object. This sample uses the C1FlexGrid control.
CustomDataMap | Customize the options in drop-down lists when using DataMaps. This sample uses the C1FlexGrid control.
CustomDataSource | Implements a custom data source object and binds it to a grid. This sample uses the C1FlexGrid control.
CustomEditor | Implement your own cell editor. This sample uses the C1FlexGrid control.
CustomMerge | Implement your own merging logic to create a TV-guide display. This sample calls the C1.Win.C1FlexGrid namespace.
CustomMerge2 | Implement your own merging logic to mix merging modes. This sample calls the C1.Win.C1FlexGrid namespace.
CustomMerge3 | Shows how to customize grouping by overriding the GetData method. This sample calls the C1.Win.C1FlexGrid namespace.
CustomMerge4 | Shows how to customize grouping by overriding the GetData method. This sample calls the C1.Win.C1FlexGrid namespace.
CustomPrint | Use the CreateImage method to print grids with arbitrary row and column breaks. This sample uses the C1FlexGrid control.
CustomSelection | Uses OwnerDraw to implement custom (non-rectangular) selection. This sample calls the C1.Win.C1FlexGrid namespace.
CustomSort | Implement your own sorting logic with a custom IComparer object. This sample uses the C1FlexGrid control.
DataIndex | Use the Row.DataIndex property to get the underlying data row. This sample uses the C1FlexGrid control.
DataMap | Use data-mapped columns when bound to a data source. This sample uses the C1FlexGrid control.
DataReader | Populate a grid from a DataReader. This sample uses the C1FlexGrid control.
DataTable | Bind to a DataTable, add and remove rows. This sample uses the C1FlexGrid control.
DataTableDictionary | Shows how to build DataMaps from DataTable objects. This sample uses the C1FlexGrid control.
DataTree | Bind the grid to a hierarchical data source and show details in child grids. This sample calls the C1.Win.C1FlexGrid namespace.
DBDynamicStyles | Assign styles to grid cells based on their contents. This sample uses the C1FlexGrid control.
DBImageField | Show images stored in a DataTable. This sample uses the C1FlexGrid control.
DBImages | Bind the grid to a data base with image fields stored as OLE objects. This sample uses the C1FlexGrid control.
DBSchemaChange | Test grid response to changes in the data source object. This sample uses the C1FlexGrid control.
DBTree | Display bound data in a hierarchical tree view. This sample uses the C1FlexGrid control.
DBUpdate | Save changes to the underlying database. This sample uses the C1FlexGrid control.
DragDrop | Customize automatic Drag & Drop This sample uses the C1FlexGrid control.
DragMerged | Drag groups of merged columns. This sample uses the C1FlexGrid control.
DragRow | Drag rows between grids. This sample uses the C1FlexGrid control.
DynamicStyles | Assign styles to a cell based on the contents of another cell. This sample uses the C1FlexGrid control.
FilterRow | Implement a FilterRow on a FlexGrid control. This sample uses the C1FlexGrid control.
FindRow | How to find a row in the underlying datasource. This sample uses the C1FlexGrid control.
FlexByRow | Set up a grid in 'transposed' format. This sample uses the C1FlexGrid control.
FlexGroup | Implement Outlook-style grouping using the FlexGrid. This sample uses the C1FlexGrid control.
FlexHierarchical | Implement hierarchical data binding using the FlexGrid. This sample calls the C1.Win.C1FlexGrid namespace.
FlexHierC1Data | Implement hierarchical data binding using the FlexGrid and C1Data. This sample uses the C1DataSet and C1SchemaDef controls and calls the C1.Win.C1FlexGrid namespace.
FreezeBottom | Show frozen rows at the bottom of a grid. This sample uses the C1FlexGrid control.
GridChart | Attach a FlexGrid to a C1Chart control. This sample uses the C1FlexGrid and C1Chart controls.
HierData | Bind to hierarchical data sources (master-detail style). This sample uses the C1FlexGrid control.
HostControls | Host controls in grid cells. This sample uses the C1FlexGrid control.
Hyperlink | Add hyperlinks to cells in the FlexGrid. This sample uses the C1FlexGrid control.
MasterDetail | Shows how to create and bind master-detail DataSets in code. This sample calls the C1.Win.C1FlexGrid namespace.
MergeStyles | Merge CellStyles assigned to rows, columns, and cells. This sample uses the C1FlexGrid control.
MultiColumnDropDown | Multi-column drop-down editor for use with the C1FlexGrid. This sample uses the C1FlexGrid control.
NumericInput | Implement your own cell editor for numeric input. This sample uses the C1FlexGrid control.
Outline | Hide repeated data in an outline. This sample uses the C1FlexGrid control.
PasswordChar | Use the C1FlexGrid to enter and edit passwords. This sample uses the C1FlexGrid control.
PrintPreview | Provide print preview with the C1PrintPreview control (in three ways). This sample uses the C1FlexGrid, C1PrintDocument, C1PrintPreview, and PreviewToolBarButton controls.
RowStateDisplay | Use different styles to display DataRows in different states. This sample uses the C1FlexGrid control.
RTFGrid | Display RTF text in grid cells. This sample uses the C1FlexGrid control.
ScrollPosition | Shows how the ScrollPosition property works. This sample uses the C1FlexGrid control.
SelectionMode | Shows the effect of the SelectionMode property. This sample uses the C1FlexGrid control.
SetupEditor | Use the SetupEditor event to customize the grid editors. This sample uses the C1FlexGrid control.
Sorting | Shows several sorting techniques. This sample uses the C1FlexGrid control.
Splits | Split a C1FlexGrid into multiple views. This sample uses the C1FlexGrid control.
StartEditing | Implement a grid that stays in cell-editing mode. This sample uses the C1FlexGrid control.
Subtotals | Create subtotals for multiple columns. This sample uses the C1FlexGrid control.
Transpose | Transpose data in a grid. This sample uses the C1FlexGrid control.
TreeCheck | Add checkboxes to a grid tree. This sample uses the C1FlexGrid control.
TreeNode | Manage an outline tree using the FlexGrid Node objects. This sample uses the C1FlexGrid control.
TriStateBound | Provide three-state (grayable) values in Boolean columns. This sample calls the C1.Win.C1FlexGrid namespace.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ComponentOne FlexGrid for Mobile Devices Samples

ComponentOne FlexGrid for Mobile Devices Samples

Analyze | Provide dynamic data sorting and grouping. This sample uses the C1FlexGrid control.
BarChart | Draw bar charts using the grid cells. This sample uses the C1FlexGrid control.
EditData | Shows different types of built-in editors and dynamic formatting. This sample uses the C1FlexGrid control.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FlexGrid Tutorials

FlexGrid Tutorials

The following sections contain tutorials that illustrate some of the main features in the C1FlexGrid control. The tutorials walk you through the creation of several simple projects, describing each step in detail. The distribution CD contains more sophisticated samples that can be used as a reference.

The tutorials are:

Edit | Starting with a basic data-entry grid, this tutorial shows how to implement data formatting, check boxes, drop-down lists, input masks, data validation, and clipboard support.
Outline | Shows how you can use the C1FlexGrid as an outliner to display structured (or hierarchical) data.
Data Analysis | Starting with a grid containing sales data for different products, regions, and salespeople, this tutorial show how to implement dynamic layout (column order), automatic sorting, cell merging, automatic subtotals, and outlining.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Edit Tutorial

Edit Tutorial

This tutorial starts with a basic data-entry grid, then adds the following features:

1. Formatting

2. Check boxes

3. Drop-down lists

4. Complex data validation

5. Clipboard support

6. Custom editors

Here is what the final application will look like:

Step 1: Create the C1FlexGrid Control

Step 2: Set Column Types and Formats

Step 3: Drop-Down Lists

Step 4: Data Validation

Step 5: Clipboard Support

Step 6: Custom Editors

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 1: Create the C1FlexGrid Control

Step 1: Create the C1FlexGrid Control

Start a new Visual Basic project and add a C1FlexGrid control to the form by clicking the C1FlexGrid icon on the toolbox, then clicking on the form and dragging until the object has the proper size.

If you can't find the C1FlexGrid control in the toolbox, right-click on the toolbox and select the Customize Toolbox option. Then, look for the C1FlexGrid control on the list of .NET components and make sure it is checked. If you can't find the grid in the component list, you may need to re-install the product.

Next, use the .NET properties window to set the following control properties:

(Name) = fg

Dock = Fill

Cols.Count = 5

Cols.Fixed = 0

Now double-click the form caption area to open the code window. At the top of the file, add the following statement:

· Visual Basic

· C#

· Delphi

This makes the objects defined in the C1FlexGrid assembly visible to the project and saves a lot of typing.

Next, type (or copy) the following code that sets up the grid when the form loads:

· Visual Basic

· C#

· Delphi

That's it. Press F5 to run the project, and you can start typing data into the control. Press F2 or the space bar to edit existing entries, or just type new entries over existing ones.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 2: Set Column Types and Formats

Step 2: Set Column Types and Formats

When displaying numeric or date values, you will typically want to adopt a consistent format for the values. The C1FlexGrid control allows you to specify the DataType and Format for each column.

To specify the DataType and Format for the columns, add the following code to the Form_Load event:

· Visual Basic

· C#

· Delphi

The new code formats the Sales column to store and display currency values, and the Bonus column to deal with Boolean values.

If you run the project now, you will notice that the grid won't accept non-numeric entries in the Sales column. The Bonus column displays values as checkboxes, which can be toggled with the mouse or with the keyboard. This is the default behavior for Boolean columns.

Note that the Format property does not affect the data in any way, only how it is displayed.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 3: Drop-Down Lists

Step 3: Drop-Down Lists

Entering data is a tedious and error-prone process. Drop-down lists are great because they minimize the amount of typing you must do, reduce the chance of errors, and increase the consistency of the data.

Let's assume that our sample project only involves sales of three products (Applets, Widgets, and Gadgets), in four regions (North, South, East, and West), and that there are three full-time sales people (Mary, Sarah, and Paula).

To use these lists as drop-downs in the C1FlexGrid control, all you have to do is build strings containing the items in each list (separated by pipe characters) and assign them to the ComboList property of each column.

To add the combolists, add the following code to the Form_Load event:

· Visual Basic

· C#

· Delphi

Notice how the last ComboList string starts with a pipe. This allows users to type additional names that are not on the list. In other words, these values will be edited using a drop-down combo, as opposed to a simple drop-down list.

Press F5 to run the project again, then move the cursor around. When you move the cursor to one of the columns that have combo lists, a drop-down button becomes visible. You may click on it to show the list, or simply type the first letter of an entry to highlight it on the list.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 4: Data Validation

Step 4: Data Validation

If you assign a data type to a grid column, the grid will ensure that only data of the proper type is stored in that column. This helps prevent errors, but you will often need stricter validation to ensure that the data entered is correct. For that, you should use the ValidateEdit event.

For example, imagine that anti-trust regulations prevent us from selling our Applets in the North region. To prevent data-entry mistakes and costly lawsuits, we want to prevent users from entering this combination into the control.

The following code checks the data after each edit and prevents invalid entries:

· Visual Basic

· C#

· Delphi

The function starts by gathering the input that needs to be validated. Note that the values being checked are retrieved using the Editor.Text property. This is necessary because the edits have not yet been applied to the control. If the test fails, the function displays a warning and then sets the Cancel parameter to True, which cancels the edits and puts the cell back in edit mode so the user can try again.

Press F5 to run the project again, then try inputting some bad values. You will see that the control will reject them.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 5: Clipboard Support

Step 5: Clipboard Support

The Windows clipboard is a very useful device for transferring information between applications.

Adding clipboard support to FlexGrid projects is fairly easy. Simply set the AutoClipboard property to True and the grid will automatically handle all standard keyboard commands related to the clipboard: CTRL-X or SHIFT-DEL to cut, CTRL-C or CTRL-INSERT to copy, and CTRL-V or SHIFT-INSERT to paste.

Another great Windows feature that is closely related to clipboard operations is OLE Drag and Drop. C1FlexGrid has two properties, DragMode and DropMode, which help implement this feature. Just set both properties to their automatic settings and you will be able to drag selections by their edges and drop them into other applications such as Microsoft Excel, or drag ranges from an Excel spreadsheet and drop them into the C1FlexGrid control.

Press F5 to run the project again, then try copying and pasting some data. Note that you can paste invalid data, because our paste code does not perform any data validation. This is left as an exercise for the reader.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 6: Custom Editors

Step 6: Custom Editors

The C1FlexGrid has powerful built-in editors for entering text, masked text, selecting from lists, checkboxes, and more. But in some cases you may want to use a custom editor instead, perhaps one of the input controls in the C1Input library or a control that you wrote. Starting in version 2.5, the FlexGrid allows you to easily plug-in custom editors. To attach a custom editor to the Sales column on our sample, start by adding a NumericUpDown control to the form. Next, use the .NET properties window to configure the new control setting the following properties:

BorderStyle = None

Visible = False

DecimalPlaces = 2

ThousandsSeparator = True

Maximum = 5000000

Then, right-click the grid and select Edit Columns to bring up the grid's column editor.

Select the third column (where the Sales figures will be), and set the Editor property to numericUpDown1, as shown below:

Now run the project and try editing some values in the Sales column. Notice that the grid uses the NumericUpDown control instead of the built-in editors. The control is properly positioned, initialized, and managed. When you move the focus to a different cell, the value is stored in the grid.

But the custom editor doesn't behave exactly like the built-in ones. For example:

1. When you start editing by typing a number, the old value isn't cleared.

2. The size of the editor isn't exactly right (it looks a bit too small).

3. There's an annoying beep when you press Enter to finish editing.

You can overcome these problems in a couple of ways. One would be to use the editor's events, but that would make it difficult to reuse the control in other projects. Another would be to create a derived class and implement some methods in the IC1EmbeddedEditor interface.

For example, the code below implements three methods:

C1EditorInitialize is called to initialize the editor. It sets the initial value and then selects the whole entry. This will take care of the first problem. Because the whole entry is selected, typing the first character will now replace the current contents as we want.

C1EditorUpdateBounds is called to position the editor over the cell being edited. The height of the NumericUpDown control is set automatically based on the font size, though (that is why it looks too short for the cell). The code sets the editor's FontHeight property so it will be positioned exactly over the cell.

Finally, the code overrides the ProcessDialogKey method to suppress the annoying beeps when the user presses the Enter key.

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Outline Tutorial

Outline Tutorial

This sample shows how you can use the C1FlexGrid as an outliner to display structured (or hierarchical) data. When used as an outliner, the C1FlexGrid control behaves like a Tree control, displaying nodes that can be collapsed or expanded to show branches containing subordinate data.

The sample allows you to load an XML document into the grid, where it is displayed as a tree. Here is what the final application will look like:

Step 1: Create the Controls

Step 2: Read the Data and Build the Outline

Step 3: Custom Mouse and Keyboard Handling

Step 4: Allow/Prevent Editing

Step 5: Implement ToolTips

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 1: Create the Controls

Step 1: Create the Controls

Start a new Visual Basic project and add two controls:

1. A command button near the top of the form.

2. A C1FlexGrid control in the area below the button.

If you can't find the C1FlexGrid control in the toolbox, right-click on the toolbox and select the Customize Toolbox option. Then, look for the C1FlexGrid control on the list of .NET components and make sure it is checked. If you can't find the grid in the component list, you may need to re-install the product.

Next, use the .NET properties window to set the following properties:

· Command button

Text = "Open XML File…"

Dock = Top

· C1FlexGrid

(Name) = fg

Dock = Fill

Now double-click the form caption area to open the code window. At the top of the file, add the following statement:

· Visual Basic

· C#

· Delphi

This makes the objects defined in the C1FlexGrid assembly visible to the project and saves a lot of typing.

Next, type (or copy) the following code that sets up the grid when the form loads:

· Visual Basic

· C#

· Delphi

The code starts by setting up the grid layout and column heading text.

Next, it initializes the outline tree using the Tree property and prevents editing of the XML nodes by setting the AllowEditing property of the first column to False. Note that the user can still edit data in the second column, which contains the data in each XML node.

Now the control is ready. We can start adding some code to it.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 2: Read the Data and Build the Outline

Step 2: Read the Data and Build the Outline

Double-click the command button and add the following code to the Button1_Click event:

· Visual Basic

· C#

· Delphi

The routine starts by showing an OpenFileDialog that allows the user to select an XML file to load into the grid. When the file is selected, the routine loads it into an XmlDocument object, which parses the contents of the file into memory.

The routine then sets the grid's Redraw property to False to suspend repainting while the control is populated. This technique improves performance significantly, and you should always use it when adding substantial amounts of data to the C1FlexGrid.

Next, the routine clears any data by setting Count = 1, and calls the GetXMLData routine to populate the control with the contents of the XmlDocument. The GetXMLData routine is the main one in this sample, and is listed below.

After the grid has been populated, the routine uses the AutoSizeCol method to adjust the width of the first column based on its contents, and the Show method to expand the outline and show levels 0, 1, and 2. The routine then sets the Redraw property back to True so the grid starts repainting normally.

The GetXMLData routine is the most interesting one in this sample. It traverses the XMLDocument object and builds the outline tree. Here is the code:

· Visual Basic

· C#

· Delphi

The routine starts by skipping XML comment nodes. Then it uses the Rows.Add method to add a new row to the grid.

Next, the routine sets the node name and checks whether the node has exactly one child. In this case, the node is interpreted as a data node, and the node's InnerText property is copied to the second column on the new row. The code also sets the style of cells containing data to the custom style "Data" created when the form was loaded.

The next block of code checks to see whether this node has a subnode called "Name". If it does, then the contents of the "Name" node are assigned to the new row's UserData property. This value will be used later to implement tooltips, so users can see the node name even when it is collapsed.

Finally, if the node has children, the GetXMLData routine calls itself to add the child nodes to the grid as well.

If you run the project now, you will see that it can already load XML files and display them, and the user can collapse and expand nodes by clicking on them. The next steps add a few improvements to make the application easier to use.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 3: Custom Mouse and Keyboard Handling

Step 3: Custom Mouse and Keyboard Handling

The C1FlexGrid provides the expanding and collapsing for you, but you may extend and customize its behavior. Every time a branch is expanded or collapsed, the control fires the BeforeCollapse and AfterCollapse events so you may take actions in response to that. Furthermore, you may use the Collapsed property to get and set the collapsed state of each branch in code.

In this sample, we will trap the DoubleClick and KeyPress events to expand and collapse nodes when the user double clicks or presses the ENTER key. Here is the code:

· Visual Basic

· C#

· Delphi

The event handlers check whether the user double-clicked the first column or hit the ENTER key, then call the ToggleNodeState routine. ToggleNodeState checks whether the current row is a node row, and toggles the value of the Collapsed property if it is.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 4: Allow/Prevent Editing

Step 4: Allow/Prevent Editing

Recall that we set the AllowEditing property of the first column to False in the Form_Load event. This prevents users from editing any cells in the first column. We would also like to prevent users from entering data in the second column of node rows. To do this, add the following code to handle the BeforeEdit event:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 5: Implement ToolTips

Step 5: Implement ToolTips

To conclude this tutorial, we will add tooltips to the outline. The tooltips will display the text that was stored in each row's UserData property by the GetXMLData routine described above. The tooltips will show the contents of the "Name" node when the user moves the mouse over its parent node. This is useful when the parent node is collapsed and the "Name" node is not visible.

To add the tooltips, start by adding a ToolTip control to the form. Then, add the following code to handle the grid's MouseMove event:

· Visual Basic

· C#

· Delphi

The code starts by checking the cell under the mouse using the MouseRow and MouseCol properties. If the mouse is over the first column on a row that contains text for the tooltip, it retrieves the text. Otherwise, the tooltip text is set to Nothing.

Then the routine compares the new and current tooltip text, and updates the text if necessary, by calling the SetToolTip method on the tooltip control.

This concludes this tutorial. You can extend this project in many ways, including saving edits back into the XML document, adding, deleting, and moving nodes, using different styles for different types of data, etc.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Data Analysis Tutorial

Data Analysis Tutorial

This tutorial combines some of the most useful features in the C1FlexGrid control to provide a dynamic view of a data table. The application starts with a simple data-bound grid containing sales data (from the NorthWind database), then adds the following features:

· Dynamic layout (column order)

· Automatic sorting

· Cell merging

· Automatic subtotals

· Outlining

The picture below shows what the final application looks like. The user can drag the first three columns to group the data by salesperson, country, and product name. When a column is dragged, the totals are automatically recalculated and the outline tree is rebuilt.

Step 1: Create the C1FlexGrid Control

Step 2: Initialize and populate the grid

Step 3: Automatic Sorting

Step 4: Subtotals and Outline Tree

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 1: Create the C1FlexGrid Control

Step 1: Create the C1FlexGrid Control

Start a new Visual Basic project and add a C1FlexGrid control to the form by clicking the C1FlexGrid icon on the toolbox, then clicking on the form and dragging until the object has the proper size.

If you can't find the C1FlexGrid control in the toolbox, right-click on the toolbox and select the Customize Toolbox option. Then, look for the C1FlexGrid control on the list of .NET components and make sure it is checked. If you can't find the grid in the component list, you may need to re-install the product.

Next, use the Visual Basic properties window to set the following control properties:

(Name) = fg

Dock = Fill

Now double-click the form caption area to open the code window. At the top of the file, add the following statements:

· Visual Basic

· C#

· Delphi

This makes the objects defined in the C1FlexGrid and OleDb assemblies visible to the project and saves a lot of typing.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 2: Initialize and populate the grid

Step 2: Initialize and populate the grid

To set up the grid and populate the grid with the sales data we want to analyze, add the following code to the Form_Load event:

· Visual Basic

· C#

· Delphi

The routine starts by setting up the grid layout and some styles. Note that you can set up these properties at design time, if you prefer, using the built-in grid editors.

After setting up the grid, the routine binds it to a data source created by the GetDataSource method, listed below. Finally the last three columns are locked in place by setting their AllowDragging property to False. This is done to prevent the user from grouping the data in these columns (the values in these columns are distinct for each row).

The GetDataSource method creates the data table that is displayed by the grid. The routine is very simple, except for the SQL statement that retrieves the data. Most people don't write these SQL statements manually, but use visual designers such as the one in Visual Studio or Microsoft Access to do that.

Note that you may have to change the connection string slightly, because it has a reference to the NorthWind database and that file might be in a different folder in your system:

· Visual Basic

· C#

· Delphi

If you run the project now, you will see a plain-looking grid that allows you to move columns around and browse through the data. However, the data is not structured in a clear way, and this table contains a couple of thousand records, so it is pretty difficult to get an overview of what the data means.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 3: Automatic Sorting

Step 3: Automatic Sorting

The first step in organizing the data is sorting it. Furthermore, we would like the data to be sorted automatically whenever the user reorders the columns.

After the user reorders the columns, the C1FlexGrid control fires the AfterDragColumn event. We will add an event handler to sort the data in the underlying data table. (If the grid were being used in unbound mode, we would accomplish this using the Sort method.)

The code is very simple:

· Visual Basic

· C#

· Delphi

Run the project and try reordering the first three columns by dragging their headings around. Whenever you move a column, the data is automatically sorted, which makes it easier to interpret.

In the next step, we will add subtotals and an outline tree.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Step 4: Subtotals and Outline Tree

Step 4: Subtotals and Outline Tree

When the grid is used in bound mode, any changes to the data source cause the grid to fire the AfterDataRefresh event. This event is the ideal place to put the code that inserts the subtotals and builds the outline tree for the grid.

Here is the AfterDataRefresh event handler:

· Visual Basic

· C#

· Delphi

The code is very simple. It starts by getting the index of the "Sale Amount" column. In this sample, the index will always be the same (column 6). Looking up the index is usually better than hardwiring it, though, because if someone added a couple of fields to the SQL statement the index would change.

The code then calls the Subtotal method to group the data and insert new rows with the subtotals. The new rows are automatically configured as outline nodes (their IsNode property is set to True), so the subtotals are collapsible.

Try running the project again and dragging columns around. You can easily see the totals by country, product category, or salesperson. You can also expand tree benches to drill down into the data if you want to see more detail.

Note also that the grid is editable, changing some values in the "Sale Amount" column will cause the AfterDataRefresh event to fire again, and the totals will be automatically updated.

This concludes this tutorial.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid Task-Based Help

C1FlexGrid Task-Based Help

The task-based help assumes that you are familiar with programming in Visual Studio .NET, and know how to use bound and unbound controls in general. By following the steps outlined in the help, you will be able to create projects demonstrating a variety of C1FlexGrid features and get a good sense of what C1FlexGrid can do.

Each task-based help topic also assumes that you have created a new .NET project containing a C1FlexGrid named flex. For additional information on this topic, see Creating a .NET Project.

Clearing a Tree View

Converting Column Letters to Uppercase

Formatting Cells Based on their Contents

Formatting a Cell with Decimal Content

Formatting a Cell as Read-Only

Scaling an Image

Undoing a Sort

Using Password Entries in C1FlexGrid

Word Wrapping in a Header or Fixed Row

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Clearing a Tree View

Clearing a Tree View

This topic demonstrates how to clear a C1FlexGrid.

1. Create an unbound C1FlexGrid with an outline tree. For additional information on creating trees, see FlexGrid Tutorials and Outlining and Summarizing.

2. Add a button to your form and enter the following code for the Button1_Click event. This code will set the editable row count equal to zero, and the tree will be cleared when the button is clicked.

· Visual Basic

· C#

· Delphi

Once the button is clicked, the tree view disappears.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Converting Column Letters to Uppercase

Converting Column Letters to Uppercase

This topic demonstrates how to convert column letters from lowercase to uppercase using the SetupEditor event.

Add the following code to your form:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Formatting Cells Based on their Contents

Formatting Cells Based on their Contents

This topic demonstrates how to conditionally format cells based on their contents using the CellChanged event.

1. Create a new CellStyle for the C1Flexgrid:

· Visual Basic

· C#

· Delphi

2. Use the CellChanged event to format the cells based on their content:

· Visual Basic

· C#

· Delphi

In this example, cells containing values greater than or equal to 50,000 are highlighted in gold.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Formatting a Cell with Decimal Content

Formatting a Cell with Decimal Content

This topic demonstrates how to format a cell that contains decimal numbers.

1. Enter three numbers in the first column of the grid:

· Visual Basic

· C#

· Delphi

2. The Column.Format property can be used to change the numbers in the first column to decimal numbers. Enter the following code:

· Visual Basic

· C#

· Delphi

NOTE: The format specifier follows the standard .NET conventions. Use ',' for thousand separators and '.' for the decimal, regardless of locale.

In this example, the numbers in the first column are converted to a dollar amount.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Formatting a Cell as Read-Only

Formatting a Cell as Read-Only

This topic demonstrates how to make a cell read-only using the BeforeEdit event.

You can make any cell in the grid read-only so that the data within it cannot be changed. For example, enter the following code to make the cell in column 1, row 1 read-only:

· Visual Basic

· C#

· Delphi

You may also want to set multiple cells in the grid to read-only at one time. Suppose you have an editable grid used to enter customers' information, such as customer IDs, addresses, and orders. While the orders and addresses may change, the customer IDs will not. The sample code below assumes you have nine rows in your grid, and you would like to make all of the rows in the first column, the Customer ID column, read-only. Enter the following code:

· Visual Basic

· C#

· Delphi

Notice that none of the cells in the Customer ID column are editable.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Scaling an Image

Scaling an Image

This topic demonstrates how to scale an image when the rows of the grid are resized.

1. Add a column of images to your C1FlexGrid.

2. Set the row height of the first two rows using the following code:

· Visual Basic

· C#

· Delphi

3. Add the following code to scale the images in the column added in step 1:

· Visual Basic

· C#

· Delphi

By using the Style.ImageAlign property, the image will be scaled to fit the maximum area within the cell while preserving the picture's original aspect ratio.

To scale the images for the entire grid, not just one column, use the following code:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Undoing a Sort

Undoing a Sort

This topic demonstrates how to undo a sort in C1FlexGrid when the grid is bound to a DataTable.

1. Create a grid and bind it to a DataTable. For example, enter the following code to create a table of nine customers bound to C1FlexGrid:

· Visual Basic

· C#

· Delphi

Your grid appears like this:

2. Create a button that, when clicked, will undo a sort on the table. Add the following code to the Button1_Click event:

· Visual Basic

· C#

· Delphi

NOTE: The DataTable.DefaultView returns the DataView of the DataTable, and setting the sort string to null forces the DataView to undo the previous sort.

3. Click the Last Name column to sort on it.

4. Click the Undo button, and the sort will be undone.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using Password Entries in C1FlexGrid

Using Password Entries in C1FlexGrid

This topic demonstrates how to show placeholder characters (*) in cells used for password entry.

1. Create a column for passwords in the grid and set the draw mode:

· Visual Basic

· C#

· Delphi

2. Add the following code for the SetupEditor event. This code will hide characters that are entered by the user.

· Visual Basic

· C#

· Delphi

When the user enters a password in the Password column and presses ENTER, the text is automatically converted to asterisks.

3. Add the following code for the OwnerDrawCell event. This code will hide the characters that have already been entered and do not need edited.

· Visual Basic

· C#

· Delphi

4. Add the following code to the Form_Load event:

· Visual Basic

· C#

· Delphi

Run the project again and notice the numbers are automatically loaded onto the form in the Password column as asterisks.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Word Wrapping in a Header or Fixed Row

Word Wrapping in a Header or Fixed Row

This topic demonstrates how to set word wrapping in a header or fixed row.

1. Set the Caption property for a column header in the grid.

· Visual Basic

· C#

· Delphi

2. Set the row height of the header.

· Visual Basic

· C#

· Delphi

3. To enable word wrapping for the fixed cells, add the following code:

· Visual Basic

· C#

· Delphi

In this example, a two-line header is created, and the text is wrapped.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid Assembly

C1.Win.C1FlexGrid Assembly

Namespaces

C1.Win.C1FlexGrid

C1.Win.C1FlexGrid.Util.BaseControls

C1.Win.C1FlexGrid.Util.Styles

See Also

C1.Win.C1FlexGrid.Classic Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid Namespace

C1.Win.C1FlexGrid Namespace

C1.Win.C1FlexGrid Hierarchy

Classes

Class | Description
BeforeMouseDownEventArgs | Provides data for the BeforeMouseDown event.
C1FlexGrid | The C1FlexGrid control is a powerful, full-featured grid. C1FlexGrid provides advanced features such as outline trees, cell merging, masked editing, translated combo and image lists, owner-draw cells, and automatic data aggregation.
C1FlexGridBase | Base class for the C1FlexGrid control.
CellBorder | The CellBorder class encapsulates properties that control the appearance of borders in CellStyle objects.
CellStyle | The CellStyle class encapsulates properties that control the appearance of grid cells. This information includes the background and foreground colors, font, text and image alignment, etc.
CellStyleCollection | Collection of CellStyle objects defined for a grid.
Column | Class that represents a grid column.
ColumnCollection | Collection of grid Column objects.
DragRowColEventArgs | Provides data for the BeforeDragColumn, BeforeDragRow, AfterDragColumn, and AfterDragRow events.
GetErrorInfoEventArgs | Provides data for the GetCellErrorInfo and GetRowErrorInfo events.
GridChangedEventArgs | Provides data for the GridChanged event handler.
GridErrorEventArgs | Provides data for the GridError event.
GridGlyphs | Represents a collection of glyphs (images) indexed by glyph type ( GlyphEnum type).
GridPrinter | The GridPrinter class encapsulates properties that control printing, such as page and printer settings.
GridTree | The GridTree class enapsulates properties that specify the appearance, position, and behavior of the outline tree.
KeyEditEventArgs | Provides data for the KeyDownEdit and KeyUpEdit events.
KeyPressEditEventArgs | Provides data for the KeyPressEdit event.
MultiColumnDictionary | Class that implements the IC1MultiColumnDictionary and can be used as a column DataMap to create multi-column combo editors.
Node | The Node class encapsulates properties and methods used for manipulating node rows (collapsing, expanding, moving, and sorting them).
OwnerDrawCellEventArgs | Provides data for the OwnerDrawCell event.
RangeEventArgs | Provides data for the AfterRowColChange, AfterScroll, AfterSelChange, BeforeRowColChange, BeforeScroll, and BeforeSelChange events.
Row | Class that represents a grid row.
RowCol | Base class for grid rows and columns ( Row and Column classes).
RowColCollection | Base class for grid row and column collections ( RowCollection and ColumnCollection classes).
RowColEventArgs | Provides data for the AfterEdit, AfterResizeColumn, AfterResizeRow, BeforeEdit, BeforePageBreak, BeforeResizeColumn, BeforeResizeRow, BeforeScrollTip, CellButtonClick, ComboCloseUp, ComboDropDown, SetupEditor, and StartEdit events.
RowCollection | Collection of grid Row objects.
SortColEventArgs | Provides data for the BeforeSort and AfterSort events.
UnboundValueEventArgs | Provides data for the GetUnboundValue and SetUnboundValue events.
ValidateEditEventArgs | Provides data for the ValidateEdit event.

Interfaces

Interface | Description
IC1MultiColumnDictionary | Interface that extends System.Collections.IDictionary and can be used to implement multi-column data maps.

Delegates

Delegate | Description
BeforeMouseDownEventHandler | Represents the method that will handle the BeforeMouseDown event.
DragRowColEventHandler | Represents the method that will handle the BeforeDragColumn, BeforeDragRow, AfterDragColumn and AfterDragRow events.
GetErrorInfoEventHandler | Represents the method that will handle the GetCellErrorInfo and GetRowErrorInfo events.
GridChangedEventHandler | Represents the method that will handle the GridChanged event.
GridErrorEventHandler | Represents the method that will handle the GridError event.
KeyEditEventHandler | Represents the method that will handle the KeyDownEdit and KeyUpEdit events.
KeyPressEditEventHandler | Represents the method that will handle the KeyPressEdit event.
OwnerDrawCellEventHandler | Represents the method that will handle the OwnerDrawCell event.
RangeEventHandler | Represents the method that will handle the AfterRowColChange, AfterScroll, AfterSelChange, BeforeRowColChange, BeforeScroll, and BeforeSelChange events.
RowColEventHandler | Represents the method that will handle the AfterEdit, AfterResizeColumn, AfterResizeRow, BeforeEdit, BeforePageBreak, BeforeResizeColumn, BeforeResizeRow, BeforeScrollTip, CellButtonClick, ComboCloseUp, ComboDropDown, SetupEditor, and StartEdit events.
SortColEventHandler | Represents the method that will handle the BeforeSort and AfterSort events.
UnboundValueEventHandler | Represents the method that will handle the GetUnboundValue and SetUnboundValue events.
ValidateEditEventHandler | Represents the method that will handle the ValidateEdit event.

Enumerations

Enumeration | Description
AggregateEnum | Specifies the type of aggregate function to calculate with the Aggregate (AggregateEnum, CellRange, AggregateFlags) and Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) methods.
AggregateFlags | Specifies options to use when calculating aggregates with the Aggregate (AggregateEnum, CellRange, AggregateFlags) method.
AllowDraggingEnum | Specifies whether the user should be able to drag rows and columns with the mouse.
AllowFreezingEnum | Specifies whether the user should be able to freeze rows and columns with the mouse.
AllowMergingEnum | Specifies how adjacent cells are merged for display.
AllowResizingEnum | Specifies whether the user should be able to resize rows and columns with the mouse.
AllowSortingEnum | Specifies whether the user should be able to sort columns with the mouse.
AutoSearchEnum | Specifies where the grid should start searching for cells when using the AutoSearch property.
AutoSizeFlags | Specifies options that control autosizing.
BorderDirEnum | Specifies the direction of cell borders.
BorderStyleEnum | Specifies the type of cell border to display.
CellStyleEnum | Enumeration used to retrieve CellStyle objects from the Styles collection.
CheckEnum | Specifies the type of checkbox to draw in a cell.
ClearFlags | Specifies which elements of the grid should be cleared by the Clear (ClearFlags, CellRange) method.
DisplayEnum | Specifies whether a style should display the cell text, image, both, or none.
DragModeEnum | Specifies the behavior of the control as an OLE drag-drop source.
DrawCellFlags | Specifies which elements of the cell should be drawn by the grid.
DrawModeEnum | Specifies whether cells should be drawn entirely by the grid or with help from custom drawing code.
DropModeEnum | Specifies the behavior of the control as an OLE drag-drop target.
EditFlags | Specifies options that customize the grid's editing behavior.
FileFlags | Specifies options for use with the SaveGrid (String, FileFormatEnum, FileFlags, Encoding) and LoadGrid (String, FileFormatEnum, FileFlags, Encoding) methods.
FileFormatEnum | Specifies the type of file to save or load with the SaveGrid (String, FileFormatEnum, FileFlags, Encoding) and LoadGrid (String, FileFormatEnum, FileFlags, Encoding) methods.
FocusRectEnum | Specifies the appearance of the focus rectangle.
GlyphEnum | Specifies a type of glyph (image) used by the grid to convey information about a row, column, or cell.
GridChangedTypeEnum | Specifies the type of change that occurred when the controls fires the GridChanged event.
HighLightEnum | Specifies whether the grid should highlight the selected range.
HitTestTypeEnum | Type of grid element at a specific point on the control.
ImageAlignEnum | Specifies how images are aligns in grid cells.
KeyActionEnum | Specifies the action to perform when the ENTER and TAB keys are pressed.
MoveCursorEnum | This enumeration is for internal use only.
NodeMoveEnum | Specifies the destination of nodes when they are moved with the Move (NodeMoveEnum, Node) method.
NodeTypeEnum | Specifies a node with respect to another given node.
PrintGridFlags | Contains flags that specify printing options to use with the PrintGrid (String, PrintGridFlags) method.
SelectionModeEnum | Specifies the type of selection provided by the grid.
ShowButtonsEnum | Specifies when the grid should display combo buttons in cells.
SortFlags | Specifies how grid columns should be sorted.
StyleElementFlags | Contains flags that specify which style elements are defined in a CellStyle object.
SubtotalPositionEnum | Specifies whether subtotals rows created with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method should be inserted above or below the data they refer to.
TextAlignEnum | Specifies how text is aligned in a grid cell.
TextDirectionEnum | Specifies the direction to use when rendering text in a grid cell.
TextEffectEnum | Specifies a 3D effect to use when rendering cell text.
TreeStyleFlags | Specifies the appearance of the outline tree.

Structures

Structure | Description
CellRange | Encapsulates properties of cell ranges, allowing the called to set properties for a group of cells with a single statement.
HitTestInfo | HitTestInfo contains information about the control at a point on the screen (it returned by the HitTest (Int32, Int32) method).

See Also

C1.Win.C1FlexGrid Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AggregateEnum Enumeration

AggregateEnum Enumeration

Specifies the type of aggregate function to calculate with the Aggregate (AggregateEnum, CellRange, AggregateFlags) and Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) methods.

[Visual Basic]

Public Enum AggregateEnum

[C#]

public enum AggregateEnum

[Delphi]

type AggregateEnum = (Average, Clear, Count, Max, Min, None, Percent, Std, StdPop, Sum, Var, VarPop);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Average | Returns the average value of the non-empty cells in a range.
Clear | Clear existing aggregates. This setting is used with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method to clear any existing subtotals, usually before calculating new subtotals.
Count | Returns the count of non-empty cells in a range.
Max | Returns the maximum value in a range.
Min | Returns the minimum value in a range.
None | No aggregate. This setting is used with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method to create an outline tree without any numerical aggregates.
Percent | Percent of grand total. This setting is used with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method to calculate the percentage of the grand total represented by each sub group. (This setting cannot be used with the Aggregate (AggregateEnum, CellRange, AggregateFlags) method).
Std | Returns the sample standard deviation of the values in a range (uses the formula based on n-1).
StdPop | Returns the population standard deviation of the values in a range (uses the formula based on n).
Sum | Returns the sum of all values in the range.
Var | Returns the sample variance of the values in a range (uses the formula based on n-1).
VarPop | Returns the population variance of the values in a range (uses the formula based on n).

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AggregateFlags Enumeration

AggregateFlags Enumeration

Specifies options to use when calculating aggregates with the Aggregate (AggregateEnum, CellRange, AggregateFlags) method.

[Visual Basic]

Public Enum AggregateFlags

[C#]

public enum AggregateFlags

[Delphi]

type AggregateFlags = (AggregateBooleans, AggregateDates, ExcludeNodes, None);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
AggregateBooleans | Calculate aggregates for boolean values. This flag causes the value True to be interpreted as one, and False as zero. This option is useful for counting the number of checked checkboxes in a range.
AggregateDates | Calculate aggregates for dates instead of numerical values. Only a few aggregate functions are meaningful for dates: count, maximum, and minimum.
ExcludeNodes | Exclude node rows from aggregate. This option is useful when the grid contains subtotal rows, which are marked as nodes and contain values that are subtotals and should thus be excluded from aggregates.
None | Default setting. Include all rows and use numerical values only.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AllowDraggingEnum Enumeration

AllowDraggingEnum Enumeration

Specifies whether the user should be able to drag rows and columns with the mouse.

[Visual Basic]

Public Enum AllowDraggingEnum

[C#]

public enum AllowDraggingEnum

[Delphi]

type AllowDraggingEnum = (Both, Columns, None, Rows);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Both | The user may drag rows and columns with the mouse.
Columns | The user may drag columns with the mouse.
None | The user may not drag rows or columns.
Rows | The user may drag rows with the mouse.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AllowFreezingEnum Enumeration

AllowFreezingEnum Enumeration

Specifies whether the user should be able to freeze rows and columns with the mouse.

[Visual Basic]

Public Enum AllowFreezingEnum

[C#]

public enum AllowFreezingEnum

[Delphi]

type AllowFreezingEnum = (Both, Columns, None, Rows);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Both | The user may freeze rows and columns by dragging the frozen region boundaries with the mouse.
Columns | The user may freeze columns by dragging the frozen region vertical boundary with the mouse.
None | The user may not freeze rows or columns.
Rows | The user may freeze rows by dragging the frozen region horizontal boundary with the mouse.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AllowMergingEnum Enumeration

AllowMergingEnum Enumeration

Specifies how adjacent cells are merged for display.

[Visual Basic]

Public Enum AllowMergingEnum

[C#]

public enum AllowMergingEnum

[Delphi]

type AllowMergingEnum = (FixedOnly, Free, Nodes, None, RestrictAll, RestrictCols, RestrictRows, Spill);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
FixedOnly | Merge only fixed cells. This setting is useful for setting up complex headers for the data and preventing the data itself from being merged.
Free | Merge any adjacent cells with same contents.
Nodes | Allow long entries in node rows to spill into empty adjacent cells.
None | Do not merge any cells.
RestrictAll | Merge cells only if cells above or to the left are also merged.
RestrictCols | Merge columns only if cells to the left are also merged.
RestrictRows | Merge rows only if cells above are also merged.
Spill | Allow long entries to spill into empty adjacent cells.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AllowResizingEnum Enumeration

AllowResizingEnum Enumeration

Specifies whether the user should be able to resize rows and columns with the mouse.

[Visual Basic]

Public Enum AllowResizingEnum

[C#]

public enum AllowResizingEnum

[Delphi]

type AllowResizingEnum = (Both, BothUniform, Columns, ColumnsUniform, None, Rows, RowsUniform);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Both | The user may resize rows and columns with the mouse.
BothUniform | The user may change the default column width or row height with the mouse.
Columns | The user may resize columns with the mouse by dragging the edge of the column headers. Double-clicking the edge of a column header automatically sizes the column to fit the widest entry.
ColumnsUniform | The user may change the default column width with the mouse. Resizing any column will resize all columns that don't have a specific width assigned to them.
None | The user may not resize rows or columns.
Rows | The user may resize rows with the mouse by dragging the edge of the row headers. Double-clicking the edge of a row header automatically sizes the row to fit the tallest entry.
RowsUniform | The user may change the default row height with the mouse. Resizing any row will resize all rows that don't have a specific height assigned to them.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AllowSortingEnum Enumeration

AllowSortingEnum Enumeration

Specifies whether the user should be able to sort columns with the mouse.

[Visual Basic]

Public Enum AllowSortingEnum

[C#]

public enum AllowSortingEnum

[Delphi]

type AllowSortingEnum = (MultiColumn, None, SingleColumn);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
MultiColumn | The user may sort a range of columns by clicking on the header cell of the rightmost column in the range.
None | The user may not sort columns with the mouse.
SingleColumn | The user may sort single columns by clicking on its header cell.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AutoSearchEnum Enumeration

AutoSearchEnum Enumeration

Specifies where the grid should start searching for cells when using the AutoSearch property.

[Visual Basic]

Public Enum AutoSearchEnum

[C#]

public enum AutoSearchEnum

[Delphi]

type AutoSearchEnum = (FromCursor, FromTop, None);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
FromCursor | Search from the current row.
FromTop | Search from the first scrollable row.
None | No auto-searching.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AutoSizeFlags Enumeration

AutoSizeFlags Enumeration

Specifies options that control autosizing.

[Visual Basic]

Public Enum AutoSizeFlags

[C#]

public enum AutoSizeFlags

[Delphi]

type AutoSizeFlags = (IgnoreHidden, IgnoreMerged, None, SameSize);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
IgnoreHidden | Ignore invisible rows (or columns) when auto-sizing.
IgnoreMerged | Ignore merged cells when auto-sizing.
None | Default behavior.
SameSize | All rows (or columns) in the range are set to the same size.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs Class

BeforeMouseDownEventArgs Class

Provides data for the BeforeMouseDown event.

For a list of all members of this type, see BeforeMouseDownEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.BeforeMouseDownEventArgs

[Visual Basic]

Public Class BeforeMouseDownEventArgs

Inherits EventArgs

[C#]

public class BeforeMouseDownEventArgs : EventArgs

[Delphi]

type BeforeMouseDownEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs Members

BeforeMouseDownEventArgs Members

BeforeMouseDownEventArgs overview

Public Constructors

BeforeMouseDownEventArgs Constructor

Initializes a new instance of the BeforeMouseDownEventArgs class.

Public Fields

Button | Gets which mouse button was pressed.
Cancel | Gets or sets a value indicating whether the event should be canceled.
Clicks | Gets the number of times the mouse button was pressed and released.
Delta | Gets a signed count of the number of detents the mouse wheel has rotated. A detent is one notch of the mouse wheel.
X | Gets the x-coordinate of a mouse click.
Y | Gets the y-coordinate of a mouse click.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs Constructor

BeforeMouseDownEventArgs Constructor

Overload List

Initializes a new instance of the BeforeMouseDownEventArgs class.

[Visual Basic] Public Function New(C1FlexGridBase, MouseButtons, Integer)

[C#] public BeforeMouseDownEventArgs(C1FlexGridBase, MouseButtons, int);

[Delphi] public constructor Create(C1FlexGridBase; MouseButtons; Int32); overload;

Initializes a new instance of the BeforeMouseDownEventArgs class.

[Visual Basic] Public Function New(MouseEventArgs)

[C#] public BeforeMouseDownEventArgs(MouseEventArgs);

[Delphi] public constructor Create(MouseEventArgs); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs Constructor (C1FlexGridBase, MouseButtons, Int32)

BeforeMouseDownEventArgs Constructor (C1FlexGridBase, MouseButtons, Int32)

Initializes a new instance of the BeforeMouseDownEventArgs class.

[Visual Basic]

Public Function New( _

ByVal view As C1FlexGridBase, _

ByVal buttons As MouseButtons, _

ByVal clicks As Integer _

)

[C#]

public BeforeMouseDownEventArgs(

C1FlexGridBase view,

MouseButtons buttons,

int clicks

);

[Delphi]

public constructor Create(

view: C1FlexGridBase;

buttons: MouseButtons;

clicks: Int32

); overload;

Parameters

view

Control that will fire the event.

buttons

System.Windows.Forms.MouseButtons value that indicates which button was pressed.

clicks

Number of times the button was pressed and released.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs Constructor (MouseEventArgs)

BeforeMouseDownEventArgs Constructor (MouseEventArgs)

Initializes a new instance of the BeforeMouseDownEventArgs class.

[Visual Basic]

Public Function New( _

ByVal e As MouseEventArgs _

)

[C#]

public BeforeMouseDownEventArgs(

MouseEventArgs e

);

[Delphi]

public constructor Create(

e: MouseEventArgs

); overload;

Parameters

e

System.Windows.Forms.MouseEventArgs with mouse event information.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs Fields

BeforeMouseDownEventArgs Fields

The fields of the BeforeMouseDownEventArgs class are listed here. For a complete list of BeforeMouseDownEventArgs class members, see the BeforeMouseDownEventArgs Members topic.

Public Fields

Button | Gets which mouse button was pressed.
Cancel | Gets or sets a value indicating whether the event should be canceled.
Clicks | Gets the number of times the mouse button was pressed and released.
Delta | Gets a signed count of the number of detents the mouse wheel has rotated. A detent is one notch of the mouse wheel.
X | Gets the x-coordinate of a mouse click.
Y | Gets the y-coordinate of a mouse click.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs.Button Field

BeforeMouseDownEventArgs.Button Field

Gets which mouse button was pressed.

[Visual Basic]

Public ReadOnly Button As MouseButtons

[C#]

public readonly MouseButtons Button

[Delphi]

public Button: MouseButtons;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs.Cancel Field

BeforeMouseDownEventArgs.Cancel Field

Gets or sets a value indicating whether the event should be canceled.

[Visual Basic]

Public Cancel As Boolean

[C#]

public bool Cancel

[Delphi]

public Cancel: Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs.Clicks Field

BeforeMouseDownEventArgs.Clicks Field

Gets the number of times the mouse button was pressed and released.

[Visual Basic]

Public ReadOnly Clicks As Integer

[C#]

public readonly int Clicks

[Delphi]

public Clicks: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs.Delta Field

BeforeMouseDownEventArgs.Delta Field

Gets a signed count of the number of detents the mouse wheel has rotated. A detent is one notch of the mouse wheel.

[Visual Basic]

Public ReadOnly Delta As Integer

[C#]

public readonly int Delta

[Delphi]

public Delta: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs.X Field

BeforeMouseDownEventArgs.X Field

Gets the x-coordinate of a mouse click.

[Visual Basic]

Public ReadOnly X As Integer

[C#]

public readonly int X

[Delphi]

public X: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventArgs.Y Field

BeforeMouseDownEventArgs.Y Field

Gets the y-coordinate of a mouse click.

[Visual Basic]

Public ReadOnly Y As Integer

[C#]

public readonly int Y

[Delphi]

public Y: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BeforeMouseDownEventHandler Delegate

BeforeMouseDownEventHandler Delegate

Represents the method that will handle the BeforeMouseDown event.

[Visual Basic]

Public Delegate Sub BeforeMouseDownEventHandler( _

ByVal sender As Object, _

ByVal e As BeforeMouseDownEventArgs _

)

[C#]

public delegate void BeforeMouseDownEventHandler(

object sender,

BeforeMouseDownEventArgs e

);

[Delphi]

type BeforeMouseDownEventHandler = procedure (

sender: Object;

e: BeforeMouseDownEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BorderDirEnum Enumeration

BorderDirEnum Enumeration

Specifies the direction of cell borders.

[Visual Basic]

Public Enum BorderDirEnum

[C#]

public enum BorderDirEnum

[Delphi]

type BorderDirEnum = (Both, Horizontal, Vertical);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Both | Draw cell borders in both directions.
Horizontal | Draw cell borders only in the horizontal direction.
Vertical | Draw cell borders only in the vertical direction.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid.BorderStyleEnum Enumeration

C1.Win.C1FlexGrid.BorderStyleEnum Enumeration

Specifies the type of cell border to display.

[Visual Basic]

Public Enum C1.Win.C1FlexGrid.BorderStyleEnum

[C#]

public enum C1.Win.C1FlexGrid.BorderStyleEnum

[Delphi]

type C1.Win.C1FlexGrid.BorderStyleEnum = (Dotted, Double, Fillet, Flat, Groove, Inset, None, Raised);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Dotted | Dotted border.
Double | Double border.
Fillet | Fillet border.
Flat | Solid flat border.
Groove | Groove border.
Inset | Inset border.
None | No border.
Raised | Raised border.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid Class

C1FlexGrid Class

The C1FlexGrid control is a powerful, full-featured grid.

C1FlexGrid provides advanced features such as outline trees, cell merging, masked editing, translated combo and image lists, owner-draw cells, and automatic data aggregation.

For a list of all members of this type, see C1FlexGrid Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

System.Windows.Forms.Control

C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl

C1.Win.C1FlexGrid.C1FlexGridBase

C1.Win.C1FlexGrid.C1FlexGrid

C1.Win.C1FlexGrid.Classic.C1FlexGridClassic

[Visual Basic]

Public Class C1FlexGrid

Inherits C1FlexGridBase

[C#]

public class C1FlexGrid : C1FlexGridBase

[Delphi]

type C1FlexGrid = class (C1FlexGridBase);

Remarks

C1FlexGrid can be used in bound mode, where it displays data from .NET data sources, or in unbound mode, where the grid itself manages the data.

You can use C1FlexGrid to read and write Excel files (.xls), or read and write grid contents to and from XML files.

Classes derived from C1FlexGrid should have a LicenseProvider attribute so Visual Studio will embed the appropriate licensing information into projects that use the derived control.

For example:

[LicenseProvider(typeof(LicenseProvider))]

public class MyGrid : C1FlexGrid

{

// implementation

}

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid Members

C1FlexGrid Members

C1FlexGrid overview

Public Constructors

C1FlexGrid Constructor

Creates a new instance of the C1FlexGrid control.

Public Properties

AccessibilityObject (inherited from Control) | The accessibility object for this control.
AccessibleDefaultActionDescription (inherited from Control) | The default action description of the control.
AccessibleDescription (inherited from Control) | The description that will be reported to accessibility clients.
AccessibleName (inherited from Control) | The name that will be reported to accessibility clients.
AccessibleRole (inherited from Control) | The role that will be reported to accessibility clients.
AllowAddNew (inherited from C1FlexGridBase) | Gets or sets whether the grid should display a new row template after the last data row.
AllowDelete (inherited from C1FlexGridBase) | Gets or sets whether the grid should monitor the keyboard and handle the DEL key.
AllowDragging (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to drag rows and columns with the mouse.
AllowEditing (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to edit grid contents.
AllowFreezing (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to freeze rows and columns with the mouse.
AllowMerging | Specifies whether cells with the same contents should be merged.
AllowResizing (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to resize rows and columns with the mouse.
AllowSorting (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to sort columns using the mouse.
Anchor (inherited from Control) | The anchor of the control. Anchors define to which edges of the container a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant.
AutoClipboard (inherited from C1FlexGridBase) | Gets or sets whether the grid should handle the clipboard keys and automatically perform cut, copy, paste, and delete operations.
AutoGenerateColumns (inherited from C1FlexGridBase) | Gets or sets whether columns are automatically created when the grid is bound to a data source.
AutoResize (inherited from C1FlexGridBase) | Gets or sets whether column widths are automatically adjusted when data is loaded.
AutoSearch (inherited from C1FlexGridBase) | Gets or sets whether the grid should move the cursor searching for entries as the user types.
AutoSearchDelay (inherited from C1FlexGridBase) | Gets or sets the delay (in seconds) before the AutoSearch buffer is reset.
BackColor (inherited from C1FlexGridBase) | Gets or sets the background color for the control.
BackgroundImage (inherited from Control) | The background image used for the control.
BindingContext (inherited from Control) | The binding manager for this container.
BorderStyle (inherited from ScrollableControl) | Gets or sets the type of border around the control.
Bottom (inherited from Control) | The bottom of the control, in container coordinates.
BottomRow (inherited from C1FlexGridBase) | Gets the last visible row in the scrollable area.
Bounds (inherited from Control) | The bounds of the control, in container coordinates.
CanFocus (inherited from Control) | Checks if this control can receive the focus.
CanSelect (inherited from Control) | Checks if this control can be selected.
Capture (inherited from Control) | Determines if this control is currently capturing all mouse input.
CausesValidation (inherited from Control) | Indicates whether this control causes and raises validation events.
CellButtonImage (inherited from C1FlexGridBase) | Gets or sets the image to be used in cell buttons.
ClientRectangle (inherited from Control) | Retrieves the rectangle of the inner area of this control.
ClientSize (inherited from Control) | Determines the size of the inner area of this control.
Clip (inherited from C1FlexGridBase) | Gets or sets the contents of the selected range.
ClipSeparators (inherited from C1FlexGridBase) | Gets or sets the characters used as row and column separators in clip strings.
Col (inherited from C1FlexGridBase) | Gets or sets the column that contains the cursor.
Cols (inherited from C1FlexGridBase) | Gets the collection of Column objects in the grid.
ColSel (inherited from C1FlexGridBase) | Gets or sets the last column in the current selection.
ComboList (inherited from C1FlexGridBase) | Gets or sets the list of items to be used by the drop-down editor.
CompanyName (inherited from Control) | ControlCompanyNameDescr
ContainsFocus (inherited from Control) | Determines if this control or one if its children currently has the focus.
ContextMenu (inherited from Control) | The shortcut menu to display when the user right-clicks the control.
Controls (inherited from Control) | The collection of child controls within this control.
Created (inherited from Control) | Determines if the control has been fully created.
Cursor (inherited from ScrollableControl) | Gets or sets the cursor that appears when the mouse moves over the control.
CursorCell (inherited from C1FlexGridBase) | Gets a CellRange object that contains the cell at coordinates Row, Col.
CustomComparer (inherited from C1FlexGridBase) | Gets or sets a custom comparer object used by the grid to perform grouping, merging, and searching operations.
DataBindings (inherited from Control) | This collection holds all the bindings of properties of this control to data sources.
DataMember (inherited from C1FlexGridBase) | Gets or sets the specific list in a DataSource object that the grid should display.
DataSource (inherited from C1FlexGridBase) | Gets or sets the data source for the grid.
DisplayRectangle (inherited from Control) | Retrieves the display rectangle of this control.
Disposing (inherited from Control) | Determines if this control is in the process of being disposed.
Dock (inherited from Control) | The docking location of the control, indicating which borders are docked to the container.
DoubleBuffer (inherited from C1FlexGridBase) | Gets or sets whether the control should use an off-screen buffer when painting to reduce flicker.
DragMode (inherited from C1FlexGridBase) | Gets or sets a value that determines if the user can drag data from the control.
DrawMode (inherited from C1FlexGridBase) | Gets or sets whether the control should fire the OwnerDrawCell event.
DropMode (inherited from C1FlexGridBase) | Gets or sets a value that determines if the control can accept data that the user drags onto it.
EditMask (inherited from C1FlexGridBase) | Gets or sets the input mask to use when editing cells.
EditOptions (inherited from C1FlexGridBase) | Gets or sets flags that customize the grid's editing behavior.
Editor (inherited from C1FlexGridBase) | Gets or sets a reference to the cell editor that is currently active.
Enabled (inherited from Control) | Indicates whether the control is enabled.
ExtendLastCol (inherited from C1FlexGridBase) | Gets or sets whether the last column should be extended to fill the control.
Focused (inherited from Control) | Determines if this control has focus.
FocusRect (inherited from C1FlexGridBase) | Gets or sets the type of focus rectangle to display.
Font (inherited from Control) | The font used to display text in the control.
ForeColor (inherited from C1FlexGridBase) | Gets or sets the foreground color for the control.
Glyphs (inherited from C1FlexGridBase) | Gets the collection of control glyphs (images used to show sorting, checkboxes, etc).
Handle (inherited from Control) | The native handle for this control.
HasChildren (inherited from Control) | True if this control has child controls in its collection.
Height (inherited from Control) | The height of the control, in container coordinates.
HighLight (inherited from C1FlexGridBase) | Gets or sets when to highlight selected cells.
ImeMode (inherited from Control) | Determines the IME (Input Method Editor) status of the object when selected.
InvokeRequired (inherited from Control) | Determines if Invoke or InvokeAsync should be used to access this control cross-thread.
IsAccessible (inherited from Control) | Determines if this control supports Accessibility.
IsDisposed (inherited from Control) | Determines if this control has been disposed.
IsHandleCreated (inherited from Control) | Determines if the native handle has been created for this control.
KeyActionEnter (inherited from C1FlexGridBase) | Gets or sets the action to be performed when the user presses the ENTER key.
KeyActionTab (inherited from C1FlexGridBase) | Gets or sets the action to be performed when the user presses the TAB key.
Left (inherited from Control) | The upper left of the control, in container coordinates.
LeftCol (inherited from C1FlexGridBase) | Gets or sets the first visible column in the scrollable area.
Location (inherited from Control) | The position of the top-left corner of the control with respect to its container.
MouseCol (inherited from C1FlexGridBase) | Gets the index of the column under the cursor.
MouseRow (inherited from C1FlexGridBase) | Gets the index of the row under the cursor.
Parent (inherited from Control) | The parent of this control.
PrintParameters (inherited from C1FlexGridBase) | Gets a GridPrinter object that specifies printing parameters for the grid.
ProductName (inherited from Control) | Retrieves the name of the product associated with this component.
ProductVersion (inherited from Control) | Retrieves the version of the product associated with this component.
RecreatingHandle (inherited from Control) | Determines if this control is in the process of recreating its handle.
Redraw (inherited from C1FlexGridBase) | Gets or sets whether the grid should paint its contents.
Region (inherited from Control) | The region, or shape, of this control.
Right (inherited from Control) | The upper right of the control, in container coordinates.
RightCol (inherited from C1FlexGridBase) | Gets the last visible column in the scrollable area.
RightToLeft (inherited from Control) | Indicates whether the control should draw right-to-left for RTL languages.
Row (inherited from C1FlexGridBase) | Gets or sets the row that contains the cursor.
Rows (inherited from C1FlexGridBase) | Gets the collection of Row objects in the grid.
RowSel (inherited from C1FlexGridBase) | Gets or sets the last row in the current selection.
ScrollableRectangle (inherited from C1FlexGridBase) | Gets a rectangle that defines the scrollable portion of the control.
ScrollBars (inherited from ScrollableControl) | Gets or sets which scroll bars should appear on the control.
ScrollPosition (inherited from ScrollableControl) | Gets or sets the location of the auto-scroll position.
ScrollTips (inherited from ScrollableControl) | Gets or sets whether the control should display tooltips as the user scrolls vertically.
ScrollTipText (inherited from ScrollableControl) | Gets or sets the tooltip text displayed as the user scrolls vertically.
ScrollTrack (inherited from ScrollableControl) | Gets or sets whether the control should scroll as the user drags the scrollbar thumb.
Selection (inherited from C1FlexGridBase) | Gets the selected range in normalized form.
SelectionMode (inherited from C1FlexGridBase) | Gets or sets the grid's selection behavior.
ShowButtons (inherited from C1FlexGridBase) | Gets or sets when to display combo buttons in cells.
ShowCellLabels (inherited from C1FlexGridBase) | Gets or sets whether the grid should display labels over cells whose contents are partially hidden.
ShowCursor (inherited from C1FlexGridBase) | Gets or sets whether the grid should display a DB-style cursor on the first fixed column.
ShowErrors (inherited from C1FlexGridBase) | Gets or sets whether the grid should display error information in cells and rows.
ShowSort (inherited from C1FlexGridBase) | Gets or sets whether the grid should display sorting glyphs (a triangle) on the headers of sorted columns.
Size (inherited from Control) | The size of the control in pixels.
Styles (inherited from C1FlexGridBase) | Gets the collection of cell styles defined in the grid.
SubtotalPosition (inherited from C1FlexGridBase) | Gets or sets whether node rows appear above or below the data.
TabIndex (inherited from Control) | Determines the index in the TAB order that this control will occupy.
TabStop (inherited from Control) | Indicates whether the user can use the TAB key to give focus to the control.
Tag (inherited from Control) | User defined data associated with the control.
Top (inherited from Control) | The top of the control, in container coordinates.
TopLevelControl (inherited from Control) | Retrieves the top level control that contains this control.
TopRow (inherited from C1FlexGridBase) | Gets or sets the first visible row in the scrollable area.
Tree (inherited from C1FlexGridBase) | Gets a reference to the GridTree object that controls the appearance of the outline tree in the grid.
Visible (inherited from Control) | Determines whether the control is visible or hidden.
Width (inherited from Control) | The width of the control, in container coordinates.
Item (inherited from C1FlexGridBase) |

Public Methods

BeginInit (inherited from C1FlexGridBase) | Signals the object that initialization is starting.
Clear (inherited from C1FlexGridBase) | Overloaded. Clears the grid.
CreateImage (inherited from C1FlexGridBase) | Overloaded. Creates an image of the entire grid.
EndInit (inherited from C1FlexGridBase) | Signals the object that initialization is complete.
FinishEditing (inherited from C1FlexGridBase) | Overloaded. Finishes editing the current cell and takes the grid out of edit mode.
GetMergedRange | Overloaded. Returns the merged range of cells that includes a given cell.
HitTest (inherited from C1FlexGridBase) | Overloaded. Returns information about the control at the current mouse position.
Invalidate | Overloaded. Overriden. Invalidates a cell range, causing it to be repainted.
IsCellCursor | Overriden. Gets a value that determines if a cell contains the grid cursor.
IsCellHighlighted | Overriden. Gets a value that determines if a cell is part of the selection and should be highlighted.
RemoveItem (inherited from C1FlexGridBase) | Overloaded. Removes the last row from the grid.
StartEditing (inherited from C1FlexGridBase) | Overloaded. Puts the grid in edit mode and starts editing the current cell.
AutoSizeCols (inherited from C1FlexGridBase) | Adjusts the width of all columns to fit the data.
AutoSizeRows (inherited from C1FlexGridBase) | Adjusts the height of all rows to fit the data.

Public Events

AfterAddRow (inherited from C1FlexGridBase) | Fires after a new row is added by the user.
AfterCollapse (inherited from C1FlexGridBase) | Fires after a node row is collapsed or expanded.
AfterDataRefresh (inherited from C1FlexGridBase) | Fires after any data source change notifications.
AfterDeleteRow (inherited from C1FlexGridBase) | Fires after one or more rows are deleted by the user.
AfterDragColumn (inherited from C1FlexGridBase) | Fires after the user finishes dragging a column.
AfterDragRow (inherited from C1FlexGridBase) | Fires after the user finishes dragging a row.
AfterEdit (inherited from C1FlexGridBase) | Fires after a cell has been edited.
AfterFreezeColumn (inherited from C1FlexGridBase) | Fires after columns are frozen by dragging the frozen column divider.
AfterFreezeRow (inherited from C1FlexGridBase) | Fires after rows are frozen by dragging the frozen row divider.
AfterResizeColumn (inherited from C1FlexGridBase) | Fires after a column is resized by dragging the column header.
AfterResizeRow (inherited from C1FlexGridBase) | Fires after a row is resized by dragging the row header.
AfterRowColChange (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
AfterScroll (inherited from C1FlexGridBase) | Fires after the grid scrolls.
AfterSelChange (inherited from C1FlexGridBase) | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
AfterSort (inherited from C1FlexGridBase) | Fires after a column is sorted by a click on a column header.
BackColorChanged (inherited from Control) | Event fired when the value of BackColor property is changed on Control
BackgroundImageChanged (inherited from Control) | Event fired when the value of BackgroundImage property is changed on Control
BeforeAddRow (inherited from C1FlexGridBase) | Fires before a new row is added by the user.
BeforeAutosizeColumn (inherited from C1FlexGridBase) | Fires before a column is automatically resized by a double-click on a column header.
BeforeAutosizeRow (inherited from C1FlexGridBase) | Fires before a row is automatically resized by a double-click on a row header.
BeforeCollapse (inherited from C1FlexGridBase) | Fires before a node row is collapsed or expanded.
BeforeDeleteRow (inherited from C1FlexGridBase) | Fires before a row is deleted by the user.
BeforeDoubleClick (inherited from C1FlexGridBase) | Fires before the DoubleClick event is handled by the grid.
BeforeDragColumn (inherited from C1FlexGridBase) | Fires before the user starts dragging a column.
BeforeDragRow (inherited from C1FlexGridBase) | Fires before the user starts dragging a row.
BeforeEdit (inherited from C1FlexGridBase) | Fires before the grid enters edit mode, and also when the cell that has the focus needs to be painted.
BeforeFreezeColumn (inherited from C1FlexGridBase) | Fires before columns are frozen by dragging the frozen column divider.
BeforeFreezeRow (inherited from C1FlexGridBase) | Fires before rows are frozen by dragging the frozen row divider.
BeforeMouseDown (inherited from C1FlexGridBase) | Fires before the System.Windows.Forms.Control.MouseDown event is handled by the grid.
BeforePageBreak (inherited from C1FlexGridBase) | Fires while the control is being printed to provide control over page breaks.
BeforeResizeColumn (inherited from C1FlexGridBase) | Fires before a column is resized by dragging the column header.
BeforeResizeRow (inherited from C1FlexGridBase) | Fires before a row is resized by dragging the row header.
BeforeRowColChange (inherited from C1FlexGridBase) | Fires before the current cell changes ( Row and Col properties).
BeforeScroll (inherited from C1FlexGridBase) | Fires before the grid scrolls.
BeforeScrollTip (inherited from C1FlexGridBase) | Fires before the vertical scrolltip is displayed.
BeforeSelChange (inherited from C1FlexGridBase) | Fires before the selection changes ( Row, Col, RowSel, ColSel properties).
BeforeSort (inherited from C1FlexGridBase) | Fires before a column is sorted by a click on a column header.
BeginPrint (inherited from C1FlexGridBase) | Fires before the grid starts printing.
BindingContextChanged (inherited from Control) | Event fired when the value of BindingContext property is changed on Control
CancelAddRow (inherited from C1FlexGridBase) | Fires when the cursor leaves the new row without making any changes to it.
CausesValidationChanged (inherited from Control) | Event fired when the value of CausesValidation property is changed on Control
CellButtonClick (inherited from C1FlexGridBase) | Fires after the user clicks a cell button.
CellChanged (inherited from C1FlexGridBase) | Fires after the contents of a cell have changed.
ChangeEdit (inherited from C1FlexGridBase) | Fires in edit mode, after the contents of the editor change.
ChangeUICues (inherited from Control) | Occurs when focus rectangles and keyboard cue underlines are being shown or hidden.
Click (inherited from Control) | Occurs when the control is clicked.
ComboCloseUp (inherited from C1FlexGridBase) | Fires in edit mode, when the dropdown portion of an editor closes.
ComboDropDown (inherited from C1FlexGridBase) | Fires in edit mode, when the dropdown portion of an editor opens.
ContextMenuChanged (inherited from Control) | Event fired when the value of ContextMenu property is changed on Control
ControlAdded (inherited from Control) | Occurs when a control is added to this control.
ControlRemoved (inherited from Control) | Occurs when a control is removed from this control.
CursorChanged (inherited from Control) | Event fired when the value of Cursor property is changed on Control
DockChanged (inherited from Control) | Event fired when the value of Dock property is changed on Control
DoubleClick (inherited from Control) | Occurs when the control is double-clicked.
DragDrop (inherited from Control) | Occurs when the mouse drags an item and the user releases the mouse indicating that the item should be 'dropped' into this Control.
DragEnter (inherited from Control) | Occurs when the mouse drags an item into the client area for this Control.
DragLeave (inherited from Control) | Occurs when the mouse drags an item and is no longer over the client area for this Control.
DragOver (inherited from Control) | Occurs when the mouse drags an item and is moving over the client area of this Control.
EnabledChanged (inherited from Control) | Occurs when the control's enabled state changes.
EndPrint (inherited from C1FlexGridBase) | Fires after the grid finishes printing.
Enter (inherited from Control) | Occurs when the control becomes the active control of the form.
EnterCell (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
FontChanged (inherited from Control) | Event fired when the value of Font property is changed on Control
ForeColorChanged (inherited from Control) | Event fired when the value of ForeColor property is changed on Control
GetCellErrorInfo (inherited from C1FlexGridBase) | Fires when ShowErrors is set to True and the control needs error information for a cell.
GetRowErrorInfo (inherited from C1FlexGridBase) | Fires when ShowErrors is set to True and the control needs error information for a row.
GetUnboundValue (inherited from C1FlexGridBase) | Fires when the grid needs to retrieve data for an unbound cell.
GiveFeedback (inherited from Control) | Occurs when the mouse drags an item. The system requests that the Control provide feedback to that effect.
GotFocus (inherited from Control) | Occurs when the control gets focus.
GridChanged (inherited from C1FlexGridBase) | Fires when the grid or its contents change.
GridError (inherited from C1FlexGridBase) | Fires after the data source reports an error condition.
HandleCreated (inherited from Control) | Occurs when the control's native handle is created.
HandleDestroyed (inherited from Control) | Occurs when the control's native handle is destroyed.
HelpRequested (inherited from Control) | Occurs when the user invokes help for the control.
ImeModeChanged (inherited from Control) | Occurs when the control's IME mode changes
Invalidated (inherited from Control) | Occurs when one of the invalidate methods is called.
KeyDown (inherited from Control) | Occurs when a key is first pressed.
KeyDownEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user presses a key.
KeyPress (inherited from Control) | Occurs after the user is finished pressing a key.
KeyPressEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user presses a character key.
KeyUp (inherited from Control) | Occurs when a key is released.
KeyUpEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user releases a key.
Layout (inherited from Control) | Occurs when the control is about to lay out its contents.
Leave (inherited from Control) | Occurs when the control is no longer the active control of the form.
LeaveCell (inherited from C1FlexGridBase) | Fires before the current cell changes ( Row and Col properties).
LeaveEdit (inherited from C1FlexGridBase) | Fires after the control leaves edit mode.
LocationChanged (inherited from Control) | Event fired when the value of Location property is changed on Control
LostFocus (inherited from Control) | Occurs when the control gets focus.
MouseDown (inherited from Control) | Occurs when a mouse button is pressed.
MouseEnter (inherited from Control) | Occurs when the mouse enters the visible part of the control.
MouseHover (inherited from Control) | Occurs when the mouse remains stationary inside of the control for an amount of time.
MouseHoverCell (inherited from C1FlexGridBase) | Fires when the mouse enters or leaves a cell.
MouseLeave (inherited from Control) | Occurs when the mouse leaves the visible part of the control.
MouseMove (inherited from Control) | Occurs when the mouse is moved.
MouseUp (inherited from Control) | Occurs when a mouse button is released.
MouseWheel (inherited from Control) | Occurs when the mouse wheel is rolled.
Move (inherited from Control) | Occurs when a control is moved.
OwnerDrawCell (inherited from C1FlexGridBase) | Fires before the grid draws a cell, when the DrawMode property is set to .
Paint (inherited from Control) | Occurs when a control needs repainting.
ParentChanged (inherited from Control) | Event fired when the value of Parent property is changed on Control
PrintPage (inherited from C1FlexGridBase) | Fires after the grid finishes printing a page.
QueryAccessibilityHelp (inherited from Control) | Occurs when an Accessibility client invokes help for the control.
QueryContinueDrag (inherited from Control) | Occurs when the mouse drags an item. The system requests whether the drag and drop operation should be allowed to continue.
Resize (inherited from Control) | Occurs when a control is resized.
RightToLeftChanged (inherited from Control) | Event fired when the value of RightToLeft property is changed on Control
RowColChange (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
SelChange (inherited from C1FlexGridBase) | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
SetUnboundValue (inherited from C1FlexGridBase) | Fires when the grid needs to store data in an unbound cell.
SetupEditor (inherited from C1FlexGridBase) | Fires after a cell editor has been initialized by the grid, to allow additional custom initialization.
SizeChanged (inherited from Control) | Event fired when the value of Size property is changed on Control
StartDrag (inherited from C1FlexGridBase) | Fires before the grid starts an automatic OLE drag operation.
StartEdit (inherited from C1FlexGridBase) | Fires before the control enters edit mode.
StyleChanged (inherited from Control) | Event fired when the window style of a Control is changed
SystemColorsChanged (inherited from Control) | Event fired when the system colors change
TabIndexChanged (inherited from Control) | Event fired when the value of TabIndex property is changed on Control
TabStopChanged (inherited from Control) | Event fired when the value of TabStop property is changed on Control
TextChanged (inherited from Control) | Event fired when the value of Text property is changed on Control
Validated (inherited from Control) | Occurs after a control has been successfully validated.
ValidateEdit (inherited from C1FlexGridBase) | Fires before the control exits cell edit mode, while the editor is still active.
Validating (inherited from Control) | Occurs when a control is being validated. Set to True the Cancel property on the event parameter to cancel the validation.
VisibleChanged (inherited from Control) | Occurs when the control's visibility changes.

Protected Properties

ResizeRedraw (inherited from Control)

Indicates whether the control should redraw itself when resized.

Protected Methods

CreateAccessibilityInstance (inherited from C1FlexGridBase) | Creates a new accessibility object for the control.
DrawCell | Overriden. Draws a grid cell.
DrawRow | Overriden. Draws a grid row.
GetHeaderThemeState | Overriden. Gets the state for a Windows XP theme while the mouse moves over a cell.
OnImeStartComposition (inherited from ScrollableControl) | Called when the control receives a WM_IME_STARTCOMPOSITION message.
OnScroll | Overriden. Called when the grid contents scroll.
OnThemeChanged (inherited from C1FlexGridBase) | Called when the control receives a WM_THEMECHANGED message.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid Constructor

C1FlexGrid Constructor

Creates a new instance of the C1FlexGrid control.

[Visual Basic]

Public Function New()

[C#]

public C1FlexGrid()

[Delphi]

public constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid Properties

C1FlexGrid Properties

The properties of the C1FlexGrid class are listed here. For a complete list of C1FlexGrid class members, see the C1FlexGrid Members topic.

Public Properties

AccessibilityObject (inherited from Control) | The accessibility object for this control.
AccessibleDefaultActionDescription (inherited from Control) | The default action description of the control.
AccessibleDescription (inherited from Control) | The description that will be reported to accessibility clients.
AccessibleName (inherited from Control) | The name that will be reported to accessibility clients.
AccessibleRole (inherited from Control) | The role that will be reported to accessibility clients.
AllowAddNew (inherited from C1FlexGridBase) | Gets or sets whether the grid should display a new row template after the last data row.
AllowDelete (inherited from C1FlexGridBase) | Gets or sets whether the grid should monitor the keyboard and handle the DEL key.
AllowDragging (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to drag rows and columns with the mouse.
AllowEditing (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to edit grid contents.
AllowFreezing (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to freeze rows and columns with the mouse.
AllowMerging | Specifies whether cells with the same contents should be merged.
AllowResizing (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to resize rows and columns with the mouse.
AllowSorting (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to sort columns using the mouse.
Anchor (inherited from Control) | The anchor of the control. Anchors define to which edges of the container a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant.
AutoClipboard (inherited from C1FlexGridBase) | Gets or sets whether the grid should handle the clipboard keys and automatically perform cut, copy, paste, and delete operations.
AutoGenerateColumns (inherited from C1FlexGridBase) | Gets or sets whether columns are automatically created when the grid is bound to a data source.
AutoResize (inherited from C1FlexGridBase) | Gets or sets whether column widths are automatically adjusted when data is loaded.
AutoSearch (inherited from C1FlexGridBase) | Gets or sets whether the grid should move the cursor searching for entries as the user types.
AutoSearchDelay (inherited from C1FlexGridBase) | Gets or sets the delay (in seconds) before the AutoSearch buffer is reset.
BackColor (inherited from C1FlexGridBase) | Gets or sets the background color for the control.
BackgroundImage (inherited from Control) | The background image used for the control.
BindingContext (inherited from Control) | The binding manager for this container.
BorderStyle (inherited from ScrollableControl) | Gets or sets the type of border around the control.
Bottom (inherited from Control) | The bottom of the control, in container coordinates.
BottomRow (inherited from C1FlexGridBase) | Gets the last visible row in the scrollable area.
Bounds (inherited from Control) | The bounds of the control, in container coordinates.
CanFocus (inherited from Control) | Checks if this control can receive the focus.
CanSelect (inherited from Control) | Checks if this control can be selected.
Capture (inherited from Control) | Determines if this control is currently capturing all mouse input.
CausesValidation (inherited from Control) | Indicates whether this control causes and raises validation events.
CellButtonImage (inherited from C1FlexGridBase) | Gets or sets the image to be used in cell buttons.
ClientRectangle (inherited from Control) | Retrieves the rectangle of the inner area of this control.
ClientSize (inherited from Control) | Determines the size of the inner area of this control.
Clip (inherited from C1FlexGridBase) | Gets or sets the contents of the selected range.
ClipSeparators (inherited from C1FlexGridBase) | Gets or sets the characters used as row and column separators in clip strings.
Col (inherited from C1FlexGridBase) | Gets or sets the column that contains the cursor.
Cols (inherited from C1FlexGridBase) | Gets the collection of Column objects in the grid.
ColSel (inherited from C1FlexGridBase) | Gets or sets the last column in the current selection.
ComboList (inherited from C1FlexGridBase) | Gets or sets the list of items to be used by the drop-down editor.
CompanyName (inherited from Control) | ControlCompanyNameDescr
ContainsFocus (inherited from Control) | Determines if this control or one if its children currently has the focus.
ContextMenu (inherited from Control) | The shortcut menu to display when the user right-clicks the control.
Controls (inherited from Control) | The collection of child controls within this control.
Created (inherited from Control) | Determines if the control has been fully created.
Cursor (inherited from ScrollableControl) | Gets or sets the cursor that appears when the mouse moves over the control.
CursorCell (inherited from C1FlexGridBase) | Gets a CellRange object that contains the cell at coordinates Row, Col.
CustomComparer (inherited from C1FlexGridBase) | Gets or sets a custom comparer object used by the grid to perform grouping, merging, and searching operations.
DataBindings (inherited from Control) | This collection holds all the bindings of properties of this control to data sources.
DataMember (inherited from C1FlexGridBase) | Gets or sets the specific list in a DataSource object that the grid should display.
DataSource (inherited from C1FlexGridBase) | Gets or sets the data source for the grid.
DisplayRectangle (inherited from Control) | Retrieves the display rectangle of this control.
Disposing (inherited from Control) | Determines if this control is in the process of being disposed.
Dock (inherited from Control) | The docking location of the control, indicating which borders are docked to the container.
DoubleBuffer (inherited from C1FlexGridBase) | Gets or sets whether the control should use an off-screen buffer when painting to reduce flicker.
DragMode (inherited from C1FlexGridBase) | Gets or sets a value that determines if the user can drag data from the control.
DrawMode (inherited from C1FlexGridBase) | Gets or sets whether the control should fire the OwnerDrawCell event.
DropMode (inherited from C1FlexGridBase) | Gets or sets a value that determines if the control can accept data that the user drags onto it.
EditMask (inherited from C1FlexGridBase) | Gets or sets the input mask to use when editing cells.
EditOptions (inherited from C1FlexGridBase) | Gets or sets flags that customize the grid's editing behavior.
Editor (inherited from C1FlexGridBase) | Gets or sets a reference to the cell editor that is currently active.
Enabled (inherited from Control) | Indicates whether the control is enabled.
ExtendLastCol (inherited from C1FlexGridBase) | Gets or sets whether the last column should be extended to fill the control.
Focused (inherited from Control) | Determines if this control has focus.
FocusRect (inherited from C1FlexGridBase) | Gets or sets the type of focus rectangle to display.
Font (inherited from Control) | The font used to display text in the control.
ForeColor (inherited from C1FlexGridBase) | Gets or sets the foreground color for the control.
Glyphs (inherited from C1FlexGridBase) | Gets the collection of control glyphs (images used to show sorting, checkboxes, etc).
Handle (inherited from Control) | The native handle for this control.
HasChildren (inherited from Control) | True if this control has child controls in its collection.
Height (inherited from Control) | The height of the control, in container coordinates.
HighLight (inherited from C1FlexGridBase) | Gets or sets when to highlight selected cells.
ImeMode (inherited from Control) | Determines the IME (Input Method Editor) status of the object when selected.
InvokeRequired (inherited from Control) | Determines if Invoke or InvokeAsync should be used to access this control cross-thread.
IsAccessible (inherited from Control) | Determines if this control supports Accessibility.
IsDisposed (inherited from Control) | Determines if this control has been disposed.
IsHandleCreated (inherited from Control) | Determines if the native handle has been created for this control.
KeyActionEnter (inherited from C1FlexGridBase) | Gets or sets the action to be performed when the user presses the ENTER key.
KeyActionTab (inherited from C1FlexGridBase) | Gets or sets the action to be performed when the user presses the TAB key.
Left (inherited from Control) | The upper left of the control, in container coordinates.
LeftCol (inherited from C1FlexGridBase) | Gets or sets the first visible column in the scrollable area.
Location (inherited from Control) | The position of the top-left corner of the control with respect to its container.
MouseCol (inherited from C1FlexGridBase) | Gets the index of the column under the cursor.
MouseRow (inherited from C1FlexGridBase) | Gets the index of the row under the cursor.
Parent (inherited from Control) | The parent of this control.
PrintParameters (inherited from C1FlexGridBase) | Gets a GridPrinter object that specifies printing parameters for the grid.
ProductName (inherited from Control) | Retrieves the name of the product associated with this component.
ProductVersion (inherited from Control) | Retrieves the version of the product associated with this component.
RecreatingHandle (inherited from Control) | Determines if this control is in the process of recreating its handle.
Redraw (inherited from C1FlexGridBase) | Gets or sets whether the grid should paint its contents.
Region (inherited from Control) | The region, or shape, of this control.
Right (inherited from Control) | The upper right of the control, in container coordinates.
RightCol (inherited from C1FlexGridBase) | Gets the last visible column in the scrollable area.
RightToLeft (inherited from Control) | Indicates whether the control should draw right-to-left for RTL languages.
Row (inherited from C1FlexGridBase) | Gets or sets the row that contains the cursor.
Rows (inherited from C1FlexGridBase) | Gets the collection of Row objects in the grid.
RowSel (inherited from C1FlexGridBase) | Gets or sets the last row in the current selection.
ScrollableRectangle (inherited from C1FlexGridBase) | Gets a rectangle that defines the scrollable portion of the control.
ScrollBars (inherited from ScrollableControl) | Gets or sets which scroll bars should appear on the control.
ScrollPosition (inherited from ScrollableControl) | Gets or sets the location of the auto-scroll position.
ScrollTips (inherited from ScrollableControl) | Gets or sets whether the control should display tooltips as the user scrolls vertically.
ScrollTipText (inherited from ScrollableControl) | Gets or sets the tooltip text displayed as the user scrolls vertically.
ScrollTrack (inherited from ScrollableControl) | Gets or sets whether the control should scroll as the user drags the scrollbar thumb.
Selection (inherited from C1FlexGridBase) | Gets the selected range in normalized form.
SelectionMode (inherited from C1FlexGridBase) | Gets or sets the grid's selection behavior.
ShowButtons (inherited from C1FlexGridBase) | Gets or sets when to display combo buttons in cells.
ShowCellLabels (inherited from C1FlexGridBase) | Gets or sets whether the grid should display labels over cells whose contents are partially hidden.
ShowCursor (inherited from C1FlexGridBase) | Gets or sets whether the grid should display a DB-style cursor on the first fixed column.
ShowErrors (inherited from C1FlexGridBase) | Gets or sets whether the grid should display error information in cells and rows.
ShowSort (inherited from C1FlexGridBase) | Gets or sets whether the grid should display sorting glyphs (a triangle) on the headers of sorted columns.
Size (inherited from Control) | The size of the control in pixels.
Styles (inherited from C1FlexGridBase) | Gets the collection of cell styles defined in the grid.
SubtotalPosition (inherited from C1FlexGridBase) | Gets or sets whether node rows appear above or below the data.
TabIndex (inherited from Control) | Determines the index in the TAB order that this control will occupy.
TabStop (inherited from Control) | Indicates whether the user can use the TAB key to give focus to the control.
Tag (inherited from Control) | User defined data associated with the control.
Top (inherited from Control) | The top of the control, in container coordinates.
TopLevelControl (inherited from Control) | Retrieves the top level control that contains this control.
TopRow (inherited from C1FlexGridBase) | Gets or sets the first visible row in the scrollable area.
Tree (inherited from C1FlexGridBase) | Gets a reference to the GridTree object that controls the appearance of the outline tree in the grid.
Visible (inherited from Control) | Determines whether the control is visible or hidden.
Width (inherited from Control) | The width of the control, in container coordinates.
Item (inherited from C1FlexGridBase) |

Protected Properties

ResizeRedraw (inherited from Control)

Indicates whether the control should redraw itself when resized.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.AllowMerging Property

C1FlexGrid.AllowMerging Property

Specifies whether cells with the same contents should be merged.

[Visual Basic]

Public Property AllowMerging As AllowMergingEnum

[C#]

public AllowMergingEnum AllowMerging {get;set;}

[Delphi]

public property AllowMerging: AllowMergingEnum read get_AllowMerging write set_AllowMerging;

Remarks

Merging cells allows you to display data in a clear, appealing way, because it highlights groups of identical information. It also gives you flexibility to build tables similar to the ones you can create in HTML or using Microsoft Word, both of which support merged cells.

To create tables with merged cells, set the AllowMerging property to a value other than AllowMergingEnum.None, and set the AllowMerging property of individual rows and columns True for the rows and columns you wish to merge. After these properties are set, the grid will automatically merge adjacent cells that have the same contents.

Whenever the cell contents change, the grid updates the merging state.

Example

The code below causes the grid to merge cells with the same data in column 1:

flex.AllowMerging = AllowMergingEnum.Free;

flex.Cols[1].AllowMerging = true; // merge values in column 1

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid Methods

C1FlexGrid Methods

The methods of the C1FlexGrid class are listed here. For a complete list of C1FlexGrid class members, see the C1FlexGrid Members topic.

Public Methods

BeginInit (inherited from C1FlexGridBase) | Signals the object that initialization is starting.
Clear (inherited from C1FlexGridBase) | Overloaded. Clears the grid.
CreateImage (inherited from C1FlexGridBase) | Overloaded. Creates an image of the entire grid.
EndInit (inherited from C1FlexGridBase) | Signals the object that initialization is complete.
FinishEditing (inherited from C1FlexGridBase) | Overloaded. Finishes editing the current cell and takes the grid out of edit mode.
GetMergedRange | Overloaded. Returns the merged range of cells that includes a given cell.
HitTest (inherited from C1FlexGridBase) | Overloaded. Returns information about the control at the current mouse position.
Invalidate | Overloaded. Overriden. Invalidates a cell range, causing it to be repainted.
IsCellCursor | Overriden. Gets a value that determines if a cell contains the grid cursor.
IsCellHighlighted | Overriden. Gets a value that determines if a cell is part of the selection and should be highlighted.
RemoveItem (inherited from C1FlexGridBase) | Overloaded. Removes the last row from the grid.
StartEditing (inherited from C1FlexGridBase) | Overloaded. Puts the grid in edit mode and starts editing the current cell.
AutoSizeCols (inherited from C1FlexGridBase) | Adjusts the width of all columns to fit the data.
AutoSizeRows (inherited from C1FlexGridBase) | Adjusts the height of all rows to fit the data.

Protected Methods

CreateAccessibilityInstance (inherited from C1FlexGridBase) | Creates a new accessibility object for the control.
DrawCell | Overriden. Draws a grid cell.
DrawRow | Overriden. Draws a grid row.
GetHeaderThemeState | Overriden. Gets the state for a Windows XP theme while the mouse moves over a cell.
OnImeStartComposition (inherited from ScrollableControl) | Called when the control receives a WM_IME_STARTCOMPOSITION message.
OnScroll | Overriden. Called when the grid contents scroll.
OnThemeChanged (inherited from C1FlexGridBase) | Called when the control receives a WM_THEMECHANGED message.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.DrawCell Method

C1FlexGrid.DrawCell Method

Draws a grid cell.

[Visual Basic]

Overrides Protected Function DrawCell( _

ByVal e As PaintEventArgs, _

ByVal row As Integer, _

ByVal col As Integer _

) As Integer

[C#]

override protected int DrawCell(

PaintEventArgs e,

int row,

int col

);

[Delphi]

strict protected function DrawCell(

e: PaintEventArgs;

row: Int32;

col: Int32

): Int32; override;

Parameters

e

A System.Windows.Forms.PaintEventArgs that contains a System.Drawing.Graphics object where the cell will be drawn.

row

Index of the cell's row.

col

Index of the cell's column.

Return Value

The index of the last column painted (may be greater than col if columns are merged).

Remarks

This method is for internal use. It allows inherited classes to customize the grid appearance.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.DrawRow Method

C1FlexGrid.DrawRow Method

Draws a grid row.

[Visual Basic]

Overrides Protected Sub DrawRow( _

ByVal e As PaintEventArgs, _

ByVal row As Integer _

)

[C#]

override protected void DrawRow(

PaintEventArgs e,

int row

);

[Delphi]

strict protected procedure DrawRow(

e: PaintEventArgs;

row: Int32

); override;

Parameters

e

A System.Windows.Forms.PaintEventArgs that contains a System.Drawing.Graphics object where the row will be drawn.

row

Index of the row to draw.

Remarks

This method is for internal use. It allows inherited classes to customize the grid appearance.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.GetHeaderThemeState Method

C1FlexGrid.GetHeaderThemeState Method

Gets the state for a Windows XP theme while the mouse moves over a cell.

[Visual Basic]

Overrides Protected Function GetHeaderThemeState( _

ByVal row As Integer, _

ByVal col As Integer _

) As Integer

[C#]

override protected int GetHeaderThemeState(

int row,

int col

);

[Delphi]

strict protected function GetHeaderThemeState(

row: Int32;

col: Int32

): Int32; override;

Parameters

row

Row under the mouse.

col

Column under the mouse.

Return Value

An integer representing the item state (2 for hot-tracking, 1 for normal).

Remarks

This method is for internal use. It allows inherited classes to customize the hot-tracking behavior.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.GetMergedRange Method

C1FlexGrid.GetMergedRange Method

Overload List

Returns the merged range of cells that includes a given cell.

[Visual Basic] Overloads Public Function GetMergedRange(Integer, Integer) As CellRange

[C#] public CellRange GetMergedRange(int, int);

[Delphi] public function GetMergedRange(Int32; Int32) : CellRange; overload;

Returns the merged range of cells that includes a given cell.

[Visual Basic] Overloads Overridable Public Function GetMergedRange(Integer, Integer, Boolean) As CellRange

[C#] virtual public CellRange GetMergedRange(int, int, bool);

[Delphi] public function GetMergedRange(Int32; Int32; Boolean) : CellRange; overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.GetMergedRange Method (Int32, Int32)

C1FlexGrid.GetMergedRange Method (Int32, Int32)

Returns the merged range of cells that includes a given cell.

[Visual Basic]

Overloads Public Function GetMergedRange( _

ByVal row As Integer, _

ByVal col As Integer _

) As CellRange

[C#]

public CellRange GetMergedRange(

int row,

int col

);

[Delphi]

public function GetMergedRange(

row: Int32;

col: Int32

): CellRange; overload;

Parameters

row

Row index.

col

Column index.

Return Value

A CellRange object that contains the given cell.

Remarks

This method returns the entire range, including invisible cells.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.GetMergedRange Method (Int32, Int32, Boolean)

C1FlexGrid.GetMergedRange Method (Int32, Int32, Boolean)

Returns the merged range of cells that includes a given cell.

[Visual Basic]

Overloads Overridable Public Function GetMergedRange( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal clip As Boolean _

) As CellRange

[C#]

virtual public CellRange GetMergedRange(

int row,

int col,

bool clip

);

[Delphi]

public function GetMergedRange(

row: Int32;

col: Int32;

clip: Boolean

): CellRange; overload; virtual;

Parameters

row

Row index.

col

Column index.

clip

Whether the range should be clipped to the visible area of the grid.

Return Value

A CellRange object that contains the given cell.

Remarks

Cell merging is controlled by the AllowMerging property. The GetMergedRange (Int32, Int32, Boolean) method allows you to determine whether a cell is merged with adjacent cells.

You can override the GetMergedRange (Int32, Int32, Boolean) method to implement custom merging logic. If you do this, make sure the merging method is consistent and efficient, since it gets called frequently and affects the grid's appearance and behavior.

Example

The code below checks the current cell after a selection to see if it is part of a merged range:

private void _flex_SelChange(object sender, System.EventArgs e)

{

CellRange rg = this._flex.GetMergedRange(_flex.Row, _flex.Col, false);

if (!rg.IsSingleCell)

{

Console.WriteLine("selection is merged: {0},{1}-{2},{3}",

rg.TopRow, rg.LeftCol, rg.BottomRow, rg.RightCol);

}

}

The code below shows how you can override the GetMergedRange (Int32, Int32, Boolean) method to provide custom merging:

public class CustomMerge : C1FlexGrid

{

public CustomMerge()

{

// allow free merging by default

AllowMerging = AllowMergingEnum.Free;

for (int r = 0; r < Rows.Count; r++) Rows[r].AllowMerging = true;

for (int c = 0; c < Cols.Count; c++) Cols[c].AllowMerging = true;

}

override public CellRange GetMergedRange(int row, int col, bool clip)

{

// merge cells in range (1,1)-(3,3)

if (row >= 1 && row <= 3 && col >= 1 && col <= 3)

return GetCellRange(1, 1, 3, 3);

// don't merge anything else

return GetCellRange(row, col);

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.Invalidate Method

C1FlexGrid.Invalidate Method

Invalidates a cell range, causing it to be repainted.

[Visual Basic]

Overrides Public Sub Invalidate( _

ByVal rg As CellRange _

)

[C#]

override public void Invalidate(

CellRange rg

);

[Delphi]

public procedure Invalidate(

rg: CellRange

); overload; override;

Parameters

rg

Range to be invalidated.

Remarks

This method is rarely used by the programmer, since the grid automatically performs invalidation as needed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.IsCellCursor Method

C1FlexGrid.IsCellCursor Method

Gets a value that determines if a cell contains the grid cursor.

[Visual Basic]

Overrides Public Function IsCellCursor( _

ByVal row As Integer, _

ByVal col As Integer _

) As Boolean

[C#]

override public bool IsCellCursor(

int row,

int col

);

[Delphi]

public function IsCellCursor(

row: Int32;

col: Int32

): Boolean; override;

Parameters

row

Row index.

col

Column index.

Return Value

True if the cell contains the cursor, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.IsCellHighlighted Method

C1FlexGrid.IsCellHighlighted Method

Gets a value that determines if a cell is part of the selection and should be highlighted.

[Visual Basic]

Overrides Public Function IsCellHighlighted( _

ByVal row As Integer, _

ByVal col As Integer _

) As Boolean

[C#]

override public bool IsCellHighlighted(

int row,

int col

);

[Delphi]

public function IsCellHighlighted(

row: Int32;

col: Int32

): Boolean; override;

Parameters

row

Row index.

col

Column index.

Return Value

True if the cell should be highlighted, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid.OnScroll Method

C1FlexGrid.OnScroll Method

Called when the grid contents scroll.

[Visual Basic]

Overrides Protected Sub OnScroll( _

ByVal sb As ScrollBars _

)

[C#]

override protected void OnScroll(

ScrollBars sb

);

[Delphi]

strict protected procedure OnScroll(

sb: ScrollBars

); override;

Parameters

sb

System.Windows.Forms.ScrollBars value that specifies the scroll direction.

Remarks

This method is for internal use. It allows inherited classes to customize the grid scrolling behavior.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGrid Events

C1FlexGrid Events

The events of the C1FlexGrid class are listed here. For a complete list of C1FlexGrid class members, see the C1FlexGrid Members topic.

Public Events

AfterAddRow (inherited from C1FlexGridBase) | Fires after a new row is added by the user.
AfterCollapse (inherited from C1FlexGridBase) | Fires after a node row is collapsed or expanded.
AfterDataRefresh (inherited from C1FlexGridBase) | Fires after any data source change notifications.
AfterDeleteRow (inherited from C1FlexGridBase) | Fires after one or more rows are deleted by the user.
AfterDragColumn (inherited from C1FlexGridBase) | Fires after the user finishes dragging a column.
AfterDragRow (inherited from C1FlexGridBase) | Fires after the user finishes dragging a row.
AfterEdit (inherited from C1FlexGridBase) | Fires after a cell has been edited.
AfterFreezeColumn (inherited from C1FlexGridBase) | Fires after columns are frozen by dragging the frozen column divider.
AfterFreezeRow (inherited from C1FlexGridBase) | Fires after rows are frozen by dragging the frozen row divider.
AfterResizeColumn (inherited from C1FlexGridBase) | Fires after a column is resized by dragging the column header.
AfterResizeRow (inherited from C1FlexGridBase) | Fires after a row is resized by dragging the row header.
AfterRowColChange (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
AfterScroll (inherited from C1FlexGridBase) | Fires after the grid scrolls.
AfterSelChange (inherited from C1FlexGridBase) | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
AfterSort (inherited from C1FlexGridBase) | Fires after a column is sorted by a click on a column header.
BackColorChanged (inherited from Control) | Event fired when the value of BackColor property is changed on Control
BackgroundImageChanged (inherited from Control) | Event fired when the value of BackgroundImage property is changed on Control
BeforeAddRow (inherited from C1FlexGridBase) | Fires before a new row is added by the user.
BeforeAutosizeColumn (inherited from C1FlexGridBase) | Fires before a column is automatically resized by a double-click on a column header.
BeforeAutosizeRow (inherited from C1FlexGridBase) | Fires before a row is automatically resized by a double-click on a row header.
BeforeCollapse (inherited from C1FlexGridBase) | Fires before a node row is collapsed or expanded.
BeforeDeleteRow (inherited from C1FlexGridBase) | Fires before a row is deleted by the user.
BeforeDoubleClick (inherited from C1FlexGridBase) | Fires before the DoubleClick event is handled by the grid.
BeforeDragColumn (inherited from C1FlexGridBase) | Fires before the user starts dragging a column.
BeforeDragRow (inherited from C1FlexGridBase) | Fires before the user starts dragging a row.
BeforeEdit (inherited from C1FlexGridBase) | Fires before the grid enters edit mode, and also when the cell that has the focus needs to be painted.
BeforeFreezeColumn (inherited from C1FlexGridBase) | Fires before columns are frozen by dragging the frozen column divider.
BeforeFreezeRow (inherited from C1FlexGridBase) | Fires before rows are frozen by dragging the frozen row divider.
BeforeMouseDown (inherited from C1FlexGridBase) | Fires before the System.Windows.Forms.Control.MouseDown event is handled by the grid.
BeforePageBreak (inherited from C1FlexGridBase) | Fires while the control is being printed to provide control over page breaks.
BeforeResizeColumn (inherited from C1FlexGridBase) | Fires before a column is resized by dragging the column header.
BeforeResizeRow (inherited from C1FlexGridBase) | Fires before a row is resized by dragging the row header.
BeforeRowColChange (inherited from C1FlexGridBase) | Fires before the current cell changes ( Row and Col properties).
BeforeScroll (inherited from C1FlexGridBase) | Fires before the grid scrolls.
BeforeScrollTip (inherited from C1FlexGridBase) | Fires before the vertical scrolltip is displayed.
BeforeSelChange (inherited from C1FlexGridBase) | Fires before the selection changes ( Row, Col, RowSel, ColSel properties).
BeforeSort (inherited from C1FlexGridBase) | Fires before a column is sorted by a click on a column header.
BeginPrint (inherited from C1FlexGridBase) | Fires before the grid starts printing.
BindingContextChanged (inherited from Control) | Event fired when the value of BindingContext property is changed on Control
CancelAddRow (inherited from C1FlexGridBase) | Fires when the cursor leaves the new row without making any changes to it.
CausesValidationChanged (inherited from Control) | Event fired when the value of CausesValidation property is changed on Control
CellButtonClick (inherited from C1FlexGridBase) | Fires after the user clicks a cell button.
CellChanged (inherited from C1FlexGridBase) | Fires after the contents of a cell have changed.
ChangeEdit (inherited from C1FlexGridBase) | Fires in edit mode, after the contents of the editor change.
ChangeUICues (inherited from Control) | Occurs when focus rectangles and keyboard cue underlines are being shown or hidden.
Click (inherited from Control) | Occurs when the control is clicked.
ComboCloseUp (inherited from C1FlexGridBase) | Fires in edit mode, when the dropdown portion of an editor closes.
ComboDropDown (inherited from C1FlexGridBase) | Fires in edit mode, when the dropdown portion of an editor opens.
ContextMenuChanged (inherited from Control) | Event fired when the value of ContextMenu property is changed on Control
ControlAdded (inherited from Control) | Occurs when a control is added to this control.
ControlRemoved (inherited from Control) | Occurs when a control is removed from this control.
CursorChanged (inherited from Control) | Event fired when the value of Cursor property is changed on Control
DockChanged (inherited from Control) | Event fired when the value of Dock property is changed on Control
DoubleClick (inherited from Control) | Occurs when the control is double-clicked.
DragDrop (inherited from Control) | Occurs when the mouse drags an item and the user releases the mouse indicating that the item should be 'dropped' into this Control.
DragEnter (inherited from Control) | Occurs when the mouse drags an item into the client area for this Control.
DragLeave (inherited from Control) | Occurs when the mouse drags an item and is no longer over the client area for this Control.
DragOver (inherited from Control) | Occurs when the mouse drags an item and is moving over the client area of this Control.
EnabledChanged (inherited from Control) | Occurs when the control's enabled state changes.
EndPrint (inherited from C1FlexGridBase) | Fires after the grid finishes printing.
Enter (inherited from Control) | Occurs when the control becomes the active control of the form.
EnterCell (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
FontChanged (inherited from Control) | Event fired when the value of Font property is changed on Control
ForeColorChanged (inherited from Control) | Event fired when the value of ForeColor property is changed on Control
GetCellErrorInfo (inherited from C1FlexGridBase) | Fires when ShowErrors is set to True and the control needs error information for a cell.
GetRowErrorInfo (inherited from C1FlexGridBase) | Fires when ShowErrors is set to True and the control needs error information for a row.
GetUnboundValue (inherited from C1FlexGridBase) | Fires when the grid needs to retrieve data for an unbound cell.
GiveFeedback (inherited from Control) | Occurs when the mouse drags an item. The system requests that the Control provide feedback to that effect.
GotFocus (inherited from Control) | Occurs when the control gets focus.
GridChanged (inherited from C1FlexGridBase) | Fires when the grid or its contents change.
GridError (inherited from C1FlexGridBase) | Fires after the data source reports an error condition.
HandleCreated (inherited from Control) | Occurs when the control's native handle is created.
HandleDestroyed (inherited from Control) | Occurs when the control's native handle is destroyed.
HelpRequested (inherited from Control) | Occurs when the user invokes help for the control.
ImeModeChanged (inherited from Control) | Occurs when the control's IME mode changes
Invalidated (inherited from Control) | Occurs when one of the invalidate methods is called.
KeyDown (inherited from Control) | Occurs when a key is first pressed.
KeyDownEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user presses a key.
KeyPress (inherited from Control) | Occurs after the user is finished pressing a key.
KeyPressEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user presses a character key.
KeyUp (inherited from Control) | Occurs when a key is released.
KeyUpEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user releases a key.
Layout (inherited from Control) | Occurs when the control is about to lay out its contents.
Leave (inherited from Control) | Occurs when the control is no longer the active control of the form.
LeaveCell (inherited from C1FlexGridBase) | Fires before the current cell changes ( Row and Col properties).
LeaveEdit (inherited from C1FlexGridBase) | Fires after the control leaves edit mode.
LocationChanged (inherited from Control) | Event fired when the value of Location property is changed on Control
LostFocus (inherited from Control) | Occurs when the control gets focus.
MouseDown (inherited from Control) | Occurs when a mouse button is pressed.
MouseEnter (inherited from Control) | Occurs when the mouse enters the visible part of the control.
MouseHover (inherited from Control) | Occurs when the mouse remains stationary inside of the control for an amount of time.
MouseHoverCell (inherited from C1FlexGridBase) | Fires when the mouse enters or leaves a cell.
MouseLeave (inherited from Control) | Occurs when the mouse leaves the visible part of the control.
MouseMove (inherited from Control) | Occurs when the mouse is moved.
MouseUp (inherited from Control) | Occurs when a mouse button is released.
MouseWheel (inherited from Control) | Occurs when the mouse wheel is rolled.
Move (inherited from Control) | Occurs when a control is moved.
OwnerDrawCell (inherited from C1FlexGridBase) | Fires before the grid draws a cell, when the DrawMode property is set to .
Paint (inherited from Control) | Occurs when a control needs repainting.
ParentChanged (inherited from Control) | Event fired when the value of Parent property is changed on Control
PrintPage (inherited from C1FlexGridBase) | Fires after the grid finishes printing a page.
QueryAccessibilityHelp (inherited from Control) | Occurs when an Accessibility client invokes help for the control.
QueryContinueDrag (inherited from Control) | Occurs when the mouse drags an item. The system requests whether the drag and drop operation should be allowed to continue.
Resize (inherited from Control) | Occurs when a control is resized.
RightToLeftChanged (inherited from Control) | Event fired when the value of RightToLeft property is changed on Control
RowColChange (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
SelChange (inherited from C1FlexGridBase) | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
SetUnboundValue (inherited from C1FlexGridBase) | Fires when the grid needs to store data in an unbound cell.
SetupEditor (inherited from C1FlexGridBase) | Fires after a cell editor has been initialized by the grid, to allow additional custom initialization.
SizeChanged (inherited from Control) | Event fired when the value of Size property is changed on Control
StartDrag (inherited from C1FlexGridBase) | Fires before the grid starts an automatic OLE drag operation.
StartEdit (inherited from C1FlexGridBase) | Fires before the control enters edit mode.
StyleChanged (inherited from Control) | Event fired when the window style of a Control is changed
SystemColorsChanged (inherited from Control) | Event fired when the system colors change
TabIndexChanged (inherited from Control) | Event fired when the value of TabIndex property is changed on Control
TabStopChanged (inherited from Control) | Event fired when the value of TabStop property is changed on Control
TextChanged (inherited from Control) | Event fired when the value of Text property is changed on Control
Validated (inherited from Control) | Occurs after a control has been successfully validated.
ValidateEdit (inherited from C1FlexGridBase) | Fires before the control exits cell edit mode, while the editor is still active.
Validating (inherited from Control) | Occurs when a control is being validated. Set to True the Cancel property on the event parameter to cancel the validation.
VisibleChanged (inherited from Control) | Occurs when the control's visibility changes.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase Class

C1FlexGridBase Class

Base class for the C1FlexGrid control.

For a list of all members of this type, see C1FlexGridBase Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

System.Windows.Forms.Control

C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl

C1.Win.C1FlexGrid.C1FlexGridBase

C1.Win.C1FlexGrid.C1FlexGrid

[Visual Basic]

MustInherit Public Class C1FlexGridBase

Inherits ScrollableControl

Implements IC1ControlPrintable, ISupportInitialize

[C#]

public abstract class C1FlexGridBase : ScrollableControl , IC1ControlPrintable, ISupportInitialize

[Delphi]

type C1FlexGridBase = class abstract (ScrollableControl, IC1ControlPrintable, ISupportInitialize);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase Members

C1FlexGridBase Members

C1FlexGridBase overview

Public Properties

AccessibilityObject (inherited from Control) | The accessibility object for this control.
AccessibleDefaultActionDescription (inherited from Control) | The default action description of the control.
AccessibleDescription (inherited from Control) | The description that will be reported to accessibility clients.
AccessibleName (inherited from Control) | The name that will be reported to accessibility clients.
AccessibleRole (inherited from Control) | The role that will be reported to accessibility clients.
AllowAddNew | Gets or sets whether the grid should display a new row template after the last data row.
AllowDelete | Gets or sets whether the grid should monitor the keyboard and handle the DEL key.
AllowDragging | Gets or sets whether the user is allowed to drag rows and columns with the mouse.
AllowEditing | Gets or sets whether the user is allowed to edit grid contents.
AllowFreezing | Gets or sets whether the user is allowed to freeze rows and columns with the mouse.
AllowResizing | Gets or sets whether the user is allowed to resize rows and columns with the mouse.
AllowSorting | Gets or sets whether the user is allowed to sort columns using the mouse.
Anchor (inherited from Control) | The anchor of the control. Anchors define to which edges of the container a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant.
AutoClipboard | Gets or sets whether the grid should handle the clipboard keys and automatically perform cut, copy, paste, and delete operations.
AutoGenerateColumns | Gets or sets whether columns are automatically created when the grid is bound to a data source.
AutoResize | Gets or sets whether column widths are automatically adjusted when data is loaded.
AutoSearch | Gets or sets whether the grid should move the cursor searching for entries as the user types.
AutoSearchDelay | Gets or sets the delay (in seconds) before the AutoSearch buffer is reset.
BackColor | Overriden. Gets or sets the background color for the control.
BackgroundImage (inherited from Control) | The background image used for the control.
BindingContext (inherited from Control) | The binding manager for this container.
BorderStyle (inherited from ScrollableControl) | Gets or sets the type of border around the control.
Bottom (inherited from Control) | The bottom of the control, in container coordinates.
BottomRow | Gets the last visible row in the scrollable area.
Bounds (inherited from Control) | The bounds of the control, in container coordinates.
CanFocus (inherited from Control) | Checks if this control can receive the focus.
CanSelect (inherited from Control) | Checks if this control can be selected.
Capture (inherited from Control) | Determines if this control is currently capturing all mouse input.
CausesValidation (inherited from Control) | Indicates whether this control causes and raises validation events.
CellButtonImage | Gets or sets the image to be used in cell buttons.
ClientRectangle (inherited from Control) | Retrieves the rectangle of the inner area of this control.
ClientSize (inherited from Control) | Determines the size of the inner area of this control.
Clip | Gets or sets the contents of the selected range.
ClipSeparators | Gets or sets the characters used as row and column separators in clip strings.
Col | Gets or sets the column that contains the cursor.
Cols | Gets the collection of Column objects in the grid.
ColSel | Gets or sets the last column in the current selection.
ComboList | Gets or sets the list of items to be used by the drop-down editor.
CompanyName (inherited from Control) | ControlCompanyNameDescr
ContainsFocus (inherited from Control) | Determines if this control or one if its children currently has the focus.
ContextMenu (inherited from Control) | The shortcut menu to display when the user right-clicks the control.
Controls (inherited from Control) | The collection of child controls within this control.
Created (inherited from Control) | Determines if the control has been fully created.
Cursor (inherited from ScrollableControl) | Gets or sets the cursor that appears when the mouse moves over the control.
CursorCell | Gets a CellRange object that contains the cell at coordinates Row, Col.
CustomComparer | Gets or sets a custom comparer object used by the grid to perform grouping, merging, and searching operations.
DataBindings (inherited from Control) | This collection holds all the bindings of properties of this control to data sources.
DataMember | Gets or sets the specific list in a DataSource object that the grid should display.
DataSource | Gets or sets the data source for the grid.
DisplayRectangle (inherited from Control) | Retrieves the display rectangle of this control.
Disposing (inherited from Control) | Determines if this control is in the process of being disposed.
Dock (inherited from Control) | The docking location of the control, indicating which borders are docked to the container.
DoubleBuffer | Gets or sets whether the control should use an off-screen buffer when painting to reduce flicker.
DragMode | Gets or sets a value that determines if the user can drag data from the control.
DrawMode | Gets or sets whether the control should fire the OwnerDrawCell event.
DropMode | Gets or sets a value that determines if the control can accept data that the user drags onto it.
EditMask | Gets or sets the input mask to use when editing cells.
EditOptions | Gets or sets flags that customize the grid's editing behavior.
Editor | Gets or sets a reference to the cell editor that is currently active.
Enabled (inherited from Control) | Indicates whether the control is enabled.
ExtendLastCol | Gets or sets whether the last column should be extended to fill the control.
Focused (inherited from Control) | Determines if this control has focus.
FocusRect | Gets or sets the type of focus rectangle to display.
Font (inherited from Control) | The font used to display text in the control.
ForeColor | Overriden. Gets or sets the foreground color for the control.
Glyphs | Gets the collection of control glyphs (images used to show sorting, checkboxes, etc).
Handle (inherited from Control) | The native handle for this control.
HasChildren (inherited from Control) | True if this control has child controls in its collection.
Height (inherited from Control) | The height of the control, in container coordinates.
HighLight | Gets or sets when to highlight selected cells.
ImeMode (inherited from Control) | Determines the IME (Input Method Editor) status of the object when selected.
InvokeRequired (inherited from Control) | Determines if Invoke or InvokeAsync should be used to access this control cross-thread.
IsAccessible (inherited from Control) | Determines if this control supports Accessibility.
IsDisposed (inherited from Control) | Determines if this control has been disposed.
IsHandleCreated (inherited from Control) | Determines if the native handle has been created for this control.
KeyActionEnter | Gets or sets the action to be performed when the user presses the ENTER key.
KeyActionTab | Gets or sets the action to be performed when the user presses the TAB key.
Left (inherited from Control) | The upper left of the control, in container coordinates.
LeftCol | Gets or sets the first visible column in the scrollable area.
Location (inherited from Control) | The position of the top-left corner of the control with respect to its container.
MouseCol | Gets the index of the column under the cursor.
MouseRow | Gets the index of the row under the cursor.
Parent (inherited from Control) | The parent of this control.
PrintParameters | Gets a GridPrinter object that specifies printing parameters for the grid.
ProductName (inherited from Control) | Retrieves the name of the product associated with this component.
ProductVersion (inherited from Control) | Retrieves the version of the product associated with this component.
RecreatingHandle (inherited from Control) | Determines if this control is in the process of recreating its handle.
Redraw | Gets or sets whether the grid should paint its contents.
Region (inherited from Control) | The region, or shape, of this control.
Right (inherited from Control) | The upper right of the control, in container coordinates.
RightCol | Gets the last visible column in the scrollable area.
RightToLeft (inherited from Control) | Indicates whether the control should draw right-to-left for RTL languages.
Row | Gets or sets the row that contains the cursor.
Rows | Gets the collection of Row objects in the grid.
RowSel | Gets or sets the last row in the current selection.
ScrollableRectangle | Overriden. Gets a rectangle that defines the scrollable portion of the control.
ScrollBars (inherited from ScrollableControl) | Gets or sets which scroll bars should appear on the control.
ScrollPosition (inherited from ScrollableControl) | Gets or sets the location of the auto-scroll position.
ScrollTips (inherited from ScrollableControl) | Gets or sets whether the control should display tooltips as the user scrolls vertically.
ScrollTipText (inherited from ScrollableControl) | Gets or sets the tooltip text displayed as the user scrolls vertically.
ScrollTrack (inherited from ScrollableControl) | Gets or sets whether the control should scroll as the user drags the scrollbar thumb.
Selection | Gets the selected range in normalized form.
SelectionMode | Gets or sets the grid's selection behavior.
ShowButtons | Gets or sets when to display combo buttons in cells.
ShowCellLabels | Gets or sets whether the grid should display labels over cells whose contents are partially hidden.
ShowCursor | Gets or sets whether the grid should display a DB-style cursor on the first fixed column.
ShowErrors | Gets or sets whether the grid should display error information in cells and rows.
ShowSort | Gets or sets whether the grid should display sorting glyphs (a triangle) on the headers of sorted columns.
Size (inherited from Control) | The size of the control in pixels.
Styles | Gets the collection of cell styles defined in the grid.
SubtotalPosition | Gets or sets whether node rows appear above or below the data.
TabIndex (inherited from Control) | Determines the index in the TAB order that this control will occupy.
TabStop (inherited from Control) | Indicates whether the user can use the TAB key to give focus to the control.
Tag (inherited from Control) | User defined data associated with the control.
Top (inherited from Control) | The top of the control, in container coordinates.
TopLevelControl (inherited from Control) | Retrieves the top level control that contains this control.
TopRow | Gets or sets the first visible row in the scrollable area.
Tree | Gets a reference to the GridTree object that controls the appearance of the outline tree in the grid.
Visible (inherited from Control) | Determines whether the control is visible or hidden.
Width (inherited from Control) | The width of the control, in container coordinates.
Item |

Public Methods

AddItem | Overloaded. Adds a row to the grid and populates the new row with data.
Aggregate | Overloaded. Calculates aggregate statistics for the current selection.
AutoSizeCol | Overloaded. Adjusts the width of a column to fit the data.
AutoSizeCols | Overloaded. Adjusts the width of all columns to fit the data.
AutoSizeRow | Adjusts the height of a row to fit the data.
AutoSizeRows | Overloaded. Adjusts the height of all rows to fit the data.
BeginInit | Signals the object that initialization is starting.
Clear | Overloaded. Clears the grid.
CreateImage | Overloaded. Creates an image of the entire grid.
EndInit | Signals the object that initialization is complete.
FindRow | Overloaded. Finds a row that contains a specified Row value.
FinishEditing | Overloaded. Finishes editing the current cell and takes the grid out of edit mode.
GetCellCheck | Gets the state of the checkbox in a grid cell.
GetCellImage | Gets the image displayed in a grid cell.
GetCellRange | Overloaded. Gets a CellRange object that can be used to format and manipulate a cell.
GetCellRect | Overloaded. Gets a System.Drawing.Rectangle object with the coordinates of the cell within the control.
GetCellStyle | Gets a custom CellStyle associated with a cell.
GetCellStyleDisplay | Gets the style used to render a cell.
GetData | Overloaded. Gets the value of a grid cell.
GetDataDisplay | Overloaded. Gets the value in a grid cell, formatted as a string.
GetUserData | Overloaded. Gets user data associated with a cell.
HitTest | Overloaded. Returns information about the control at the current mouse position.
Invalidate | Overloaded. Overriden. Invalidates a cell range, causing it to be repainted.
IsCellCursor | Gets a value that determines if a cell contains the grid cursor.
IsCellFixed | Gets a value that determines if a cell belongs to a fixed row or column.
IsCellHighlighted | Gets a value that determines if a cell is part of the selection and should be highlighted.
IsCellValid | Gets a value that determines if a pair of cell coordinates are valid.
LoadExcel | Overloaded. Loads the grid from the first worksheet in a Microsoft Excel (.xls) file.
LoadExcelSheetNames | Gets a list with the names of the worksheets in a Microsoft Excel (.xls) file.
LoadGrid | Overloaded. Loads the grid from a file.
PrintGrid | Overloaded. Prints the grid, optionally showing a page setup or print preview dialog.
ReadXml | Overloaded. Loads the grid from an Xml document.
RemoveItem | Overloaded. Removes the last row from the grid.
SaveExcel | Overloaded. Saves the grid contents to a Microsoft Excel (.xls) file.
SaveGrid | Overloaded. Saves the grid contents to a file.
Select | Overloaded. Selects a range of cells and scrolls it into view.
SetCellCheck | Sets the state of the checkbox in a grid cell.
SetCellImage | Sets the image displayed in a grid cell.
SetCellStyle | Overloaded. Assigns a custom CellStyle to a cell.
SetData | Overloaded. Assigns a value to a range of cells, coercing the value into each cell's specified DataType.
SetDataBinding | Overloaded. Sets the DataSource and DataMember properties.
SetUserData | Overloaded. Assigns user data to a cell.
ShowCell | Scrolls a cell into view.
ShowSortAt | Shows the sorting glyph on a column header.
Sort | Overloaded. Sorts a range of cells in the grid.
StartEditing | Overloaded. Puts the grid in edit mode and starts editing the current cell.
Subtotal | Overloaded. Groups rows based on cell contents and calculates aggregate values.
WriteXml | Overloaded. Saves the grid contents to an Xml document.

Public Events

AfterAddRow | Fires after a new row is added by the user.
AfterCollapse | Fires after a node row is collapsed or expanded.
AfterDataRefresh | Fires after any data source change notifications.
AfterDeleteRow | Fires after one or more rows are deleted by the user.
AfterDragColumn | Fires after the user finishes dragging a column.
AfterDragRow | Fires after the user finishes dragging a row.
AfterEdit | Fires after a cell has been edited.
AfterFreezeColumn | Fires after columns are frozen by dragging the frozen column divider.
AfterFreezeRow | Fires after rows are frozen by dragging the frozen row divider.
AfterResizeColumn | Fires after a column is resized by dragging the column header.
AfterResizeRow | Fires after a row is resized by dragging the row header.
AfterRowColChange | Fires after the current cell changes ( Row and Col properties).
AfterScroll | Fires after the grid scrolls.
AfterSelChange | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
AfterSort | Fires after a column is sorted by a click on a column header.
BackColorChanged (inherited from Control) | Event fired when the value of BackColor property is changed on Control
BackgroundImageChanged (inherited from Control) | Event fired when the value of BackgroundImage property is changed on Control
BeforeAddRow | Fires before a new row is added by the user.
BeforeAutosizeColumn | Fires before a column is automatically resized by a double-click on a column header.
BeforeAutosizeRow | Fires before a row is automatically resized by a double-click on a row header.
BeforeCollapse | Fires before a node row is collapsed or expanded.
BeforeDeleteRow | Fires before a row is deleted by the user.
BeforeDoubleClick | Fires before the DoubleClick event is handled by the grid.
BeforeDragColumn | Fires before the user starts dragging a column.
BeforeDragRow | Fires before the user starts dragging a row.
BeforeEdit | Fires before the grid enters edit mode, and also when the cell that has the focus needs to be painted.
BeforeFreezeColumn | Fires before columns are frozen by dragging the frozen column divider.
BeforeFreezeRow | Fires before rows are frozen by dragging the frozen row divider.
BeforeMouseDown | Fires before the System.Windows.Forms.Control.MouseDown event is handled by the grid.
BeforePageBreak | Fires while the control is being printed to provide control over page breaks.
BeforeResizeColumn | Fires before a column is resized by dragging the column header.
BeforeResizeRow | Fires before a row is resized by dragging the row header.
BeforeRowColChange | Fires before the current cell changes ( Row and Col properties).
BeforeScroll | Fires before the grid scrolls.
BeforeScrollTip | Fires before the vertical scrolltip is displayed.
BeforeSelChange | Fires before the selection changes ( Row, Col, RowSel, ColSel properties).
BeforeSort | Fires before a column is sorted by a click on a column header.
BeginPrint | Fires before the grid starts printing.
BindingContextChanged (inherited from Control) | Event fired when the value of BindingContext property is changed on Control
CancelAddRow | Fires when the cursor leaves the new row without making any changes to it.
CausesValidationChanged (inherited from Control) | Event fired when the value of CausesValidation property is changed on Control
CellButtonClick | Fires after the user clicks a cell button.
CellChanged | Fires after the contents of a cell have changed.
ChangeEdit | Fires in edit mode, after the contents of the editor change.
ChangeUICues (inherited from Control) | Occurs when focus rectangles and keyboard cue underlines are being shown or hidden.
Click (inherited from Control) | Occurs when the control is clicked.
ComboCloseUp | Fires in edit mode, when the dropdown portion of an editor closes.
ComboDropDown | Fires in edit mode, when the dropdown portion of an editor opens.
ContextMenuChanged (inherited from Control) | Event fired when the value of ContextMenu property is changed on Control
ControlAdded (inherited from Control) | Occurs when a control is added to this control.
ControlRemoved (inherited from Control) | Occurs when a control is removed from this control.
CursorChanged (inherited from Control) | Event fired when the value of Cursor property is changed on Control
DockChanged (inherited from Control) | Event fired when the value of Dock property is changed on Control
DoubleClick (inherited from Control) | Occurs when the control is double-clicked.
DragDrop (inherited from Control) | Occurs when the mouse drags an item and the user releases the mouse indicating that the item should be 'dropped' into this Control.
DragEnter (inherited from Control) | Occurs when the mouse drags an item into the client area for this Control.
DragLeave (inherited from Control) | Occurs when the mouse drags an item and is no longer over the client area for this Control.
DragOver (inherited from Control) | Occurs when the mouse drags an item and is moving over the client area of this Control.
EnabledChanged (inherited from Control) | Occurs when the control's enabled state changes.
EndPrint | Fires after the grid finishes printing.
Enter (inherited from Control) | Occurs when the control becomes the active control of the form.
EnterCell | Fires after the current cell changes ( Row and Col properties).
FontChanged (inherited from Control) | Event fired when the value of Font property is changed on Control
ForeColorChanged (inherited from Control) | Event fired when the value of ForeColor property is changed on Control
GetCellErrorInfo | Fires when ShowErrors is set to True and the control needs error information for a cell.
GetRowErrorInfo | Fires when ShowErrors is set to True and the control needs error information for a row.
GetUnboundValue | Fires when the grid needs to retrieve data for an unbound cell.
GiveFeedback (inherited from Control) | Occurs when the mouse drags an item. The system requests that the Control provide feedback to that effect.
GotFocus (inherited from Control) | Occurs when the control gets focus.
GridChanged | Fires when the grid or its contents change.
GridError | Fires after the data source reports an error condition.
HandleCreated (inherited from Control) | Occurs when the control's native handle is created.
HandleDestroyed (inherited from Control) | Occurs when the control's native handle is destroyed.
HelpRequested (inherited from Control) | Occurs when the user invokes help for the control.
ImeModeChanged (inherited from Control) | Occurs when the control's IME mode changes
Invalidated (inherited from Control) | Occurs when one of the invalidate methods is called.
KeyDown (inherited from Control) | Occurs when a key is first pressed.
KeyDownEdit | Fires in edit mode, when the user presses a key.
KeyPress (inherited from Control) | Occurs after the user is finished pressing a key.
KeyPressEdit | Fires in edit mode, when the user presses a character key.
KeyUp (inherited from Control) | Occurs when a key is released.
KeyUpEdit | Fires in edit mode, when the user releases a key.
Layout (inherited from Control) | Occurs when the control is about to lay out its contents.
Leave (inherited from Control) | Occurs when the control is no longer the active control of the form.
LeaveCell | Fires before the current cell changes ( Row and Col properties).
LeaveEdit | Fires after the control leaves edit mode.
LocationChanged (inherited from Control) | Event fired when the value of Location property is changed on Control
LostFocus (inherited from Control) | Occurs when the control gets focus.
MouseDown (inherited from Control) | Occurs when a mouse button is pressed.
MouseEnter (inherited from Control) | Occurs when the mouse enters the visible part of the control.
MouseHover (inherited from Control) | Occurs when the mouse remains stationary inside of the control for an amount of time.
MouseHoverCell | Fires when the mouse enters or leaves a cell.
MouseLeave (inherited from Control) | Occurs when the mouse leaves the visible part of the control.
MouseMove (inherited from Control) | Occurs when the mouse is moved.
MouseUp (inherited from Control) | Occurs when a mouse button is released.
MouseWheel (inherited from Control) | Occurs when the mouse wheel is rolled.
Move (inherited from Control) | Occurs when a control is moved.
OwnerDrawCell | Fires before the grid draws a cell, when the DrawMode property is set to DrawModeEnum.OwnerDraw.
Paint (inherited from Control) | Occurs when a control needs repainting.
ParentChanged (inherited from Control) | Event fired when the value of Parent property is changed on Control
PrintPage | Fires after the grid finishes printing a page.
QueryAccessibilityHelp (inherited from Control) | Occurs when an Accessibility client invokes help for the control.
QueryContinueDrag (inherited from Control) | Occurs when the mouse drags an item. The system requests whether the drag and drop operation should be allowed to continue.
Resize (inherited from Control) | Occurs when a control is resized.
RightToLeftChanged (inherited from Control) | Event fired when the value of RightToLeft property is changed on Control
RowColChange | Fires after the current cell changes ( Row and Col properties).
SelChange | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
SetUnboundValue | Fires when the grid needs to store data in an unbound cell.
SetupEditor | Fires after a cell editor has been initialized by the grid, to allow additional custom initialization.
SizeChanged (inherited from Control) | Event fired when the value of Size property is changed on Control
StartDrag | Fires before the grid starts an automatic OLE drag operation.
StartEdit | Fires before the control enters edit mode.
StyleChanged (inherited from Control) | Event fired when the window style of a Control is changed
SystemColorsChanged (inherited from Control) | Event fired when the system colors change
TabIndexChanged (inherited from Control) | Event fired when the value of TabIndex property is changed on Control
TabStopChanged (inherited from Control) | Event fired when the value of TabStop property is changed on Control
TextChanged (inherited from Control) | Event fired when the value of Text property is changed on Control
Validated (inherited from Control) | Occurs after a control has been successfully validated.
ValidateEdit | Fires before the control exits cell edit mode, while the editor is still active.
Validating (inherited from Control) | Occurs when a control is being validated. Set to True the Cancel property on the event parameter to cancel the validation.
VisibleChanged (inherited from Control) | Occurs when the control's visibility changes.

Protected Constructors

C1FlexGridBase Constructor

Initializes a new instance of the C1FlexGridBase class.

Protected Properties

ResizeRedraw (inherited from Control)

Indicates whether the control should redraw itself when resized.

Protected Methods

BuildScrollableRectangle | Overriden. Builds a rectangle that defines the scrollable portion of the control for a given pair of scroll offsets.
CreateAccessibilityInstance | Overriden. Creates a new accessibility object for the control.
Dispose | Overloaded. Overriden. Releases all resources used by the Control.
DrawCell | Draws a grid cell.
DrawRow | Draws a grid row.
GetHeaderThemeState | Gets the state for a Windows Xp theme while the mouse moves over a cell.
IsInputChar | Overriden. Determines if a character is an input character that the control recognizes.
IsInputKey | Overriden. Determines whether the specified key is a regular input key or a special key that requires preprocessing.
OnBackColorChanged | Overriden. Raises the System.Windows.Forms.Control.BackColorChanged event.
OnBindingContextChanged | Overriden. Raises the System.Windows.Forms.Control.BindingContextChanged event.
OnDoubleClick | Overriden. Raises the System.Windows.Forms.Control.DoubleClick event.
OnDragDrop | Overriden. Raises the System.Windows.Forms.Control.DragDrop event.
OnDragEnter | Overriden. Raises the System.Windows.Forms.Control.DragEnter event.
OnDragOver | Overriden. Raises the System.Windows.Forms.Control.DragOver event.
OnFontChanged | Overriden. Raises the System.Windows.Forms.Control.FontChanged event.
OnForeColorChanged | Overriden. Raises the System.Windows.Forms.Control.ForeColorChanged event.
OnGotFocus | Overriden. Raises the System.Windows.Forms.Control.GotFocus event.
OnHandleDestroyed | Overriden. Raises the System.Windows.Forms.Control.HandleDestroyed event.
OnImeStartComposition (inherited from ScrollableControl) | Called when the control receives a WM_IME_STARTCOMPOSITION message.
OnKeyDown | Overriden. Raises the System.Windows.Forms.Control.KeyDown event.
OnKeyPress | Overriden. Raises the System.Windows.Forms.Control.KeyPress event.
OnLeave | Overriden. Raises the System.Windows.Forms.Control.Leave event.
OnLostFocus | Overriden. Raises the System.Windows.Forms.Control.LostFocus event.
OnMouseDown | Overriden. Raises the System.Windows.Forms.Control.MouseDown event.
OnMouseLeave | Overriden. Raises the System.Windows.Forms.Control.MouseLeave event.
OnMouseMove | Overriden. Raises the System.Windows.Forms.Control.MouseMove event.
OnMouseUp | Overriden. Raises the System.Windows.Forms.Control.MouseUp event.
OnPaint | Overriden. Raises the System.Windows.Forms.Control.Paint event.
OnPaintBackground | Overriden. Raises the System.Windows.Forms.Control.PaintBackground(System.Windows.Forms.PaintEventArgs,System.Drawing.Rectangle) event.
OnScroll | Overriden. Called when the grid contents scroll.
OnScrollTip | Overriden. Raises the BeforeScrollTip event.
OnSizeChanged | Overriden. Raises the System.Windows.Forms.Control.SizeChanged event.
OnThemeChanged | Overriden. Called when the control receives a WM_THEMECHANGED message.
OnValidating | Overriden. Raises the System.Windows.Forms.Control.Validating event.
OnVisibleChanged | Overriden. Raises the System.Windows.Forms.Control.VisibleChanged event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase Constructor

C1FlexGridBase Constructor

Initializes a new instance of the C1FlexGridBase class.

[Visual Basic]

Protected Function New()

[C#]

protected C1FlexGridBase()

[Delphi]

strict protected constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase Properties

C1FlexGridBase Properties

The properties of the C1FlexGridBase class are listed here. For a complete list of C1FlexGridBase class members, see the C1FlexGridBase Members topic.

Public Properties

AccessibilityObject (inherited from Control) | The accessibility object for this control.
AccessibleDefaultActionDescription (inherited from Control) | The default action description of the control.
AccessibleDescription (inherited from Control) | The description that will be reported to accessibility clients.
AccessibleName (inherited from Control) | The name that will be reported to accessibility clients.
AccessibleRole (inherited from Control) | The role that will be reported to accessibility clients.
AllowAddNew | Gets or sets whether the grid should display a new row template after the last data row.
AllowDelete | Gets or sets whether the grid should monitor the keyboard and handle the DEL key.
AllowDragging | Gets or sets whether the user is allowed to drag rows and columns with the mouse.
AllowEditing | Gets or sets whether the user is allowed to edit grid contents.
AllowFreezing | Gets or sets whether the user is allowed to freeze rows and columns with the mouse.
AllowResizing | Gets or sets whether the user is allowed to resize rows and columns with the mouse.
AllowSorting | Gets or sets whether the user is allowed to sort columns using the mouse.
Anchor (inherited from Control) | The anchor of the control. Anchors define to which edges of the container a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant.
AutoClipboard | Gets or sets whether the grid should handle the clipboard keys and automatically perform cut, copy, paste, and delete operations.
AutoGenerateColumns | Gets or sets whether columns are automatically created when the grid is bound to a data source.
AutoResize | Gets or sets whether column widths are automatically adjusted when data is loaded.
AutoSearch | Gets or sets whether the grid should move the cursor searching for entries as the user types.
AutoSearchDelay | Gets or sets the delay (in seconds) before the AutoSearch buffer is reset.
BackColor | Overriden. Gets or sets the background color for the control.
BackgroundImage (inherited from Control) | The background image used for the control.
BindingContext (inherited from Control) | The binding manager for this container.
BorderStyle (inherited from ScrollableControl) | Gets or sets the type of border around the control.
Bottom (inherited from Control) | The bottom of the control, in container coordinates.
BottomRow | Gets the last visible row in the scrollable area.
Bounds (inherited from Control) | The bounds of the control, in container coordinates.
CanFocus (inherited from Control) | Checks if this control can receive the focus.
CanSelect (inherited from Control) | Checks if this control can be selected.
Capture (inherited from Control) | Determines if this control is currently capturing all mouse input.
CausesValidation (inherited from Control) | Indicates whether this control causes and raises validation events.
CellButtonImage | Gets or sets the image to be used in cell buttons.
ClientRectangle (inherited from Control) | Retrieves the rectangle of the inner area of this control.
ClientSize (inherited from Control) | Determines the size of the inner area of this control.
Clip | Gets or sets the contents of the selected range.
ClipSeparators | Gets or sets the characters used as row and column separators in clip strings.
Col | Gets or sets the column that contains the cursor.
Cols | Gets the collection of Column objects in the grid.
ColSel | Gets or sets the last column in the current selection.
ComboList | Gets or sets the list of items to be used by the drop-down editor.
CompanyName (inherited from Control) | ControlCompanyNameDescr
ContainsFocus (inherited from Control) | Determines if this control or one if its children currently has the focus.
ContextMenu (inherited from Control) | The shortcut menu to display when the user right-clicks the control.
Controls (inherited from Control) | The collection of child controls within this control.
Created (inherited from Control) | Determines if the control has been fully created.
Cursor (inherited from ScrollableControl) | Gets or sets the cursor that appears when the mouse moves over the control.
CursorCell | Gets a CellRange object that contains the cell at coordinates Row, Col.
CustomComparer | Gets or sets a custom comparer object used by the grid to perform grouping, merging, and searching operations.
DataBindings (inherited from Control) | This collection holds all the bindings of properties of this control to data sources.
DataMember | Gets or sets the specific list in a DataSource object that the grid should display.
DataSource | Gets or sets the data source for the grid.
DisplayRectangle (inherited from Control) | Retrieves the display rectangle of this control.
Disposing (inherited from Control) | Determines if this control is in the process of being disposed.
Dock (inherited from Control) | The docking location of the control, indicating which borders are docked to the container.
DoubleBuffer | Gets or sets whether the control should use an off-screen buffer when painting to reduce flicker.
DragMode | Gets or sets a value that determines if the user can drag data from the control.
DrawMode | Gets or sets whether the control should fire the OwnerDrawCell event.
DropMode | Gets or sets a value that determines if the control can accept data that the user drags onto it.
EditMask | Gets or sets the input mask to use when editing cells.
EditOptions | Gets or sets flags that customize the grid's editing behavior.
Editor | Gets or sets a reference to the cell editor that is currently active.
Enabled (inherited from Control) | Indicates whether the control is enabled.
ExtendLastCol | Gets or sets whether the last column should be extended to fill the control.
Focused (inherited from Control) | Determines if this control has focus.
FocusRect | Gets or sets the type of focus rectangle to display.
Font (inherited from Control) | The font used to display text in the control.
ForeColor | Overriden. Gets or sets the foreground color for the control.
Glyphs | Gets the collection of control glyphs (images used to show sorting, checkboxes, etc).
Handle (inherited from Control) | The native handle for this control.
HasChildren (inherited from Control) | True if this control has child controls in its collection.
Height (inherited from Control) | The height of the control, in container coordinates.
HighLight | Gets or sets when to highlight selected cells.
ImeMode (inherited from Control) | Determines the IME (Input Method Editor) status of the object when selected.
InvokeRequired (inherited from Control) | Determines if Invoke or InvokeAsync should be used to access this control cross-thread.
IsAccessible (inherited from Control) | Determines if this control supports Accessibility.
IsDisposed (inherited from Control) | Determines if this control has been disposed.
IsHandleCreated (inherited from Control) | Determines if the native handle has been created for this control.
KeyActionEnter | Gets or sets the action to be performed when the user presses the ENTER key.
KeyActionTab | Gets or sets the action to be performed when the user presses the TAB key.
Left (inherited from Control) | The upper left of the control, in container coordinates.
LeftCol | Gets or sets the first visible column in the scrollable area.
Location (inherited from Control) | The position of the top-left corner of the control with respect to its container.
MouseCol | Gets the index of the column under the cursor.
MouseRow | Gets the index of the row under the cursor.
Parent (inherited from Control) | The parent of this control.
PrintParameters | Gets a GridPrinter object that specifies printing parameters for the grid.
ProductName (inherited from Control) | Retrieves the name of the product associated with this component.
ProductVersion (inherited from Control) | Retrieves the version of the product associated with this component.
RecreatingHandle (inherited from Control) | Determines if this control is in the process of recreating its handle.
Redraw | Gets or sets whether the grid should paint its contents.
Region (inherited from Control) | The region, or shape, of this control.
Right (inherited from Control) | The upper right of the control, in container coordinates.
RightCol | Gets the last visible column in the scrollable area.
RightToLeft (inherited from Control) | Indicates whether the control should draw right-to-left for RTL languages.
Row | Gets or sets the row that contains the cursor.
Rows | Gets the collection of Row objects in the grid.
RowSel | Gets or sets the last row in the current selection.
ScrollableRectangle | Overriden. Gets a rectangle that defines the scrollable portion of the control.
ScrollBars (inherited from ScrollableControl) | Gets or sets which scroll bars should appear on the control.
ScrollPosition (inherited from ScrollableControl) | Gets or sets the location of the auto-scroll position.
ScrollTips (inherited from ScrollableControl) | Gets or sets whether the control should display tooltips as the user scrolls vertically.
ScrollTipText (inherited from ScrollableControl) | Gets or sets the tooltip text displayed as the user scrolls vertically.
ScrollTrack (inherited from ScrollableControl) | Gets or sets whether the control should scroll as the user drags the scrollbar thumb.
Selection | Gets the selected range in normalized form.
SelectionMode | Gets or sets the grid's selection behavior.
ShowButtons | Gets or sets when to display combo buttons in cells.
ShowCellLabels | Gets or sets whether the grid should display labels over cells whose contents are partially hidden.
ShowCursor | Gets or sets whether the grid should display a DB-style cursor on the first fixed column.
ShowErrors | Gets or sets whether the grid should display error information in cells and rows.
ShowSort | Gets or sets whether the grid should display sorting glyphs (a triangle) on the headers of sorted columns.
Size (inherited from Control) | The size of the control in pixels.
Styles | Gets the collection of cell styles defined in the grid.
SubtotalPosition | Gets or sets whether node rows appear above or below the data.
TabIndex (inherited from Control) | Determines the index in the TAB order that this control will occupy.
TabStop (inherited from Control) | Indicates whether the user can use the TAB key to give focus to the control.
Tag (inherited from Control) | User defined data associated with the control.
Top (inherited from Control) | The top of the control, in container coordinates.
TopLevelControl (inherited from Control) | Retrieves the top level control that contains this control.
TopRow | Gets or sets the first visible row in the scrollable area.
Tree | Gets a reference to the GridTree object that controls the appearance of the outline tree in the grid.
Visible (inherited from Control) | Determines whether the control is visible or hidden.
Width (inherited from Control) | The width of the control, in container coordinates.
Item |

Protected Properties

ResizeRedraw (inherited from Control)

Indicates whether the control should redraw itself when resized.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AllowAddNew Property

C1FlexGridBase.AllowAddNew Property

Gets or sets whether the grid should display a new row template after the last data row.

[Visual Basic]

Public Property AllowAddNew As Boolean

[C#]

public bool AllowAddNew {get;set;}

[Delphi]

public property AllowAddNew: Boolean read get_AllowAddNew write set_AllowAddNew;

Remarks

If the user enters data into the new row template, a new row is automatically added to the grid.

This property works in bound mode (if the data source supports adding new rows) and also in unbound mode.

Note that if this property is set to True, the Rows.Count property will return a value that includes the new row template. If you set the Rows.Count property, the grid will set the number of data rows and will automatically add the new row template. For example:

flex.AllowAddNew = true;

flex.Rows.Count = 10;

Console.WriteLine("Row count is {0}.", _flex.Rows.Count);

Row count is 11.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AllowDelete Property

C1FlexGridBase.AllowDelete Property

Gets or sets whether the grid should monitor the keyboard and handle the DEL key.

[Visual Basic]

Public Property AllowDelete As Boolean

[C#]

public bool AllowDelete {get;set;}

[Delphi]

public property AllowDelete: Boolean read get_AllowDelete write set_AllowDelete;

Remarks

If this property is set to True, the user can delete rows by selecting them and then pressing the DEL key.

This property works in bound mode (if the data source supports deleting rows) and in unbound mode.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AllowDragging Property

C1FlexGridBase.AllowDragging Property

Gets or sets whether the user is allowed to drag rows and columns with the mouse.

[Visual Basic]

Public Property AllowDragging As AllowDraggingEnum

[C#]

public AllowDraggingEnum AllowDragging {get;set;}

[Delphi]

public property AllowDragging: AllowDraggingEnum read get_AllowDragging write set_AllowDragging;

Remarks

Row dragging may not work in bound mode. This is because some data sources do not allow absolute positioning of rows.

ADO.NET DataTable object in particular do not support this.

Column dragging is supported for any data source, and row dragging is always supported in unbound mode.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AllowEditing Property

C1FlexGridBase.AllowEditing Property

Gets or sets whether the user is allowed to edit grid contents.

[Visual Basic]

Public Property AllowEditing As Boolean

[C#]

public bool AllowEditing {get;set;}

[Delphi]

public property AllowEditing: Boolean read get_AllowEditing write set_AllowEditing;

Remarks

If you set AllowEditing to False, editing is disabled for the entire grid.

To enable editing on some rows and columns, set AllowEditing to True for the grid and set the AllowEditing or AllowEditing properties to False for the rows and columns that should not be editable.

You can also disable editing of specific cells by handling the BeforeEdit event and setting the Cancel event parameter to True.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AllowFreezing Property

C1FlexGridBase.AllowFreezing Property

Gets or sets whether the user is allowed to freeze rows and columns with the mouse.

[Visual Basic]

Public Property AllowFreezing As AllowFreezingEnum

[C#]

public AllowFreezingEnum AllowFreezing {get;set;}

[Delphi]

public property AllowFreezing: AllowFreezingEnum read get_AllowFreezing write set_AllowFreezing;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AllowResizing Property

C1FlexGridBase.AllowResizing Property

Gets or sets whether the user is allowed to resize rows and columns with the mouse.

[Visual Basic]

Public Property AllowResizing As AllowResizingEnum

[C#]

public AllowResizingEnum AllowResizing {get;set;}

[Delphi]

public property AllowResizing: AllowResizingEnum read get_AllowResizing write set_AllowResizing;

Remarks

To resize rows or columns, the mouse must be over the fixed area of the grid, and close to a border between rows or columns. The mouse pointer will change into a sizing pointer and the user can drag the row or column to change the row height or column width.

If a group of columns is selected (from first to last row) and the user resizes one of them, all selected columns are resized. The same applies to rows.

If column sizing is allowed, users may double-click the resizing area to resize a column so it will automatically fit the longest entry.

Rows with zero height and columns with zero width cannot be resized by the user. If you want to make them very small but still resizable, set their height or width to one pixel, not to zero.

The BeforeResizeRow and BeforeResizeColumn events fire before resizing starts, and may be used to prevent resizing of specific rows and columns. The AfterResizeRow and AfterResizeColumn events fire after resizing, and may be used to validate the user's action and to update the display.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AllowSorting Property

C1FlexGridBase.AllowSorting Property

Gets or sets whether the user is allowed to sort columns using the mouse.

[Visual Basic]

Public Property AllowSorting As AllowSortingEnum

[C#]

public AllowSortingEnum AllowSorting {get;set;}

[Delphi]

public property AllowSorting: AllowSortingEnum read get_AllowSorting write set_AllowSorting;

Remarks

When the grid is used in bound mode, the sorting is performed by the DataSource object. If the data source object does not support sorting, this property has no effect.

In unbound mode, you can also sort data using the Sort (SortFlags, Int32) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoClipboard Property

C1FlexGridBase.AutoClipboard Property

Gets or sets whether the grid should handle the clipboard keys and automatically perform cut, copy, paste, and delete operations.

[Visual Basic]

Public Property AutoClipboard As Boolean

[C#]

public bool AutoClipboard {get;set;}

[Delphi]

public property AutoClipboard: Boolean read get_AutoClipboard write set_AutoClipboard;

Remarks

Setting this property to True causes the grid to monitor the keyboard for the following clipboard keys:

Copy: CTRL-INS, CTRL-C

Cut: CTRL-X, SHIFT-DEL

Paste: CTRL-V, SHIFT-INS

Delete: DEL

Cut, paste, and delete actions are performed only if the AllowEditing property is set to True.

If you want to handle only a subset of the supported keys, add a handler to the System.Windows.Forms.Control.KeyDown event and set the Handled parameter to True to disable some of the keys.

Automatic clipboard operations only affect the grid data. Styles and images are not copied, pasted, or deleted.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoGenerateColumns Property

C1FlexGridBase.AutoGenerateColumns Property

Gets or sets whether columns are automatically created when the grid is bound to a data source.

[Visual Basic]

Public Property AutoGenerateColumns As Boolean

[C#]

public bool AutoGenerateColumns {get;set;}

[Delphi]

public property AutoGenerateColumns: Boolean read get_AutoGenerateColumns write set_AutoGenerateColumns;

Remarks

By default, assigning a new DataSource to the grid resets the column collection to reflect the data source schema. If you set AutoGenerateColumns to False, the existing column layout will be preserved.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoResize Property

C1FlexGridBase.AutoResize Property

Gets or sets whether column widths are automatically adjusted when data is loaded.

[Visual Basic]

Public Property AutoResize As Boolean

[C#]

public bool AutoResize {get;set;}

[Delphi]

public property AutoResize: Boolean read get_AutoResize write set_AutoResize;

Remarks

This property works when the control is bound to a DataSource.

If AutoResize is set to True, the control automatically resizes its columns to fit the widest entry every time new data is read from the data source.

If the data source contains a large number of rows and columns, the automatic resizing may take a relatively long time. In these cases, you should consider setting AutoResize to False and setting the column widths directly in code.

You may use the AutoSizeCols (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags) method to adjust column widths with code.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSearch Property

C1FlexGridBase.AutoSearch Property

Gets or sets whether the grid should move the cursor searching for entries as the user types.

[Visual Basic]

Public Property AutoSearch As AutoSearchEnum

[C#]

public AutoSearchEnum AutoSearch {get;set;}

[Delphi]

public property AutoSearch: AutoSearchEnum read get_AutoSearch write set_AutoSearch;

Remarks

If AutoSearch is on, the grid will search the current column as the user types, automatically moving the cursor and highlighting matches using the Styles style. The search is case-insensitive. The search is canceled when the user presses the ESC key or moves the selection with the mouse or cursor keys.

When the user stops typing for about a second, the search buffer is reset. This amount of time can be changed by setting the AutoSearchDelay property.

If AutoSearch is on and AllowEditing is set to True, the user will need to hit ENTER, SPACE, or F2 to start editing cells. Other keys are used for searching.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSearchDelay Property

C1FlexGridBase.AutoSearchDelay Property

Gets or sets the delay (in seconds) before the AutoSearch buffer is reset.

[Visual Basic]

Public Property AutoSearchDelay As Double

[C#]

public Double AutoSearchDelay {get;set;}

[Delphi]

public property AutoSearchDelay: Double read get_AutoSearchDelay write set_AutoSearchDelay;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BackColor Property

C1FlexGridBase.BackColor Property

Gets or sets the background color for the control.

[Visual Basic]

Overrides Public Property BackColor As Color

[C#]

override public Color BackColor {get;set;}

[Delphi]

public property BackColor: Color read get_BackColor write set_BackColor;

Remarks

This is the color used to paint the background of the scrollable cells, also defined by the Normal cell style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BottomRow Property

C1FlexGridBase.BottomRow Property

Gets the last visible row in the scrollable area.

[Visual Basic]

Public ReadOnly Property BottomRow As Integer

[C#]

public int BottomRow {get;}

[Delphi]

public property BottomRow: Int32 read get_BottomRow;

Remarks

The index returned may correspond to a row that is only partially visible.

This property is read-only. To scroll the contents of the grid, see the TopRow, LeftCol, and ScrollPosition properties.

To ensure that a cell is visible, use the ShowCell method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CellButtonImage Property

C1FlexGridBase.CellButtonImage Property

Gets or sets the image to be used in cell buttons.

[Visual Basic]

Overridable Public Property CellButtonImage As Image

[C#]

virtual public Image CellButtonImage {get;set;}

[Delphi]

public property CellButtonImage: Image read get_CellButtonImage write set_CellButtonImage;

Remarks

This property allows you to customize the appearance of cell buttons. For details on how to create and handle cell buttons, see the CellButtonClick event.

If you want to use a single picture for all cell buttons on the grid, assign the picture to the CellButtonImage property at design time. To change pictures depending on the row, column, or cell being edited, set the picture in response to the BeforeEdit event.

The pictures used for cell buttons should fit within the button (larger pictures are truncated). They should also be transparent, so the button face can be seen through the empty parts of the picture. For best results, use small icons (16 x 16 pixels) and draw the picture in the upper left 12 x 12 rectangle within the icon.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Clip Property

C1FlexGridBase.Clip Property

Gets or sets the contents of the selected range.

[Visual Basic]

Public Property Clip As String

[C#]

public string Clip {get;set;}

[Delphi]

public property Clip: String read get_Clip write set_Clip;

Remarks

The string assigned to (or returned by) the Clip property may contain multiple cells. By default, tab characters (\t) indicate column breaks, and carriage return characters (\n) indicate row breaks.

The default row and column delimiters may be changed using the ClipSeparators property.

When a string is assigned to the Clip property, only the selected cells are affected. If there are more cells in the selected region than are described in the clip string, the remaining cells are ignored. If there are more cells described in the clip string than in the selected region, the extra portion of the clip string is ignored. Empty entries in the Clip string will clear existing cell contents.

To get or set a clip string for an arbitrary range, use a CellRange object.

Example

The code below puts text into a selected area two rows high and two columns wide.

// build clip string

string s = "r1 c1\tr1 c2\nr2 c1\tr2 c2";

// select a 2 x 2 range and apply clip string to selection

flex.Select(2, 2, 4, 4);

flex.Clip = s;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ClipSeparators Property

C1FlexGridBase.ClipSeparators Property

Gets or sets the characters used as row and column separators in clip strings.

[Visual Basic]

Public Property ClipSeparators As String

[C#]

public string ClipSeparators {get;set;}

[Delphi]

public property ClipSeparators: String read get_ClipSeparators write set_ClipSeparators;

Remarks

For details and an example, see the Clip property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Col Property

C1FlexGridBase.Col Property

Gets or sets the column that contains the cursor.

[Visual Basic]

Public Property Col As Integer

[C#]

public int Col {get;set;}

[Delphi]

public property Col: Int32 read get_Col write set_Col;

Remarks

Use the Row and Col properties to make a cell current or to find out which row or column contains the current cell. Columns and rows are numbered from zero, beginning at the top for rows and at the left for columns.

The Col property may be set to -1 to hide the selection, to a value between zero and Cols.Fixed-1 to select a cell in a fixed column, or to a value between Cols.Fixed and Cols.Count-1 to select a cell in a scrollable column.

Setting the Row and Col properties automatically collapses the selection to a single cell, resetting the RowSel and ColSel properties. To specify a block selection, you must set Row and Col, then RowSel and ColSel. Alternatively, you can use the Select (CellRange, Boolean) method to select an arbitrary range with a single statement.

Setting the Row and Col properties does not ensure that the current cell is visible. To do that, use the ShowCell method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Cols Property

C1FlexGridBase.Cols Property

Gets the collection of Column objects in the grid.

[Visual Basic]

Public Property Cols As ColumnCollection

[C#]

public ColumnCollection Cols {get;set;}

[Delphi]

public property Cols: ColumnCollection read get_Cols write set_Cols;

Remarks

The Cols property returns a reference to the list of columns that make up the grid. With this reference, you can add, remove, move, and count the columns. For more information on the tasks that can be performed with this collection, see the ColumnCollection object.

This property is read-only. The grid creates and manages the column collection for you.

Upgrade Note: In the VSFlexGrid ActiveX control, the Cols and FixedCols properties corresponded to the number of columns and fixed columns on the grid. In C1FlexGrid, use Cols.Count and Cols.Fixed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ColSel Property

C1FlexGridBase.ColSel Property

Gets or sets the last column in the current selection.

[Visual Basic]

Public Property ColSel As Integer

[C#]

public int ColSel {get;set;}

[Delphi]

public property ColSel: Int32 read get_ColSel write set_ColSel;

Remarks

Use the RowSel and ColSel properties to modify a selection or to determine which cells are currently selected. Columns and rows are numbered from zero, beginning at the top for rows and at the left for columns.

Setting the Row and Col properties automatically collapses the selection to a single cell, resetting the RowSel and ColSel properties. Therefore, to specify a block selection, you must Row and Col, then RowSel and ColSel. Alternatively, you may use the Select (CellRange, Boolean) method to select a range with a single statement.

When a range is selected, the value of Row may be greater than or less than RowSel, and Col may be greater than or less than ColSel. This is inconvenient when you need to set up bounds for loops. In these cases, you can use the Selection property to retrieve a normalized CellRange object, where r1 <= r2 and c1 <= c2.

Example

The code below loops though the cells in the current selection:

CellRange rg = flex.Selection;

for (int r = rg.r1; r <= rg.r2; r++)

for (int c = rg.c1; c <= rg.c2; c++)

Console.WriteLine("the value at {0} {1} is {2}", r, c, flex[r, c]);

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ComboList Property

C1FlexGridBase.ComboList Property

Gets or sets the list of items to be used by the drop-down editor.

[Visual Basic]

Public Property ComboList As String

[C#]

public string ComboList {get;set;}

[Delphi]

public property ComboList: String read get_ComboList write set_ComboList;

Remarks

The ComboList property specifies the type of editor to be used when editing a cell. You may use a text box, drop-down list, drop-down combo, or an edit button to pop up custom editor forms.

To use the ComboList property, set the AllowEditing property to True and respond to the BeforeEdit event by setting the ComboList property to a string that describes the type of editing you want to use for that cell. The options are described below:

1. To edit the cell using a regular text box, set the ComboList property to an empty string. For example:

flex.ComboList = string.Empty;

2. To edit the cell using a drop-down list, set the ComboList property to a string containing the available options, separated by pipe characters. For example:

flex.ComboList = "Item 1|Item 2|Item 3";

3. To edit the cell using a drop-down combo, set the ComboList property to a string containing the available options, separated by pipe characters ("|") and starting with a pipe character. For example:

flex.ComboList = "|Item 1|Item 2|Item 3";

4. To display an edit button, set the ComboList property to a string containing an ellipsis ("..."). Edit buttons look like regular push buttons, aligned to the right of the cell, with an ellipsis as a caption. When the user clicks on the edit button, the grid fires the CellButtonClick event. In this case, the user cannot edit the cell contents directly. For example:

flex.ComboList = "...";

5. To display an edit button next to an editable cell, set the ComboList property to a string containing a pipe and an ellipsis ("|..."). In this case, you get a regular edit button but the user can also edit the cell contents directly. For example:

flex.ComboList = "|...";

The ComboList property is especially useful in cases where different rows in the same column may contain different types of data (for example a control such as the PropertyGrid). In this case, the ComboList property allows you to adjust the type of editing you want to provide depending on the current row.

If all rows in the column contain the same type of data, use the Column's ComboList property instead. This way, the grid will automatically select the list depending on the column being edited and you don't need to handle any events.

Example

The code below handles the BeforeEdit event and assigns a value to the ComboList property so that the grid displays buttons on every other row.

private void _flex_BeforeEdit(object sender, RowColEventArgs e)

{

_flex.ComboList = string.Empty;

if (e.Row % 2 == 0) _flex.ComboList = "...";

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CursorCell Property

C1FlexGridBase.CursorCell Property

Gets a CellRange object that contains the cell at coordinates Row, Col.

[Visual Basic]

Overridable Public ReadOnly Property CursorCell As CellRange

[C#]

virtual public CellRange CursorCell {get;}

[Delphi]

public property CursorCell: CellRange read get_CursorCell;

Remarks

To get a CellRange object that spans the entire selection, use the Selection property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CustomComparer Property

C1FlexGridBase.CustomComparer Property

Gets or sets a custom comparer object used by the grid to perform grouping, merging, and searching operations.

[Visual Basic]

Public Property CustomComparer As IComparer

[C#]

public IComparer CustomComparer {get;set;}

[Delphi]

public property CustomComparer: IComparer read get_CustomComparer write set_CustomComparer;

Remarks

The grid has a default System.Collections.IComparer implementation that is used to compare cells and determine if their contents are equivalent. This implementation is used when merging, grouping, or searching for values (see the AllowMerging property and the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) and FindRow (String, Int32, Int32, Boolean, Boolean, Boolean) methods).

The default implementation is case-sensitive and takes leading and trailing blanks into account.

If you want to merge cells using a case-insensitive comparison or trimming blanks, write a custom class that implements the System.Collections.IComparer interface and assign an instance of it to the grid's CustomComparer property.

Setting this property to Null (Nothing in Visual Basic) restores the default behavior.

Example

The code below replaces the built-in comparer with a System.Collections.CaseInsensitiveComparer. This causes the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method to group items that differ only in case into the same groups:

// use case-insensitive comparer

flex.CustomComparer = new CaseInsensitiveComparer();

// add groups ignoring case

flex.Subtotal(AggregateEnum.Sum, 0, groupOn, totalOn);

// restore default (case-sensitive) comparer

flex.CustomComparer = null;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.DataMember Property

C1FlexGridBase.DataMember Property

Gets or sets the specific list in a DataSource object that the grid should display.

[Visual Basic]

Public Property DataMember As String

[C#]

public string DataMember {get;set;}

[Delphi]

public property DataMember: String read get_DataMember write set_DataMember;

Remarks

If a DataSource contains multiple sources of data, you should set the DataMember property to one of the sources.

For example, if the DataSource is a System.Data.DataSet contains three tables named Customers, Orders, and OrderDetails, you must specify one of the tables to bind to.

If the System.Data.DataSet contains only one System.Data.DataTable, you may set the DataMember property to an empty string.

You can use the SetDataBinding (Object, String) method to set the DataSource and DataMember properties at the same time.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.DataSource Property

C1FlexGridBase.DataSource Property

Gets or sets the data source for the grid.

[Visual Basic]

Public Property DataSource As Object

[C#]

public object DataSource {get;set;}

[Delphi]

public property DataSource: Object read get_DataSource write set_DataSource;

Remarks

Any object that implements the System.Collections.IList or System.ComponentModel.IListSource interfaces can be used as a data source.

Specifically, the following ADO.NET data sources are valid: DataTable, DataView, DataSet, and DataViewManager.

The following ComponentOne DataObjects components are also valid data sources: C1ExpressTable, C1ExpressVew, C1ExpressConnection, C1DataView, C1DataTableSource, and C1DataSet.

If the DataSource reference contains more than one table, you must also set the DataMember property a string that specifies the table to bind to. For example, if the DataSource is a DataSet or DataViewManager that contains three tables named Customers, Orders, and OrderDetails, you must specify one of the tables to bind to.

You can use the SetDataBinding (Object, String) method to set the DataSource and DataMember properties simultaneously.

You can also assign another C1FlexGrid object to the DataSource property. In this case, the controls will share the same grid model, including the data, display styles, selection, etc. This can be used to implement split views, where different controls display different parts of the same data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.DoubleBuffer Property

C1FlexGridBase.DoubleBuffer Property

Gets or sets whether the control should use an off-screen buffer when painting to reduce flicker.

[Visual Basic]

Public Property DoubleBuffer As Boolean

[C#]

public bool DoubleBuffer {get;set;}

[Delphi]

public property DoubleBuffer: Boolean read get_DoubleBuffer write set_DoubleBuffer;

Remarks

This property is set to True by default, and rarely needs to be changed.

Setting DoubleBuffer to False may increase performance of applications running under terminal server software.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.DragMode Property

C1FlexGridBase.DragMode Property

Gets or sets a value that determines if the user can drag data from the control.

[Visual Basic]

Public Property DragMode As DragModeEnum

[C#]

public DragModeEnum DragMode {get;set;}

[Delphi]

public property DragMode: DragModeEnum read get_DragMode write set_DragMode;

Remarks

This property allows you to use the control as a source for OLE drag-drop operations. If set to any of the automatic settings, the control provides the following services:

1) Detect when the mouse is near the edge of a selected cell or range and display the OLE drag cursor.

2) If the user clicks the mouse while the OLE drag cursor is displayed, initiate a drag operation with a data object containing the current selection.

In manual mode, the programmer is responsible for starting drag-drop operations using the System.Windows.Forms.Control.DoDragDrop(System.Object,System.Windows.Forms.DragDropEffects) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.DrawMode Property

C1FlexGridBase.DrawMode Property

Gets or sets whether the control should fire the OwnerDrawCell event.

[Visual Basic]

Public Property DrawMode As DrawModeEnum

[C#]

public DrawModeEnum DrawMode {get;set;}

[Delphi]

public property DrawMode: DrawModeEnum read get_DrawMode write set_DrawMode;

Remarks

If you set this property to DrawModeEnum.OwnerDraw, the grid will fire the OwnerDrawCell event whenever a cell needs to be painted. You can handle the event and customize the way each cell is painted, either by changing the cell contents and style, or by taking over the painting and doing it yourself.

For more details and examples, see the OwnerDrawCell event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.DropMode Property

C1FlexGridBase.DropMode Property

Gets or sets a value that determines if the control can accept data that the user drags onto it.

[Visual Basic]

Public Property DropMode As DropModeEnum

[C#]

public DropModeEnum DropMode {get;set;}

[Delphi]

public property DropMode: DropModeEnum read get_DropMode write set_DropMode;

Remarks

This property allows you to use the control as a target for OLE drag-drop operations.

If set to DropModeEnum.None (the default value), the control does not act as a drop target.

If set to DropModeEnum.Manual, the control fires the standard drag-drop events and the programmer is responsible for handling them. The main events involved are System.Windows.Forms.Control.DragOver and System.Windows.Forms.Control.DragDrop. These events are provided by the standard System.Windows.Forms.Control object.

If set to DropModeEnum.Automatic, the control handles the System.Windows.Forms.Control.DragOver and System.Windows.Forms.Control.DragDrop events automatically by performing the following actions:

1) Query the data object for data in text or filename formats.

2) Scroll if the user drags an object near the edges of the control.

3) Paste the contents of the data object when the user drops valid data on the control.

Note: This property replaces and extends the C1.Win.C1FlexGrid.C1FlexGridBase.AllowDrop property provided by the base System.Windows.Forms.Control object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.EditMask Property

C1FlexGridBase.EditMask Property

Gets or sets the input mask to use when editing cells.

[Visual Basic]

Public Property EditMask As String

[C#]

public string EditMask {get;set;}

[Delphi]

public property EditMask: String read get_EditMask write set_EditMask;

Remarks

The EditMask specifies an input mask for automatic input formatting and validation. The mask syntax is similar to the one used by the Microsoft MaskedEdit ActiveX control and by Microsoft Access and is described below.

Set the EditMask property in response to the BeforeEdit event, in the same way you would set the ComboList property.

If the same mask is used to edit all values in a column, use the column's EditMask property. This simplifies your code because you don't need to handle the BeforeEdit event.

When the user is done editing a cell with a mask, the ValidateEdit event fires. The Cancel event parameter will be set to True if the mask was not filled out properly, so in most cases you don't have to implement the handler. The default behavior ensures that only valid data will be entered.

The EditMask string is composed of the following symbols:

1) Wildcards

0 digit

9 digit or space

# digit, space, or sign

L letter

? letter or space

A letter or digit

a letter, digit, or space

& any character

2) Localized characters

. localized decimal separator

, localized thousand separator

: localized time separator

/ localized date separator

3) Command characters

\ next character is taken as a literal

> translate letters to uppercase

< translate letters to lowercase

4) Placeholder specification

; next character is used as a placeholder (the default is an underscore)

Example

The code below sets the edit mask so the user can enter a phone number, with optional area code, and a state in uppercase letters. The spaceholder used is an asterisk ("*").

flex.EditMask = "(###) 000-0000 St\ate\: >LL;*";

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.EditOptions Property

C1FlexGridBase.EditOptions Property

Gets or sets flags that customize the grid's editing behavior.

[Visual Basic]

Public Property EditOptions As EditFlags

[C#]

public EditFlags EditOptions {get;set;}

[Delphi]

public property EditOptions: EditFlags read get_EditOptions write set_EditOptions;

Remarks

The default value for this property is EditFlags.All, which enables all editing options. See the EditFlags enumeration for a list of options available.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Editor Property

C1FlexGridBase.Editor Property

Gets or sets a reference to the cell editor that is currently active.

[Visual Basic]

Public Property Editor As Control

[C#]

public Control Editor {get;set;}

[Delphi]

public property Editor: Control read get_Editor write set_Editor;

Remarks

The Editor property returns a reference to the cell editor that is currently active. This may be one of the built-in editors (a TextBox, a ComboBox, or a DateTimePicker control), a custom editor, or null (if the grid is not in edit mode).

You can use this property to programmatically access the editor, or to find out if the grid is in edit mode.

If you don't want to use the grid's built-in editors, you can use any other control instead. To do this, either associate the external editor with a specific grid row, column, or CellStyle using the Editor property, which you can get and set at any time.

Alternatively, you can handle the StartEdit event and assign any control directly to the Editor property. (Note that the grid's Editor property can only be assigned while handling the StartEdit event, and is automatically reset to Null when the grid exits edit mode.)

Any control can be used as an external editor, but to achieve complete integration with the grid, the external editor should implement the IC1EmbeddedEditor interface. Some controls implement this interface natively and don't require any extra code to be used as grid editors (like the ones in the C1Input library). Most, however, will require you to implement at least a few of the methods in IC1EmbeddedEditor.

For examples of custom editors, please see Using Custom Editors and Creating Custom Editors in this documentation, or visit our on-line sample library at http://helpcentral.componentone.com/ProductResources.aspx and download the "CustomEditors" sample.

Example

The code below uses the SetupEditor event to customize the current editor by setting two properties.

private void _flex_SetupEditor(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)

{

TextBox tb = _flex.Editor as TextBox;

if (tb != null)

{

tb.CharacterCasing = CharacterCasing.Upper;

tb.MaxLength = 12;

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ExtendLastCol Property

C1FlexGridBase.ExtendLastCol Property

Gets or sets whether the last column should be extended to fill the control.

[Visual Basic]

Public Property ExtendLastCol As Boolean

[C#]

public bool ExtendLastCol {get;set;}

[Delphi]

public property ExtendLastCol: Boolean read get_ExtendLastCol write set_ExtendLastCol;

Remarks

This property only affects painting. It does not modify the Width property of the last column.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.FocusRect Property

C1FlexGridBase.FocusRect Property

Gets or sets the type of focus rectangle to display.

[Visual Basic]

Public Property FocusRect As FocusRectEnum

[C#]

public FocusRectEnum FocusRect {get;set;}

[Delphi]

public property FocusRect: FocusRectEnum read get_FocusRect write set_FocusRect;

Remarks

If the focus rectangle is drawn, then the current cell is painted using the Styles style, which by default looks like a regular scrollable cell (as in most spreadsheets and grids).

If the focus rectangle is hidden (using the FocusRectEnum.None setting), the current cell is painted using the Styles style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ForeColor Property

C1FlexGridBase.ForeColor Property

Gets or sets the foreground color for the control.

[Visual Basic]

Overrides Public Property ForeColor As Color

[C#]

override public Color ForeColor {get;set;}

[Delphi]

public property ForeColor: Color read get_ForeColor write set_ForeColor;

Remarks

This is the color used to paint the text in scrollable cells, also defined by the Normal cell style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Glyphs Property

C1FlexGridBase.Glyphs Property

Gets the collection of control glyphs (images used to show sorting, checkboxes, etc).

[Visual Basic]

Public ReadOnly Property Glyphs As GridGlyphs

[C#]

public GridGlyphs Glyphs {get;}

[Delphi]

public property Glyphs: GridGlyphs read get_Glyphs;

Remarks

The Glyphs property returns a GridGlyphs collection with an indexer of type GlyphEnum. This collection allows you to get or set the images used to indicate column sorting, collapsed and expanded outline groups, checkboxes, cursors, error information, etc.

Note: Setting a glyph to Null restores the default (built-in) image. If you want to make a glyph invisible, set it to a small blank image instead.

Example

For example, the code below causes the grid to use custom images to display the column sorting order (instead of the built-in hollow triangles):

flex.Glyphs[GlyphEnum.Ascending] = imgAscending;

flex.Glyphs[GlyphEnum.Descending] = imgDescending;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.HighLight Property

C1FlexGridBase.HighLight Property

Gets or sets when to highlight selected cells.

[Visual Basic]

Public Property HighLight As HighLightEnum

[C#]

public HighLightEnum HighLight {get;set;}

[Delphi]

public property HighLight: HighLightEnum read get_HighLight write set_HighLight;

Remarks

You can customize the appearance of highlighted cells by modifying the Styles property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Item Property

C1FlexGridBase.Item Property

[Visual Basic]

Public Default Property Item( _

ByVal row As Integer, _

ByVal colName As String _

) As Object

[C#]

public object this[

int row,

string colName

] {get;set;}

[Delphi]

public property Item[

row: Int32;

colName: String

]: Object read get_Item write set_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.KeyActionEnter Property

C1FlexGridBase.KeyActionEnter Property

Gets or sets the action to be performed when the user presses the ENTER key.

[Visual Basic]

Public Property KeyActionEnter As KeyActionEnum

[C#]

public KeyActionEnum KeyActionEnter {get;set;}

[Delphi]

public property KeyActionEnter: KeyActionEnum read get_KeyActionEnter write set_KeyActionEnter;

Remarks

By default, the grid will move the selection to the next visible row when the user presses the ENTER key. If the grid is editable, pressing ENTER will cause the grid to enter edit mode, and pressing ENTER while in edit mode will cause the cursor to move down.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.KeyActionTab Property

C1FlexGridBase.KeyActionTab Property

Gets or sets the action to be performed when the user presses the TAB key.

[Visual Basic]

Public Property KeyActionTab As KeyActionEnum

[C#]

public KeyActionEnum KeyActionTab {get;set;}

[Delphi]

public property KeyActionTab: KeyActionEnum read get_KeyActionTab write set_KeyActionTab;

Remarks

By default, the grid will ignore the TAB key and it will be handled by the form, moving the focus to the next control in the tab order. If you set the KeyActionTab property to a value other than KeyActionEnum.None, the grid will trap the TAB key and use it for navigating cells.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LeftCol Property

C1FlexGridBase.LeftCol Property

Gets or sets the first visible column in the scrollable area.

[Visual Basic]

Public Property LeftCol As Integer

[C#]

public int LeftCol {get;set;}

[Delphi]

public property LeftCol: Int32 read get_LeftCol write set_LeftCol;

Remarks

Setting the LeftCol property causes the grid to scroll horizontally so that the given column becomes the leftmost visible column. This is often useful when you want to synchronize two or more grids so that when one of them scrolls, the other scrolls as well. To scroll vertically, use the TopRow property.

When setting this property, the largest possible column number is the total number of columns minus the number of columns that will fit the display. Attempting to set LeftCol to a greater value will cause the grid to set it to the largest possible value (no error will occur).

The value returned by the LeftCol and TopRow properties may correspond to partially visible rows or columns.

Use the LeftCol and TopRow properties to scroll using cells as units. Use the ScrollPosition property to scroll the grid using pixel units.

To ensure that a given cell is visible, use the ShowCell method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.MouseCol Property

C1FlexGridBase.MouseCol Property

Gets the index of the column under the cursor.

[Visual Basic]

Overridable Public ReadOnly Property MouseCol As Integer

[C#]

virtual public int MouseCol {get;}

[Delphi]

public property MouseCol: Int32 read get_MouseCol;

Remarks

The MouseRow and MouseCol properties are often useful when handling the BeforeMouseDown event, to provide custom mouse handling. They are also useful when handling mouse events that do not change the selection and for detecting clicks on the fixed areas of the grid.

Typical uses for these properties include displaying help information or tooltips when the user moves the mouse over a selection, and the implementation of manual drag-and-drop manipulation of OLE objects.

MouseRow and MouseCol return -1 if the mouse is not over any rows or columns.

To obtain more detailed hit-testing information, use the HitTest (Int32, Int32) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.MouseRow Property

C1FlexGridBase.MouseRow Property

Gets the index of the row under the cursor.

[Visual Basic]

Overridable Public ReadOnly Property MouseRow As Integer

[C#]

virtual public int MouseRow {get;}

[Delphi]

public property MouseRow: Int32 read get_MouseRow;

Remarks

The MouseRow and MouseCol properties are often useful when handling the BeforeMouseDown event, to provide custom mouse handling. They are also useful when handling mouse events that do not change the selection and for detecting clicks on the fixed areas of the grid.

Typical uses for these properties include displaying help information or tooltips when the user moves the mouse over a selection, and the implementation of manual drag-and-drop manipulation of OLE objects.

MouseRow and MouseCol return -1 if the mouse is not over any rows or columns.

To obtain more detailed hit-testing information, use the HitTest (Int32, Int32) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.PrintParameters Property

C1FlexGridBase.PrintParameters Property

Gets a GridPrinter object that specifies printing parameters for the grid.

[Visual Basic]

Public ReadOnly Property PrintParameters As GridPrinter

[C#]

public GridPrinter PrintParameters {get;}

[Delphi]

public property PrintParameters: GridPrinter read get_PrintParameters;

Remarks

Use the PrintGrid (String, PrintGridFlags) method to print the grid and specify the document name, common printing options, headers and footers.

Use the PrintParameters property to specify less common printing options such as header and footer fonts, page margins, and page orientation.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Redraw Property

C1FlexGridBase.Redraw Property

Gets or sets whether the grid should paint its contents.

[Visual Basic]

Public Property Redraw As Boolean

[C#]

public bool Redraw {get;set;}

[Delphi]

public property Redraw: Boolean read get_Redraw write set_Redraw;

Remarks

The Redraw property is used to optimize the performance of the grid. Before making extensive changes, set it to False to suspend repainting. When the changes are done, set it back to True. This will reduce flicker and increase performance. This optimization is especially effective when adding large numbers of rows to the grid, because it needs to recalculate ranges and update scrollbars each time a row is added.

Example

The code below turns repainting off, changes the contents of the grid, and then turns repainting back on to show the results. Note how the code saves the original setting of the Redraw property and restores it inside a 'finally' block to ensure repaining is properly restored.

private function UpdateGrid(c1FlexGrid flex)

{

bool redraw = flex.Redraw; // save original value

flex.Redraw = false; // suspend painting to avoid flicker

try

{

flex.Rows.Count = 1;

for (int i = 1; i < 10000; i++)

flex.AddItem("Row " + i.ToString());

}

finally

{

flex.Redraw = redraw; // always restore painting

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.RightCol Property

C1FlexGridBase.RightCol Property

Gets the last visible column in the scrollable area.

[Visual Basic]

Public ReadOnly Property RightCol As Integer

[C#]

public int RightCol {get;}

[Delphi]

public property RightCol: Int32 read get_RightCol;

Remarks

The index returned may correspond to a column that is only partially visible.

This property is read-only. To scroll the contents of the grid, see the TopRow, LeftCol, and ScrollPosition properties.

To ensure that a cell is visible, use the ShowCell method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Row Property

C1FlexGridBase.Row Property

Gets or sets the row that contains the cursor.

[Visual Basic]

Public Property Row As Integer

[C#]

public int Row {get;set;}

[Delphi]

public property Row: Int32 read get_Row write set_Row;

Remarks

Use the Row and Col properties to make a cell current or to find out which row or column contains the current cell. Columns and rows are numbered from zero, beginning at the top for rows and at the left for columns.

The Row property may be set to -1 to hide the selection, to a value between zero and Rows.Fixed-1 to select a cell in a fixed row, or to a value between Rows.Fixed and Rows.Count-1 to select a cell in a scrollable row.

Setting the Row and Col properties automatically collapses the selection to a single cell, resetting the RowSel and ColSel properties. To specify a block selection, you must set Row and Col, then RowSel and ColSel. Alternatively, you can use the Select (CellRange, Boolean) method to select an arbitrary range with a single statement.

Setting the Row and Col properties does not ensure that the current cell is visible. To do that, use the ShowCell method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Rows Property

C1FlexGridBase.Rows Property

Gets the collection of Row objects in the grid.

[Visual Basic]

Public ReadOnly Property Rows As RowCollection

[C#]

public RowCollection Rows {get;}

[Delphi]

public property Rows: RowCollection read get_Rows;

Remarks

The Rows property returns a reference to the list of rows that make up the grid. With this reference, you can add, remove, move, and count the rows. For more information on the tasks that can be performed with this collection, see the RowCollection object.

This property is read-only. The grid creates and manages the row collection for you.

Upgrade Note: In the VSFlexGrid ActiveX control, the Rows and FixedRows properties corresponded to the number of rows and fixed rows on the grid. In C1FlexGrid, use Rows.Count and Rows.Fixed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.RowSel Property

C1FlexGridBase.RowSel Property

Gets or sets the last row in the current selection.

[Visual Basic]

Public Property RowSel As Integer

[C#]

public int RowSel {get;set;}

[Delphi]

public property RowSel: Int32 read get_RowSel write set_RowSel;

Remarks

Use the RowSel and ColSel properties to modify a selection or to determine which cells are currently selected. Columns and rows are numbered from zero, beginning at the top for rows and at the left for columns.

Setting the Row and Col properties automatically collapses the selection to a single cell, resetting the RowSel and ColSel properties. Therefore, to specify a block selection, you must Row and Col, then RowSel and ColSel. Alternatively, you may use the Select (CellRange, Boolean) method to select a range with a single statement.

If the SelectionMode property is set to SelectionModeEnum.ListBox, you should use the Row property on individual row objects to select and deselect rows.

When a range is selected, the value of Row may be greater than or less than RowSel, and Col may be greater than or less than ColSel. This is inconvenient when you need to set up bounds for loops. In these cases, you can use the Selection property to retrieve a normalized CellRange object, where r1 <= r2 and c1 <= c2.

See the ColSel property for an example.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ScrollableRectangle Property

C1FlexGridBase.ScrollableRectangle Property

Gets a rectangle that defines the scrollable portion of the control.

[Visual Basic]

Overrides Public ReadOnly Property ScrollableRectangle As Rectangle

[C#]

override public Rectangle ScrollableRectangle {get;}

[Delphi]

public property ScrollableRectangle: Rectangle read get_ScrollableRectangle;

Remarks

The value returned corresponds to the control's client area minus any fixed and frozen rows and columns.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Selection Property

C1FlexGridBase.Selection Property

Gets the selected range in normalized form.

[Visual Basic]

Overridable Public ReadOnly Property Selection As CellRange

[C#]

virtual public CellRange Selection {get;}

[Delphi]

public property Selection: CellRange read get_Selection;

Remarks

The range returned corresponds to the current selection, defined by the Row, Col, RowSel, and ColSel properties. The range is normalized, so range.r1 <= range.r2 and range.c1 <= range.c2. This makes it easy to loop through the selection. For example:

int total = 0;

CellRange rg = flex.Selection;

for (int r = rg.r1; r <= rg.r2; r++)

for (int c = rg.c1; c <= rg.c2; c++)

total += (int)flex[r,c];

Console.WriteLine("The total is: {0}", total);

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SelectionMode Property

C1FlexGridBase.SelectionMode Property

Gets or sets the grid's selection behavior.

[Visual Basic]

Public Property SelectionMode As SelectionModeEnum

[C#]

public SelectionModeEnum SelectionMode {get;set;}

[Delphi]

public property SelectionMode: SelectionModeEnum read get_SelectionMode write set_SelectionMode;

Remarks

In most selection modes, you can obtain the current selection using the Selection property.

When SelectionMode is set to SelectionModeEnum.ListBox, however, the selection may consist of a non-continuous range of rows. In this case, you can check the selection state of individual rows using the Row property or obtain a collection of selected rows using the Rows property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ShowButtons Property

C1FlexGridBase.ShowButtons Property

Gets or sets when to display combo buttons in cells.

[Visual Basic]

Public Property ShowButtons As ShowButtonsEnum

[C#]

public ShowButtonsEnum ShowButtons {get;set;}

[Delphi]

public property ShowButtons: ShowButtonsEnum read get_ShowButtons write set_ShowButtons;

Remarks

By default, the grid will show editing buttons in cells only when they have the focus. This is the same behavior used by the System.Windows.Forms.PropertyGrid control.

If you set ShowButtons to ShowButtonsEnum.Always, the grid will display buttons on any cells that have associated lists, even if they don't have the focus.

For details on how to associate lists with cells, see the ComboList, ComboList, and DataMap properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ShowCellLabels Property

C1FlexGridBase.ShowCellLabels Property

Gets or sets whether the grid should display labels over cells whose contents are partially hidden.

[Visual Basic]

Public Property ShowCellLabels As Boolean

[C#]

public bool ShowCellLabels {get;set;}

[Delphi]

public property ShowCellLabels: Boolean read get_ShowCellLabels write set_ShowCellLabels;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ShowCursor Property

C1FlexGridBase.ShowCursor Property

Gets or sets whether the grid should display a DB-style cursor on the first fixed column.

[Visual Basic]

Public Property ShowCursor As Boolean

[C#]

public bool ShowCursor {get;set;}

[Delphi]

public property ShowCursor: Boolean read get_ShowCursor write set_ShowCursor;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ShowErrors Property

C1FlexGridBase.ShowErrors Property

Gets or sets whether the grid should display error information in cells and rows.

[Visual Basic]

Public Property ShowErrors As Boolean

[C#]

public bool ShowErrors {get;set;}

[Delphi]

public property ShowErrors: Boolean read get_ShowErrors write set_ShowErrors;

Remarks

Setting this property to True causes the grid to display error information in cells and rows. Error information is displayes as error icons in the cells or row headers. Moving the mouse over the error icons show tooltips containing an error description.

The error information may be supplied directly by data sources that implement the System.ComponentModel.IDataErrorInfo interface (for example, the DataTable class implements this interface).

If the grid is bound to a data source that doesn't support System.ComponentModel.IDataErrorInfo, you can provide error information using the GetCellErrorInfo and GetRowErrorInfo events.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ShowSort Property

C1FlexGridBase.ShowSort Property

Gets or sets whether the grid should display sorting glyphs (a triangle) on the headers of sorted columns.

[Visual Basic]

Public Property ShowSort As Boolean

[C#]

public bool ShowSort {get;set;}

[Delphi]

public property ShowSort: Boolean read get_ShowSort write set_ShowSort;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Styles Property

C1FlexGridBase.Styles Property

Gets the collection of cell styles defined in the grid.

[Visual Basic]

Public Property Styles As CellStyleCollection

[C#]

public CellStyleCollection Styles {get;set;}

[Delphi]

public property Styles: CellStyleCollection read get_Styles write set_Styles;

Remarks

The Styles property enables you to obtain a reference to the list of styles that are currently defined in the grid. With this reference, you can add, remove, and count the styles. For more information on the tasks that can be performed with this collection, see the CellStyleCollection class reference topics. For information on cell formatting, see the CellStyle reference topics.

This property is read-only. The grid creates and manages the collection for you.

Upgrade Note: The VSFlexGrid ActiveX control had many properties that affected the way the grid was displayed (e.g. BackColor, BackColorAlternate, BackColorBkg, BackColorFixed, BackColorFrozen, BackColorSel, and so on). The C1FlexGrid control replaces all these properties with a collection of CellStyle objects. This makes the object model simpler, more consistent, and more powerful. You can change the built-in styles or define your own, and assign them to rows, columns, or arbitrary cell ranges.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SubtotalPosition Property

C1FlexGridBase.SubtotalPosition Property

Gets or sets whether node rows appear above or below the data.

[Visual Basic]

Public Property SubtotalPosition As SubtotalPositionEnum

[C#]

public SubtotalPositionEnum SubtotalPosition {get;set;}

[Delphi]

public property SubtotalPosition: SubtotalPositionEnum read get_SubtotalPosition write set_SubtotalPosition;

Remarks

This property determines how the outline tree is drawn, and it also determines whether the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method should add subtotal rows (which are node rows) above or below the data being summarized.

Changing this property clears any existing nodes.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.TopRow Property

C1FlexGridBase.TopRow Property

Gets or sets the first visible row in the scrollable area.

[Visual Basic]

Public Property TopRow As Integer

[C#]

public int TopRow {get;set;}

[Delphi]

public property TopRow: Int32 read get_TopRow write set_TopRow;

Remarks

Setting the TopRow property causes the grid to scroll vertically so that the given row becomes the topmost visible row. This is often useful when you want to synchronize two or more grids so that when one of them scrolls, the other scrolls as well. To scroll horizontally, use the LeftCol property.

When setting this property, the largest possible row number is the total number of rows minus the number of rows that will fit the display. Attempting to set TopRow to a greater value will cause the grid to set it to the largest possible value (no error will occur).

The value returned by the LeftCol and TopRow properties may correspond to partially visible rows or columns.

Use the LeftCol and TopRow properties to scroll using cells as units. Use the ScrollPosition property to scroll the grid using pixel units.

To ensure that a given cell is visible, use the ShowCell method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Tree Property

C1FlexGridBase.Tree Property

Gets a reference to the GridTree object that controls the appearance of the outline tree in the grid.

[Visual Basic]

Public ReadOnly Property Tree As GridTree

[C#]

public GridTree Tree {get;}

[Delphi]

public property Tree: GridTree read get_Tree;

Remarks

The C1FlexGrid can group data hierarchically and display it with a collapsible tree similar to the one in the Microsoft TreeView control. The GridTree object is used to specify the position and appearance of the outline tree.

For details on create outlines, see the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method and the Row property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase Methods

C1FlexGridBase Methods

The methods of the C1FlexGridBase class are listed here. For a complete list of C1FlexGridBase class members, see the C1FlexGridBase Members topic.

Public Methods

AddItem | Overloaded. Adds a row to the grid and populates the new row with data.
Aggregate | Overloaded. Calculates aggregate statistics for the current selection.
AutoSizeCol | Overloaded. Adjusts the width of a column to fit the data.
AutoSizeCols | Overloaded. Adjusts the width of all columns to fit the data.
AutoSizeRow | Adjusts the height of a row to fit the data.
AutoSizeRows | Overloaded. Adjusts the height of all rows to fit the data.
BeginInit | Signals the object that initialization is starting.
Clear | Overloaded. Clears the grid.
CreateImage | Overloaded. Creates an image of the entire grid.
EndInit | Signals the object that initialization is complete.
FindRow | Overloaded. Finds a row that contains a specified Row value.
FinishEditing | Overloaded. Finishes editing the current cell and takes the grid out of edit mode.
GetCellCheck | Gets the state of the checkbox in a grid cell.
GetCellImage | Gets the image displayed in a grid cell.
GetCellRange | Overloaded. Gets a CellRange object that can be used to format and manipulate a cell.
GetCellRect | Overloaded. Gets a System.Drawing.Rectangle object with the coordinates of the cell within the control.
GetCellStyle | Gets a custom CellStyle associated with a cell.
GetCellStyleDisplay | Gets the style used to render a cell.
GetData | Overloaded. Gets the value of a grid cell.
GetDataDisplay | Overloaded. Gets the value in a grid cell, formatted as a string.
GetUserData | Overloaded. Gets user data associated with a cell.
HitTest | Overloaded. Returns information about the control at the current mouse position.
Invalidate | Overloaded. Overriden. Invalidates a cell range, causing it to be repainted.
IsCellCursor | Gets a value that determines if a cell contains the grid cursor.
IsCellFixed | Gets a value that determines if a cell belongs to a fixed row or column.
IsCellHighlighted | Gets a value that determines if a cell is part of the selection and should be highlighted.
IsCellValid | Gets a value that determines if a pair of cell coordinates are valid.
LoadExcel | Overloaded. Loads the grid from the first worksheet in a Microsoft Excel (.xls) file.
LoadExcelSheetNames | Gets a list with the names of the worksheets in a Microsoft Excel (.xls) file.
LoadGrid | Overloaded. Loads the grid from a file.
PrintGrid | Overloaded. Prints the grid, optionally showing a page setup or print preview dialog.
ReadXml | Overloaded. Loads the grid from an Xml document.
RemoveItem | Overloaded. Removes the last row from the grid.
SaveExcel | Overloaded. Saves the grid contents to a Microsoft Excel (.xls) file.
SaveGrid | Overloaded. Saves the grid contents to a file.
Select | Overloaded. Selects a range of cells and scrolls it into view.
SetCellCheck | Sets the state of the checkbox in a grid cell.
SetCellImage | Sets the image displayed in a grid cell.
SetCellStyle | Overloaded. Assigns a custom CellStyle to a cell.
SetData | Overloaded. Assigns a value to a range of cells, coercing the value into each cell's specified DataType.
SetDataBinding | Overloaded. Sets the DataSource and DataMember properties.
SetUserData | Overloaded. Assigns user data to a cell.
ShowCell | Scrolls a cell into view.
ShowSortAt | Shows the sorting glyph on a column header.
Sort | Overloaded. Sorts a range of cells in the grid.
StartEditing | Overloaded. Puts the grid in edit mode and starts editing the current cell.
Subtotal | Overloaded. Groups rows based on cell contents and calculates aggregate values.
WriteXml | Overloaded. Saves the grid contents to an Xml document.

Protected Methods

BuildScrollableRectangle | Overriden. Builds a rectangle that defines the scrollable portion of the control for a given pair of scroll offsets.
CreateAccessibilityInstance | Overriden. Creates a new accessibility object for the control.
Dispose | Overloaded. Overriden. Releases all resources used by the Control.
DrawCell | Draws a grid cell.
DrawRow | Draws a grid row.
GetHeaderThemeState | Gets the state for a Windows Xp theme while the mouse moves over a cell.
IsInputChar | Overriden. Determines if a character is an input character that the control recognizes.
IsInputKey | Overriden. Determines whether the specified key is a regular input key or a special key that requires preprocessing.
OnBackColorChanged | Overriden. Raises the System.Windows.Forms.Control.BackColorChanged event.
OnBindingContextChanged | Overriden. Raises the System.Windows.Forms.Control.BindingContextChanged event.
OnDoubleClick | Overriden. Raises the System.Windows.Forms.Control.DoubleClick event.
OnDragDrop | Overriden. Raises the System.Windows.Forms.Control.DragDrop event.
OnDragEnter | Overriden. Raises the System.Windows.Forms.Control.DragEnter event.
OnDragOver | Overriden. Raises the System.Windows.Forms.Control.DragOver event.
OnFontChanged | Overriden. Raises the System.Windows.Forms.Control.FontChanged event.
OnForeColorChanged | Overriden. Raises the System.Windows.Forms.Control.ForeColorChanged event.
OnGotFocus | Overriden. Raises the System.Windows.Forms.Control.GotFocus event.
OnHandleDestroyed | Overriden. Raises the System.Windows.Forms.Control.HandleDestroyed event.
OnImeStartComposition (inherited from ScrollableControl) | Called when the control receives a WM_IME_STARTCOMPOSITION message.
OnKeyDown | Overriden. Raises the System.Windows.Forms.Control.KeyDown event.
OnKeyPress | Overriden. Raises the System.Windows.Forms.Control.KeyPress event.
OnLeave | Overriden. Raises the System.Windows.Forms.Control.Leave event.
OnLostFocus | Overriden. Raises the System.Windows.Forms.Control.LostFocus event.
OnMouseDown | Overriden. Raises the System.Windows.Forms.Control.MouseDown event.
OnMouseLeave | Overriden. Raises the System.Windows.Forms.Control.MouseLeave event.
OnMouseMove | Overriden. Raises the System.Windows.Forms.Control.MouseMove event.
OnMouseUp | Overriden. Raises the System.Windows.Forms.Control.MouseUp event.
OnPaint | Overriden. Raises the System.Windows.Forms.Control.Paint event.
OnPaintBackground | Overriden. Raises the System.Windows.Forms.Control.PaintBackground(System.Windows.Forms.PaintEventArgs,System.Drawing.Rectangle) event.
OnScroll | Overriden. Called when the grid contents scroll.
OnScrollTip | Overriden. Raises the BeforeScrollTip event.
OnSizeChanged | Overriden. Raises the System.Windows.Forms.Control.SizeChanged event.
OnThemeChanged | Overriden. Called when the control receives a WM_THEMECHANGED message.
OnValidating | Overriden. Raises the System.Windows.Forms.Control.Validating event.
OnVisibleChanged | Overriden. Raises the System.Windows.Forms.Control.VisibleChanged event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AddItem Method

C1FlexGridBase.AddItem Method

Overload List

Adds a row to the grid and populates the new row with data.

[Visual Basic] Overloads Public Function AddItem(Object()) As Row

[C#] public Row AddItem(object[]);

[Delphi] public function AddItem(array of Object) : Row; overload;

Adds a row to the grid and populates the new row with data.

[Visual Basic] Overloads Public Function AddItem(String) As Row

[C#] public Row AddItem(string);

[Delphi] public function AddItem(String) : Row; overload;

Adds a row to the grid at a specified position and populates the new row with data.

[Visual Basic] Overloads Public Function AddItem(String, Integer) As Row

[C#] public Row AddItem(string, int);

[Delphi] public function AddItem(String; Int32) : Row; overload;

Adds a row to the grid at a specified position and populates the new row with data.

[Visual Basic] Overloads Public Function AddItem(Object(), Integer, Integer) As Row

[C#] public Row AddItem(object[], int, int);

[Delphi] public function AddItem(array of Object; Int32; Int32) : Row; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AddItem Method (Object[])

C1FlexGridBase.AddItem Method (Object[])

Adds a row to the grid and populates the new row with data.

[Visual Basic]

Overloads Public Function AddItem( _

ByVal items As Object() _

) As Row

[C#]

public Row AddItem(

object[] items

);

[Delphi]

public function AddItem(

items: array of Object

): Row; overload;

Parameters

items

Array of objects that will be assigned to the new row.

Return Value

A reference to the new row.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AddItem Method (String)

C1FlexGridBase.AddItem Method (String)

Adds a row to the grid and populates the new row with data.

[Visual Basic]

Overloads Public Function AddItem( _

ByVal item As String _

) As Row

[C#]

public Row AddItem(

string item

);

[Delphi]

public function AddItem(

item: String

): Row; overload;

Parameters

item

String containing the data for the new row. Items are separated by tab characters by default. You can change the separator character using the ClipSeparators property.

Return Value

A reference to the new row.

Remarks

You can also add and remove rows using the Rows collection. The AddItem (String) method provides a concise syntax for creating the row, populating it with data, and then adding it to the grid.

Before using AddItem (String) to add a large number of rows to the grid, remember to set the Redraw property to False. When finished adding the rows, set Redraw back to its original value. This will significantly improve performance.

Example

The code bellows adds 300 rows to the grid.

// suspend painting to improve performance

bool redraw = flex.Redraw;

flex.Redraw = false;

// append 100 rows, using tabs as separators

flex.ClipSeparators = "\t\n";

for (int i = 0; i < 100; i++)

flex.AddItem("\tcol1\tcol2\tcol3");

// add 100 rows at the top, using pipes as separators

flex.ClipSeparators = "|;";

for (int i = 0; i < 100; i++)

flex.AddItem("|col1|col2|col3", 0);

// append 100 rows at the bottom, using an object array

object[] items = { "col1", "col2", "col3" };

for (int i = 0; i < 100; i++)

flex.AddItem(items, flex.Rows.Count, flex.Cols.Fixed);

// restore painting

flex.Redraw = redraw;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AddItem Method (String, Int32)

C1FlexGridBase.AddItem Method (String, Int32)

Adds a row to the grid at a specified position and populates the new row with data.

[Visual Basic]

Overloads Public Function AddItem( _

ByVal item As String, _

ByVal index As Integer _

) As Row

[C#]

public Row AddItem(

string item,

int index

);

[Delphi]

public function AddItem(

item: String;

index: Int32

): Row; overload;

Parameters

item

String containing the data for the new row. Items are separated by tab characters by default. You can change the separator character using the ClipSeparators property.

index

Position where the new row will be inserted.

Return Value

A reference to the new row.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AddItem Method (Object[], Int32, Int32)

C1FlexGridBase.AddItem Method (Object[], Int32, Int32)

Adds a row to the grid at a specified position and populates the new row with data.

[Visual Basic]

Overloads Public Function AddItem( _

ByVal items As Object(), _

ByVal rowIndex As Integer, _

ByVal colIndex As Integer _

) As Row

[C#]

public Row AddItem(

object[] items,

int rowIndex,

int colIndex

);

[Delphi]

public function AddItem(

items: array of Object;

rowIndex: Int32;

colIndex: Int32

): Row; overload;

Parameters

items

Array of objects that will be assigned to the new row.

rowIndex

Position where the new row will be inserted.

colIndex

First column to populate with the items in the items array. This parameter is usually set to the index of the first scrollable column.

Return Value

A reference to the new row.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Aggregate Method

C1FlexGridBase.Aggregate Method

Overload List

Calculates aggregate statistics for the current selection.

[Visual Basic] Overloads Public Function Aggregate(AggregateEnum) As Double

[C#] public Double Aggregate(AggregateEnum);

[Delphi] public function Aggregate(AggregateEnum) : Double; overload;

Calculates aggregate statistics for the current selection.

[Visual Basic] Overloads Public Function Aggregate(AggregateEnum, AggregateFlags) As Double

[C#] public Double Aggregate(AggregateEnum, AggregateFlags);

[Delphi] public function Aggregate(AggregateEnum; AggregateFlags) : Double; overload;

Calculates aggregate statistics for a range.

[Visual Basic] Overloads Public Function Aggregate(AggregateEnum, CellRange) As Double

[C#] public Double Aggregate(AggregateEnum, CellRange);

[Delphi] public function Aggregate(AggregateEnum; CellRange) : Double; overload;

Calculates aggregate statistics for a range.

[Visual Basic] Overloads Public Function Aggregate(AggregateEnum, CellRange, AggregateFlags) As Double

[C#] public Double Aggregate(AggregateEnum, CellRange, AggregateFlags);

[Delphi] public function Aggregate(AggregateEnum; CellRange; AggregateFlags) : Double; overload;

Calculates aggregate statistics for a range.

[Visual Basic] Overloads Public Function Aggregate(AggregateEnum, Integer, Integer, Integer, Integer) As Double

[C#] public Double Aggregate(AggregateEnum, int, int, int, int);

[Delphi] public function Aggregate(AggregateEnum; Int32; Int32; Int32; Int32) : Double; overload;

Calculates aggregate statistics for a range.

[Visual Basic] Overloads Public Function Aggregate(AggregateEnum, Integer, Integer, Integer, Integer, AggregateFlags) As Double

[C#] public Double Aggregate(AggregateEnum, int, int, int, int, AggregateFlags);

[Delphi] public function Aggregate(AggregateEnum; Int32; Int32; Int32; Int32; AggregateFlags) : Double; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Aggregate Method (AggregateEnum)

C1FlexGridBase.Aggregate Method (AggregateEnum)

Calculates aggregate statistics for the current selection.

[Visual Basic]

Overloads Public Function Aggregate( _

ByVal aggType As AggregateEnum _

) As Double

[C#]

public Double Aggregate(

AggregateEnum aggType

);

[Delphi]

public function Aggregate(

aggType: AggregateEnum

): Double; overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

Return Value

A System.Double that represents the aggregate value.

Example

The code below Aggregate (AggregateEnum, CellRange, AggregateFlags) method to calculate aggregate statistics for the current selection. Whenever the selection changes, new aggregates are calculated and written to the console.

private void flex_SelChange(object sender, System.EventArgs e)

{

string fmt = "Count {0:0}, Sum {1:#,##0.00}, " +

"Avg {2:#,##0.00}, Stdev {3:#,##0.00}";

Console.WriteLine(fmt,

flex.Aggregate(AggregateEnum.Count),

flex.Aggregate(AggregateEnum.Sum),

flex.Aggregate(AggregateEnum.Average),

flex.Aggregate(AggregateEnum.Std));

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Aggregate Method (AggregateEnum, AggregateFlags)

C1FlexGridBase.Aggregate Method (AggregateEnum, AggregateFlags)

Calculates aggregate statistics for the current selection.

[Visual Basic]

Overloads Public Function Aggregate( _

ByVal aggType As AggregateEnum, _

ByVal flags As AggregateFlags _

) As Double

[C#]

public Double Aggregate(

AggregateEnum aggType,

AggregateFlags flags

);

[Delphi]

public function Aggregate(

aggType: AggregateEnum;

flags: AggregateFlags

): Double; overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

flags

AggregateFlags value that specifies aggregation options.

Return Value

A System.Double that represents the aggregate value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Aggregate Method (AggregateEnum, CellRange)

C1FlexGridBase.Aggregate Method (AggregateEnum, CellRange)

Calculates aggregate statistics for a range.

[Visual Basic]

Overloads Public Function Aggregate( _

ByVal aggType As AggregateEnum, _

ByVal rg As CellRange _

) As Double

[C#]

public Double Aggregate(

AggregateEnum aggType,

CellRange rg

);

[Delphi]

public function Aggregate(

aggType: AggregateEnum;

rg: CellRange

): Double; overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

rg

CellRange object that contains the values to be aggregated.

Return Value

A System.Double that represents the aggregate value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Aggregate Method (AggregateEnum, CellRange, AggregateFlags)

C1FlexGridBase.Aggregate Method (AggregateEnum, CellRange, AggregateFlags)

Calculates aggregate statistics for a range.

[Visual Basic]

Overloads Public Function Aggregate( _

ByVal aggType As AggregateEnum, _

ByVal rg As CellRange, _

ByVal flags As AggregateFlags _

) As Double

[C#]

public Double Aggregate(

AggregateEnum aggType,

CellRange rg,

AggregateFlags flags

);

[Delphi]

public function Aggregate(

aggType: AggregateEnum;

rg: CellRange;

flags: AggregateFlags

): Double; overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

rg

CellRange object that contains the values to be aggregated.

flags

AggregateFlags value that specifies aggregation options.

Return Value

A System.Double that represents the aggregate value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Aggregate Method (AggregateEnum, Int32, Int32, Int32, Int32)

C1FlexGridBase.Aggregate Method (AggregateEnum, Int32, Int32, Int32, Int32)

Calculates aggregate statistics for a range.

[Visual Basic]

Overloads Public Function Aggregate( _

ByVal aggType As AggregateEnum, _

ByVal topRow As Integer, _

ByVal leftCol As Integer, _

ByVal bottomRow As Integer, _

ByVal rightCol As Integer _

) As Double

[C#]

public Double Aggregate(

AggregateEnum aggType,

int topRow,

int leftCol,

int bottomRow,

int rightCol

);

[Delphi]

public function Aggregate(

aggType: AggregateEnum;

topRow: Int32;

leftCol: Int32;

bottomRow: Int32;

rightCol: Int32

): Double; overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

topRow

Top row in the range.

leftCol

Left column in the range.

bottomRow

Bottom row in the range.

rightCol

Right column in the range.

Return Value

A System.Double that represents the aggregate value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Aggregate Method (AggregateEnum, Int32, Int32, Int32, Int32, AggregateFlags)

C1FlexGridBase.Aggregate Method (AggregateEnum, Int32, Int32, Int32, Int32, AggregateFlags)

Calculates aggregate statistics for a range.

[Visual Basic]

Overloads Public Function Aggregate( _

ByVal aggType As AggregateEnum, _

ByVal topRow As Integer, _

ByVal leftCol As Integer, _

ByVal bottomRow As Integer, _

ByVal rightCol As Integer, _

ByVal flags As AggregateFlags _

) As Double

[C#]

public Double Aggregate(

AggregateEnum aggType,

int topRow,

int leftCol,

int bottomRow,

int rightCol,

AggregateFlags flags

);

[Delphi]

public function Aggregate(

aggType: AggregateEnum;

topRow: Int32;

leftCol: Int32;

bottomRow: Int32;

rightCol: Int32;

flags: AggregateFlags

): Double; overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

topRow

Top row in the range.

leftCol

Left column in the range.

bottomRow

Bottom row in the range.

rightCol

Right column in the range.

flags

AggregateFlags value that specifies aggregation options.

Return Value

A System.Double that represents the aggregate value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeCol Method

C1FlexGridBase.AutoSizeCol Method

Overload List

Adjusts the width of a column to fit the data.

[Visual Basic] Overloads Overridable Public Sub AutoSizeCol(Integer)

[C#] virtual public AutoSizeCol(int);

[Delphi] public procedure AutoSizeCol(Int32); overload; virtual;

Adjusts the width of a column to fit the data.

[Visual Basic] Overloads Overridable Public Sub AutoSizeCol(Integer, Integer)

[C#] virtual public AutoSizeCol(int, int);

[Delphi] public procedure AutoSizeCol(Int32; Int32); overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeCol Method (Int32)

C1FlexGridBase.AutoSizeCol Method (Int32)

Adjusts the width of a column to fit the data.

[Visual Basic]

Overloads Overridable Public Sub AutoSizeCol( _

ByVal col As Integer _

)

[C#]

virtual public void AutoSizeCol(

int col

);

[Delphi]

public procedure AutoSizeCol(

col: Int32

); overload; virtual;

Parameters

col

Column index.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeCol Method (Int32, Int32)

C1FlexGridBase.AutoSizeCol Method (Int32, Int32)

Adjusts the width of a column to fit the data.

[Visual Basic]

Overloads Overridable Public Sub AutoSizeCol( _

ByVal col As Integer, _

ByVal extraSpace As Integer _

)

[C#]

virtual public void AutoSizeCol(

int col,

int extraSpace

);

[Delphi]

public procedure AutoSizeCol(

col: Int32;

extraSpace: Int32

); overload; virtual;

Parameters

col

Column index.

extraSpace

Amount of extra space, in pixels, to add to the column widths.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeCols Method

C1FlexGridBase.AutoSizeCols Method

Overload List

Adjusts the width of all columns to fit the data.

[Visual Basic] Overloads Overridable Public Sub AutoSizeCols()

[C#] virtual public AutoSizeCols();

[Delphi] public procedure AutoSizeCols(); overload; virtual;

Adjusts the width of all columns fit the data.

[Visual Basic] Overloads Overridable Public Sub AutoSizeCols(Integer)

[C#] virtual public AutoSizeCols(int);

[Delphi] public procedure AutoSizeCols(Int32); overload; virtual;

Adjusts the width of columns in a range to fit the data.

[Visual Basic] Overloads Overridable Public Sub AutoSizeCols(Integer, Integer, Integer)

[C#] virtual public AutoSizeCols(int, int, int);

[Delphi] public procedure AutoSizeCols(Int32; Int32; Int32); overload; virtual;

Adjusts the width of a column range to fit the data in a cell range.

[Visual Basic] Overloads Overridable Public Sub AutoSizeCols(Integer, Integer, Integer, Integer, Integer, AutoSizeFlags)

[C#] virtual public AutoSizeCols(int, int, int, int, int, AutoSizeFlags);

[Delphi] public procedure AutoSizeCols(Int32; Int32; Int32; Int32; Int32; AutoSizeFlags); overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeCols Method ()

C1FlexGridBase.AutoSizeCols Method ()

Adjusts the width of all columns to fit the data.

[Visual Basic]

Overloads Overridable Public Sub AutoSizeCols()

[C#]

virtual public void AutoSizeCols()

[Delphi]

public procedure AutoSizeCols(); overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeCols Method (Int32)

C1FlexGridBase.AutoSizeCols Method (Int32)

Adjusts the width of all columns fit the data.

[Visual Basic]

Overloads Overridable Public Sub AutoSizeCols( _

ByVal extraSpace As Integer _

)

[C#]

virtual public void AutoSizeCols(

int extraSpace

);

[Delphi]

public procedure AutoSizeCols(

extraSpace: Int32

); overload; virtual;

Parameters

extraSpace

Amount of extra space, in pixels, to add to the column widths.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeCols Method (Int32, Int32, Int32)

C1FlexGridBase.AutoSizeCols Method (Int32, Int32, Int32)

Adjusts the width of columns in a range to fit the data.

[Visual Basic]

Overloads Overridable Public Sub AutoSizeCols( _

ByVal leftCol As Integer, _

ByVal rightCol As Integer, _

ByVal extraSpace As Integer _

)

[C#]

virtual public void AutoSizeCols(

int leftCol,

int rightCol,

int extraSpace

);

[Delphi]

public procedure AutoSizeCols(

leftCol: Int32;

rightCol: Int32;

extraSpace: Int32

); overload; virtual;

Parameters

leftCol

Left column in the range.

rightCol

Right column in the range.

extraSpace

Amount of extra space, in pixels, to add to the column widths.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeCols Method (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags)

C1FlexGridBase.AutoSizeCols Method (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags)

Adjusts the width of a column range to fit the data in a cell range.

[Visual Basic]

Overloads Overridable Public Sub AutoSizeCols( _

ByVal topRow As Integer, _

ByVal leftCol As Integer, _

ByVal bottomRow As Integer, _

ByVal rightCol As Integer, _

ByVal extraSpace As Integer, _

ByVal flags As AutoSizeFlags _

)

[C#]

virtual public void AutoSizeCols(

int topRow,

int leftCol,

int bottomRow,

int rightCol,

int extraSpace,

AutoSizeFlags flags

);

[Delphi]

public procedure AutoSizeCols(

topRow: Int32;

leftCol: Int32;

bottomRow: Int32;

rightCol: Int32;

extraSpace: Int32;

flags: AutoSizeFlags

); overload; virtual;

Parameters

topRow

Top row in the range.

leftCol

Left column in the range.

bottomRow

Bottom row in the range.

rightCol

Right column in the range.

extraSpace

Amount of extra space, in pixels, to add to the column widths.

flags

Flags that control autosizing options.

Remarks

By default, the AutoSizeCols (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags) method measures every cell in each column, taking into account the cell contents and style.

If the grid has a large number of rows, you can improve performance by using the topRow and bottomRow parameters to specify a row range. You can include only a few hundred rows in the process, and add some extra spacing for safety.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeRow Method

C1FlexGridBase.AutoSizeRow Method

Adjusts the height of a row to fit the data.

[Visual Basic]

Overridable Public Sub AutoSizeRow( _

ByVal row As Integer _

)

[C#]

virtual public void AutoSizeRow(

int row

);

[Delphi]

public procedure AutoSizeRow(

row: Int32

); virtual;

Parameters

row

Row index.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeRows Method

C1FlexGridBase.AutoSizeRows Method

Overload List

Adjusts the height of all rows to fit the data.

[Visual Basic] Overloads Overridable Public Sub AutoSizeRows()

[C#] virtual public AutoSizeRows();

[Delphi] public procedure AutoSizeRows(); overload; virtual;

Adjusts the height of a row range to fit the data in a cell range.

[Visual Basic] Overloads Overridable Public Sub AutoSizeRows(Integer, Integer, Integer, Integer, Integer, AutoSizeFlags)

[C#] virtual public AutoSizeRows(int, int, int, int, int, AutoSizeFlags);

[Delphi] public procedure AutoSizeRows(Int32; Int32; Int32; Int32; Int32; AutoSizeFlags); overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeRows Method ()

C1FlexGridBase.AutoSizeRows Method ()

Adjusts the height of all rows to fit the data.

[Visual Basic]

Overloads Overridable Public Sub AutoSizeRows()

[C#]

virtual public void AutoSizeRows()

[Delphi]

public procedure AutoSizeRows(); overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AutoSizeRows Method (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags)

C1FlexGridBase.AutoSizeRows Method (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags)

Adjusts the height of a row range to fit the data in a cell range.

[Visual Basic]

Overloads Overridable Public Sub AutoSizeRows( _

ByVal topRow As Integer, _

ByVal leftCol As Integer, _

ByVal bottomRow As Integer, _

ByVal rightCol As Integer, _

ByVal extraSpace As Integer, _

ByVal flags As AutoSizeFlags _

)

[C#]

virtual public void AutoSizeRows(

int topRow,

int leftCol,

int bottomRow,

int rightCol,

int extraSpace,

AutoSizeFlags flags

);

[Delphi]

public procedure AutoSizeRows(

topRow: Int32;

leftCol: Int32;

bottomRow: Int32;

rightCol: Int32;

extraSpace: Int32;

flags: AutoSizeFlags

); overload; virtual;

Parameters

topRow

Top row in the range.

leftCol

Left column in the range.

bottomRow

Bottom row in the range.

rightCol

Right column in the range.

extraSpace

Amount of extra space, in pixels, to add to the column widths.

flags

Flags that control autosizing options.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeginInit Method

C1FlexGridBase.BeginInit Method

Signals the object that initialization is starting.

[Visual Basic]

Overridable Public Sub BeginInit() Implements ISupportInitialize.BeginInit

[C#]

virtual public void BeginInit()

[Delphi]

public procedure BeginInit(); virtual;

Implements

ISupportInitialize.BeginInit

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BuildScrollableRectangle Method

C1FlexGridBase.BuildScrollableRectangle Method

Builds a rectangle that defines the scrollable portion of the control for a given pair of scroll offsets.

[Visual Basic]

Overrides Protected Function BuildScrollableRectangle( _

ByVal dx As Integer, _

ByVal dy As Integer _

) As Rectangle

[C#]

override protected Rectangle BuildScrollableRectangle(

int dx,

int dy

);

[Delphi]

strict protected function BuildScrollableRectangle(

dx: Int32;

dy: Int32

): Rectangle; override;

Parameters

dx

Horizontal scroll offset.

dy

Vertical scroll offset.

Return Value

A System.Drawing.Rectangle that defines the scrollable portion of the control.

Remarks

This method is for internal use. It allows derived classes to customize the control scrolling behavior.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Clear Method

C1FlexGridBase.Clear Method

Overload List

Clears the grid.

[Visual Basic] Overloads Public Sub Clear()

[C#] public Clear();

[Delphi] public procedure Clear(); overload;

Clears the grid.

[Visual Basic] Overloads Public Sub Clear(ClearFlags)

[C#] public Clear(ClearFlags);

[Delphi] public procedure Clear(ClearFlags); overload;

Clears a range.

[Visual Basic] Overloads Public Sub Clear(ClearFlags, CellRange)

[C#] public Clear(ClearFlags, CellRange);

[Delphi] public procedure Clear(ClearFlags; CellRange); overload;

Clears a cell.

[Visual Basic] Overloads Public Sub Clear(ClearFlags, Integer, Integer)

[C#] public Clear(ClearFlags, int, int);

[Delphi] public procedure Clear(ClearFlags; Int32; Int32); overload;

Clears a range.

[Visual Basic] Overloads Public Sub Clear(ClearFlags, Integer, Integer, Integer, Integer)

[C#] public Clear(ClearFlags, int, int, int, int);

[Delphi] public procedure Clear(ClearFlags; Int32; Int32; Int32; Int32); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Clear Method ()

C1FlexGridBase.Clear Method ()

Clears the grid.

[Visual Basic]

Overloads Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear(); overload;

Remarks

This method removes all data, styles, and user data from all cells, rows, and columns on the grid.

The Clear (ClearFlags, CellRange) method does not affect the number of rows and columns on the grid, and cannot be used to clear data when the grid is bound to a data source.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Clear Method (ClearFlags)

C1FlexGridBase.Clear Method (ClearFlags)

Clears the grid.

[Visual Basic]

Overloads Public Sub Clear( _

ByVal clearFlags As ClearFlags _

)

[C#]

public void Clear(

ClearFlags clearFlags

);

[Delphi]

public procedure Clear(

clearFlags: ClearFlags

); overload;

Parameters

clearFlags

ClearFlags value that specifies the elements to clear.

Remarks

The Clear (ClearFlags, CellRange) method does not affect the number of rows and columns on the grid, and cannot be used to clear data when the grid is bound to a data source.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Clear Method (ClearFlags, CellRange)

C1FlexGridBase.Clear Method (ClearFlags, CellRange)

Clears a range.

[Visual Basic]

Overloads Public Sub Clear( _

ByVal clearFlags As ClearFlags, _

ByVal rg As CellRange _

)

[C#]

public void Clear(

ClearFlags clearFlags,

CellRange rg

);

[Delphi]

public procedure Clear(

clearFlags: ClearFlags;

rg: CellRange

); overload;

Parameters

clearFlags

ClearFlags value that specifies the elements to clear.

rg

Range to clear.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Clear Method (ClearFlags, Int32, Int32)

C1FlexGridBase.Clear Method (ClearFlags, Int32, Int32)

Clears a cell.

[Visual Basic]

Overloads Public Sub Clear( _

ByVal clearFlags As ClearFlags, _

ByVal row As Integer, _

ByVal col As Integer _

)

[C#]

public void Clear(

ClearFlags clearFlags,

int row,

int col

);

[Delphi]

public procedure Clear(

clearFlags: ClearFlags;

row: Int32;

col: Int32

); overload;

Parameters

clearFlags

ClearFlags value that specifies the elements to clear.

row

Row index.

col

Column index.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Clear Method (ClearFlags, Int32, Int32, Int32, Int32)

C1FlexGridBase.Clear Method (ClearFlags, Int32, Int32, Int32, Int32)

Clears a range.

[Visual Basic]

Overloads Public Sub Clear( _

ByVal clearFlags As ClearFlags, _

ByVal topRow As Integer, _

ByVal leftCol As Integer, _

ByVal bottomRow As Integer, _

ByVal rightCol As Integer _

)

[C#]

public void Clear(

ClearFlags clearFlags,

int topRow,

int leftCol,

int bottomRow,

int rightCol

);

[Delphi]

public procedure Clear(

clearFlags: ClearFlags;

topRow: Int32;

leftCol: Int32;

bottomRow: Int32;

rightCol: Int32

); overload;

Parameters

clearFlags

ClearFlags value that specifies the elements to clear.

topRow

Top row in the range.

leftCol

Left column in the range.

bottomRow

Bottom row in the range.

rightCol

Right column in the range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CreateAccessibilityInstance Method

C1FlexGridBase.CreateAccessibilityInstance Method

Creates a new accessibility object for the control.

[Visual Basic]

Overrides Protected Function CreateAccessibilityInstance() As AccessibleObject

[C#]

override protected AccessibleObject CreateAccessibilityInstance()

[Delphi]

strict protected function CreateAccessibilityInstance(): AccessibleObject; override;

Return Value

A new System.Windows.Forms.AccessibleObject for the control.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CreateImage Method

C1FlexGridBase.CreateImage Method

Overload List

Creates an image of the entire grid.

[Visual Basic] Overloads Public Function CreateImage() As Image

[C#] public Image CreateImage();

[Delphi] public function CreateImage() : Image; overload;

Creates an image of a portion of the grid.

[Visual Basic] Overloads Public Function CreateImage(CellRange) As Image

[C#] public Image CreateImage(CellRange);

[Delphi] public function CreateImage(CellRange) : Image; overload;

Creates an image of a portion of the grid.

[Visual Basic] Overloads Public Function CreateImage(CellRange, EmfType) As Image

[C#] public Image CreateImage(CellRange, EmfType);

[Delphi] public function CreateImage(CellRange; EmfType) : Image; overload;

Creates an image of a portion of the grid.

[Visual Basic] Overloads Public Function CreateImage(Integer, Integer, Integer, Integer) As Image

[C#] public Image CreateImage(int, int, int, int);

[Delphi] public function CreateImage(Int32; Int32; Int32; Int32) : Image; overload;

Creates an image of a portion of the grid.

[Visual Basic] Overloads Public Function CreateImage(Integer, Integer, Integer, Integer, EmfType) As Image

[C#] public Image CreateImage(int, int, int, int, EmfType);

[Delphi] public function CreateImage(Int32; Int32; Int32; Int32; EmfType) : Image; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CreateImage Method ()

C1FlexGridBase.CreateImage Method ()

Creates an image of the entire grid.

[Visual Basic]

Overloads Public Function CreateImage() As Image

[C#]

public Image CreateImage()

[Delphi]

public function CreateImage(): Image; overload;

Return Value

An System.Drawing.Image object containing a metafile image of the grid.

Remarks

Use this method to copy grid images to the clipboard so you can paste them into documents or other applications.

Example

The code below creates an image of a grid range and saves it to a Png file that can be included in other documents such as web pages:

Image img = flex.CreateImage(0,0,10,5);

img.Save(@"c:\temp\grid.png", System.Drawing.Imaging.ImageFormat.Png);

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CreateImage Method (CellRange)

C1FlexGridBase.CreateImage Method (CellRange)

Creates an image of a portion of the grid.

[Visual Basic]

Overloads Public Function CreateImage( _

ByVal rg As CellRange _

) As Image

[C#]

public Image CreateImage(

CellRange rg

);

[Delphi]

public function CreateImage(

rg: CellRange

): Image; overload;

Parameters

rg

CellRange that specifies which cells should be included in the image.

Return Value

An System.Drawing.Image object containing a metafile image of the grid.

Remarks

The image returned includes any fixed and frozen cells in addition to the specified range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CreateImage Method (CellRange, EmfType)

C1FlexGridBase.CreateImage Method (CellRange, EmfType)

Creates an image of a portion of the grid.

[Visual Basic]

Overloads Public Function CreateImage( _

ByVal rg As CellRange, _

ByVal emfType As EmfType _

) As Image

[C#]

public Image CreateImage(

CellRange rg,

EmfType emfType

);

[Delphi]

public function CreateImage(

rg: CellRange;

emfType: EmfType

): Image; overload;

Parameters

rg

CellRange that specifies which cells should be included in the image.

emfType

System.Drawing.Imaging.EmfType value that determines the type of metafile to create.

Return Value

An System.Drawing.Image object containing a metafile image of the grid.

Remarks

The image returned includes any fixed and frozen cells in addition to the specified range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CreateImage Method (Int32, Int32, Int32, Int32)

C1FlexGridBase.CreateImage Method (Int32, Int32, Int32, Int32)

Creates an image of a portion of the grid.

[Visual Basic]

Overloads Public Function CreateImage( _

ByVal topRow As Integer, _

ByVal leftCol As Integer, _

ByVal bottomRow As Integer, _

ByVal rightCol As Integer _

) As Image

[C#]

public Image CreateImage(

int topRow,

int leftCol,

int bottomRow,

int rightCol

);

[Delphi]

public function CreateImage(

topRow: Int32;

leftCol: Int32;

bottomRow: Int32;

rightCol: Int32

): Image; overload;

Parameters

topRow

Top row in the range.

leftCol

Left column in the range.

bottomRow

Bottom row in the range.

rightCol

Right column in the range.

Return Value

An System.Drawing.Image object containing a metafile image of the grid.

Remarks

The image returned includes any fixed and frozen cells in addition to the specified range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CreateImage Method (Int32, Int32, Int32, Int32, EmfType)

C1FlexGridBase.CreateImage Method (Int32, Int32, Int32, Int32, EmfType)

Creates an image of a portion of the grid.

[Visual Basic]

Overloads Public Function CreateImage( _

ByVal topRow As Integer, _

ByVal leftCol As Integer, _

ByVal bottomRow As Integer, _

ByVal rightCol As Integer, _

ByVal emfType As EmfType _

) As Image

[C#]

public Image CreateImage(

int topRow,

int leftCol,

int bottomRow,

int rightCol,

EmfType emfType

);

[Delphi]

public function CreateImage(

topRow: Int32;

leftCol: Int32;

bottomRow: Int32;

rightCol: Int32;

emfType: EmfType

): Image; overload;

Parameters

topRow

Top row in the range.

leftCol

Left column in the range.

bottomRow

Bottom row in the range.

rightCol

Right column in the range.

emfType

System.Drawing.Imaging.EmfType value that determines the type of metafile to create.

Return Value

An System.Drawing.Image object containing a metafile image of the grid.

Remarks

The image returned includes any fixed and frozen cells in addition to the specified range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Dispose Method

C1FlexGridBase.Dispose Method

Releases all resources used by the Control.

[Visual Basic]

Overrides Protected Sub Dispose( _

ByVal disposing As Boolean _

)

[C#]

override protected void Dispose(

bool disposing

);

[Delphi]

strict protected procedure Dispose(

disposing: Boolean

); overload; override;

Parameters

disposing

True to release both managed and unmanaged resources; False to release only unmanaged resources.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.DrawCell Method

C1FlexGridBase.DrawCell Method

Draws a grid cell.

[Visual Basic]

Overridable Protected Function DrawCell( _

ByVal e As PaintEventArgs, _

ByVal row As Integer, _

ByVal col As Integer _

) As Integer

[C#]

virtual protected int DrawCell(

PaintEventArgs e,

int row,

int col

);

[Delphi]

strict protected function DrawCell(

e: PaintEventArgs;

row: Int32;

col: Int32

): Int32; virtual;

Parameters

e

A System.Windows.Forms.PaintEventArgs that contains a System.Drawing.Graphics object where the cell will be drawn.

row

Index of the cell's row.

col

Index of the cell's column.

Return Value

The index of the last column painted (may be greater than col if columns are merged).

Remarks

This method is for internal use. It allows inherited classes to customize the grid appearance.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.DrawRow Method

C1FlexGridBase.DrawRow Method

Draws a grid row.

[Visual Basic]

Overridable Protected Sub DrawRow( _

ByVal e As PaintEventArgs, _

ByVal row As Integer _

)

[C#]

virtual protected void DrawRow(

PaintEventArgs e,

int row

);

[Delphi]

strict protected procedure DrawRow(

e: PaintEventArgs;

row: Int32

); virtual;

Parameters

e

A System.Windows.Forms.PaintEventArgs that contains a System.Drawing.Graphics object where the row will be drawn.

row

Index of the row to draw.

Remarks

This method is for internal use. It allows inherited classes to customize the grid appearance.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.EndInit Method

C1FlexGridBase.EndInit Method

Signals the object that initialization is complete.

[Visual Basic]

Overridable Public Sub EndInit() Implements ISupportInitialize.EndInit

[C#]

virtual public void EndInit()

[Delphi]

public procedure EndInit(); virtual;

Implements

ISupportInitialize.EndInit

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.FindRow Method

C1FlexGridBase.FindRow Method

Overload List

Finds a row that contains a specified Row value.

[Visual Basic] Overloads Overridable Public Function FindRow(Object, Integer, Integer, Boolean) As Integer

[C#] virtual public int FindRow(object, int, int, bool);

[Delphi] public function FindRow(Object; Int32; Int32; Boolean) : Int32; overload; virtual;

Finds a row that contains a specified string.

[Visual Basic] Overloads Overridable Public Function FindRow(String, Integer, Integer, Boolean, Boolean, Boolean) As Integer

[C#] virtual public int FindRow(string, int, int, bool, bool, bool);

[Delphi] public function FindRow(String; Int32; Int32; Boolean; Boolean; Boolean) : Int32; overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.FindRow Method (Object, Int32, Int32, Boolean)

C1FlexGridBase.FindRow Method (Object, Int32, Int32, Boolean)

Finds a row that contains a specified Row value.

[Visual Basic]

Overloads Overridable Public Function FindRow( _

ByVal objFind As Object, _

ByVal rowStart As Integer, _

ByVal col As Integer, _

ByVal wrap As Boolean _

) As Integer

[C#]

virtual public int FindRow(

object objFind,

int rowStart,

int col,

bool wrap

);

[Delphi]

public function FindRow(

objFind: Object;

rowStart: Int32;

col: Int32;

wrap: Boolean

): Int32; overload; virtual;

Parameters

objFind

Object to look for.

rowStart

Index of the row where the search should start.

col

Column that contains the objects to be searched.

wrap

Whether the search should stop at the bottom of the grid or wrap around and restart from the first scrollable row.

Return Value

The index of the row that contains the data, or ・ if the data is not found.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.FindRow Method (String, Int32, Int32, Boolean, Boolean, Boolean)

C1FlexGridBase.FindRow Method (String, Int32, Int32, Boolean, Boolean, Boolean)

Finds a row that contains a specified string.

[Visual Basic]

Overloads Overridable Public Function FindRow( _

ByVal strFind As String, _

ByVal rowStart As Integer, _

ByVal col As Integer, _

ByVal caseSensitive As Boolean, _

ByVal fullMatch As Boolean, _

ByVal wrap As Boolean _

) As Integer

[C#]

virtual public int FindRow(

string strFind,

int rowStart,

int col,

bool caseSensitive,

bool fullMatch,

bool wrap

);

[Delphi]

public function FindRow(

strFind: String;

rowStart: Int32;

col: Int32;

caseSensitive: Boolean;

fullMatch: Boolean;

wrap: Boolean

): Int32; overload; virtual;

Parameters

strFind

String to look for.

rowStart

Index of the row where the search should start.

col

Column that contains the data to be searched.

caseSensitive

Whether the search should be case-sensitive.

fullMatch

Whether a full match is required. If this parameter is set to False, searching for "John" may return a row that contains "Johnson".

wrap

Whether the search should stop at the bottom of the grid or wrap around and restart from the first scrollable row.

Return Value

The index of the row that contains the string, or ・ if the string is not found.

Remarks

To allow users to search for data as they type, use the AutoSearch property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.FinishEditing Method

C1FlexGridBase.FinishEditing Method

Overload List

Finishes editing the current cell and takes the grid out of edit mode.

[Visual Basic] Overloads Public Function FinishEditing() As Boolean

[C#] public bool FinishEditing();

[Delphi] public function FinishEditing() : Boolean; overload;

Finishes editing the current cell and takes the grid out of edit mode, optionally canceling the edits.

[Visual Basic] Overloads Public Function FinishEditing(Boolean) As Boolean

[C#] public bool FinishEditing(bool);

[Delphi] public function FinishEditing(Boolean) : Boolean; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.FinishEditing Method ()

C1FlexGridBase.FinishEditing Method ()

Finishes editing the current cell and takes the grid out of edit mode.

[Visual Basic]

Overloads Public Function FinishEditing() As Boolean

[C#]

public bool FinishEditing()

[Delphi]

public function FinishEditing(): Boolean; overload;

Return Value

True if the grid left edit mode successfully, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.FinishEditing Method (Boolean)

C1FlexGridBase.FinishEditing Method (Boolean)

Finishes editing the current cell and takes the grid out of edit mode, optionally canceling the edits.

[Visual Basic]

Overloads Public Function FinishEditing( _

ByVal cancel As Boolean _

) As Boolean

[C#]

public bool FinishEditing(

bool cancel

);

[Delphi]

public function FinishEditing(

cancel: Boolean

): Boolean; overload;

Parameters

cancel

Whether to cancel the current edits and revert the cell to its original value.

Return Value

True if the grid left edit mode successfully, False otherwise.

Remarks

If the cancel parameter is set to False, the grid tries to apply the edits, and fires the ValidateEdit, LeaveEdit, and AfterEdit events as usual. If validation fails, the grid stays in edit mode (and FinishEditing returns False).

If the cancel parameter is set to True, the original cell value is restored and the grid is guaranteed to leave the edit mode. In this case, only the LeaveEdit event fires.

To determine whether the grid is in edit mode, check whether the Editor property is Null.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellCheck Method

C1FlexGridBase.GetCellCheck Method

Gets the state of the checkbox in a grid cell.

[Visual Basic]

Overridable Public Function GetCellCheck( _

ByVal row As Integer, _

ByVal col As Integer _

) As CheckEnum

[C#]

virtual public CheckEnum GetCellCheck(

int row,

int col

);

[Delphi]

public function GetCellCheck(

row: Int32;

col: Int32

): CheckEnum; virtual;

Parameters

row

Row index.

col

Column index.

Return Value

One of the values in the CheckEnum enumeration.

Remarks

By default, the grid displays values in boolean columns as checkboxes (the column's data type determined by the DataType property). If you don't want boolean values displayed as checkboxes, set the column's Format property to a string containing the values that should be displayed for True and False values, separated by a semi-colon. For example:

flex.Cols["checkBoxes"].DataType = typeof(bool);

flex.Cols["yesNo"].DataType = typeof(bool);

flex.Cols["yesNo"].Format := "Yes;No";

In unbound mode, you can use the GetCellCheck and SetCellCheck methods to add checkboxes to any cells. The checkboxes will be displayed along with any text in the cell, and you can set their position using the column's ImageAlign property.

There are two types of check boxes: boolean and tri-state. Boolean check boxes toggle between the CheckEnum.Checked and CheckEnum.Unchecked states. Tri-state check boxes cycle through the settings CheckEnum.TSChecked, CheckEnum.TSUnchecked, and CheckEnum.TSGrayed.

For example, the code below creates a boolean checkbox in cell (3,3) and a tri-state checkbox in cell (4,3):

flex.SetCellCheck(3, 3, CheckEnum.Unchecked) // boolean;

flex.SetCellCheck(4, 3, CheckEnum.TSUnchecked) // tri-state;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellImage Method

C1FlexGridBase.GetCellImage Method

Gets the image displayed in a grid cell.

[Visual Basic]

Public Function GetCellImage( _

ByVal row As Integer, _

ByVal col As Integer _

) As Image

[C#]

public Image GetCellImage(

int row,

int col

);

[Delphi]

public function GetCellImage(

row: Int32;

col: Int32

): Image;

Parameters

row

Row index.

col

Column index.

Return Value

An System.Drawing.Image object previously assigned to the cell using the SetCellImage method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellRange Method

C1FlexGridBase.GetCellRange Method

Overload List

Gets a CellRange object that can be used to format and manipulate a cell.

[Visual Basic] Overloads Public Function GetCellRange(Integer, Integer) As CellRange

[C#] public CellRange GetCellRange(int, int);

[Delphi] public function GetCellRange(Int32; Int32) : CellRange; overload;

Gets a CellRange object that can be used to format and manipulate a range.

[Visual Basic] Overloads Public Function GetCellRange(Integer, Integer, Integer, Integer) As CellRange

[C#] public CellRange GetCellRange(int, int, int, int);

[Delphi] public function GetCellRange(Int32; Int32; Int32; Int32) : CellRange; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellRange Method (Int32, Int32)

C1FlexGridBase.GetCellRange Method (Int32, Int32)

Gets a CellRange object that can be used to format and manipulate a cell.

[Visual Basic]

Overloads Public Function GetCellRange( _

ByVal row As Integer, _

ByVal col As Integer _

) As CellRange

[C#]

public CellRange GetCellRange(

int row,

int col

);

[Delphi]

public function GetCellRange(

row: Int32;

col: Int32

): CellRange; overload;

Parameters

row

Row index.

col

Column index.

Return Value

A CellRange object that can be used to format and manipulate the cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellRange Method (Int32, Int32, Int32, Int32)

C1FlexGridBase.GetCellRange Method (Int32, Int32, Int32, Int32)

Gets a CellRange object that can be used to format and manipulate a range.

[Visual Basic]

Overloads Public Function GetCellRange( _

ByVal topRow As Integer, _

ByVal leftCol As Integer, _

ByVal bottomRow As Integer, _

ByVal rightCol As Integer _

) As CellRange

[C#]

public CellRange GetCellRange(

int topRow,

int leftCol,

int bottomRow,

int rightCol

);

[Delphi]

public function GetCellRange(

topRow: Int32;

leftCol: Int32;

bottomRow: Int32;

rightCol: Int32

): CellRange; overload;

Parameters

topRow

Top row in the range.

leftCol

Left column in the range.

bottomRow

Bottom row in the range.

rightCol

Right column in the range.

Return Value

A CellRange object that can be used to format and manipulate the range.

Remarks

The CellRange object provides access to properties of the cells in the range. For example, the code below sets the style of a range:

CellRange rg = flex.GetCellRange(5, 5, 20, 8);

rg.Style = flex.Styles["MyStyle"];

Note: CellRange is a class, not a struct. Because of this, you have to assign the value to a variable and then use the variable. For example, the following code will not compile:

// this does not compile

flex.GetCellRange(5, 5, 20, 8).Style = flex.Styles["MyStyle"];

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellRect Method

C1FlexGridBase.GetCellRect Method

Overload List

Gets a System.Drawing.Rectangle object with the coordinates of the cell within the control.

[Visual Basic] Overloads Public Function GetCellRect(Integer, Integer) As Rectangle

[C#] public Rectangle GetCellRect(int, int);

[Delphi] public function GetCellRect(Int32; Int32) : Rectangle; overload;

Gets a System.Drawing.Rectangle object with the coordinates of the cell within the control.

[Visual Basic] Overloads Public Function GetCellRect(Integer, Integer, Boolean) As Rectangle

[C#] public Rectangle GetCellRect(int, int, bool);

[Delphi] public function GetCellRect(Int32; Int32; Boolean) : Rectangle; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellRect Method (Int32, Int32)

C1FlexGridBase.GetCellRect Method (Int32, Int32)

Gets a System.Drawing.Rectangle object with the coordinates of the cell within the control.

[Visual Basic]

Overloads Public Function GetCellRect( _

ByVal row As Integer, _

ByVal col As Integer _

) As Rectangle

[C#]

public Rectangle GetCellRect(

int row,

int col

);

[Delphi]

public function GetCellRect(

row: Int32;

col: Int32

): Rectangle; overload;

Parameters

row

Row index.

col

Column index.

Remarks

This property is useful if you need to implement custom editors or other elements that need to be positioned over cells.

This method does not ensure the cell is visible.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellRect Method (Int32, Int32, Boolean)

C1FlexGridBase.GetCellRect Method (Int32, Int32, Boolean)

Gets a System.Drawing.Rectangle object with the coordinates of the cell within the control.

[Visual Basic]

Overloads Public Function GetCellRect( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal show As Boolean _

) As Rectangle

[C#]

public Rectangle GetCellRect(

int row,

int col,

bool show

);

[Delphi]

public function GetCellRect(

row: Int32;

col: Int32;

show: Boolean

): Rectangle; overload;

Parameters

row

Row index.

col

Column index.

show

Whether to scroll the cell into view before calculating the rectangle.

Return Value

A System.Drawing.Rectangle object with the coordinates of the cell, in pixels and relative to the control's client area.

Remarks

This property is useful if you need to implement custom editors or other elements that need to be positioned over cells.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellStyle Method

C1FlexGridBase.GetCellStyle Method

Gets a custom CellStyle associated with a cell.

[Visual Basic]

Public Function GetCellStyle( _

ByVal row As Integer, _

ByVal col As Integer _

) As CellStyle

[C#]

public CellStyle GetCellStyle(

int row,

int col

);

[Delphi]

public function GetCellStyle(

row: Int32;

col: Int32

): CellStyle;

Parameters

row

Row index.

col

Column index

Return Value

CellStyle object associated with the cell, or Null if the cell doesn't have a custom style.

Remarks

If the cell doesn't have a custom style, the grid paints it using one of the built-in styles. The built-in style is selected based on the cell position and state (fixed, scrollable, highlighted, etc). To retrieve the style that will be used to paint the cell (custom or built-in) use the GetCellStyleDisplay method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellStyleDisplay Method

C1FlexGridBase.GetCellStyleDisplay Method

Gets the style used to render a cell.

[Visual Basic]

Public Function GetCellStyleDisplay( _

ByVal row As Integer, _

ByVal col As Integer _

) As CellStyle

[C#]

public CellStyle GetCellStyleDisplay(

int row,

int col

);

[Delphi]

public function GetCellStyleDisplay(

row: Int32;

col: Int32

): CellStyle;

Parameters

row

Row index.

col

Column index

Return Value

CellStyle object used to display the cell.

Remarks

The CellStyle object returned may be a composite with elements from several styles. For example, a cell with the focus is painted with a style that contains elements from the Styles, a custom style associated with the cell, row, and column (if available), and the Styles style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetData Method

C1FlexGridBase.GetData Method

Overload List

Gets the value of a grid cell.

[Visual Basic] Overloads Overridable Public Function GetData(Integer, Integer) As Object

[C#] virtual public object GetData(int, int);

[Delphi] public function GetData(Int32; Int32) : Object; overload; virtual;

Gets the value of a grid cell.

[Visual Basic] Overloads Overridable Public Function GetData(Integer, String) As Object

[C#] virtual public object GetData(int, string);

[Delphi] public function GetData(Int32; String) : Object; overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetData Method (Int32, Int32)

C1FlexGridBase.GetData Method (Int32, Int32)

Gets the value of a grid cell.

[Visual Basic]

Overloads Overridable Public Function GetData( _

ByVal row As Integer, _

ByVal col As Integer _

) As Object

[C#]

virtual public object GetData(

int row,

int col

);

[Delphi]

public function GetData(

row: Int32;

col: Int32

): Object; overload; virtual;

Parameters

row

Row index.

col

Column index.

Return Value

The value of the cell.

Remarks

The GetData (Int32, Int32) method returns the raw data stored in a specific grid cell. It is equivalent to using the grid's indexer. For example:

object foo = flex.GetData(1, 1);

object bar = flex[1, 1]; // same thing

The data displayed on the grid might be different from the raw data, depending on the setting of the Format and DataMap properties. To obtain the display value (which is always a string), use the GetDataDisplay (Int32, Int32) method instead.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetData Method (Int32, String)

C1FlexGridBase.GetData Method (Int32, String)

Gets the value of a grid cell.

[Visual Basic]

Overloads Overridable Public Function GetData( _

ByVal row As Integer, _

ByVal colName As String _

) As Object

[C#]

virtual public object GetData(

int row,

string colName

);

[Delphi]

public function GetData(

row: Int32;

colName: String

): Object; overload; virtual;

Parameters

row

Row index.

colName

Column name.

Return Value

The value of the cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetDataDisplay Method

C1FlexGridBase.GetDataDisplay Method

Overload List

Gets the value in a grid cell, formatted as a string.

[Visual Basic] Overloads Overridable Public Function GetDataDisplay(Integer, Integer) As String

[C#] virtual public string GetDataDisplay(int, int);

[Delphi] public function GetDataDisplay(Int32; Int32) : String; overload; virtual;

Gets the value in a grid cell, formatted as a string.

[Visual Basic] Overloads Overridable Public Function GetDataDisplay(Integer, String) As String

[C#] virtual public string GetDataDisplay(int, string);

[Delphi] public function GetDataDisplay(Int32; String) : String; overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetDataDisplay Method (Int32, Int32)

C1FlexGridBase.GetDataDisplay Method (Int32, Int32)

Gets the value in a grid cell, formatted as a string.

[Visual Basic]

Overloads Overridable Public Function GetDataDisplay( _

ByVal row As Integer, _

ByVal col As Integer _

) As String

[C#]

virtual public string GetDataDisplay(

int row,

int col

);

[Delphi]

public function GetDataDisplay(

row: Int32;

col: Int32

): String; overload; virtual;

Parameters

row

Row index.

col

Column index.

Return Value

A string containing the data displayed in the given grid cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetDataDisplay Method (Int32, String)

C1FlexGridBase.GetDataDisplay Method (Int32, String)

Gets the value in a grid cell, formatted as a string.

[Visual Basic]

Overloads Overridable Public Function GetDataDisplay( _

ByVal row As Integer, _

ByVal colName As String _

) As String

[C#]

virtual public string GetDataDisplay(

int row,

string colName

);

[Delphi]

public function GetDataDisplay(

row: Int32;

colName: String

): String; overload; virtual;

Parameters

row

Row index.

colName

Column name.

Return Value

A string containing the data displayed in the given grid cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetHeaderThemeState Method

C1FlexGridBase.GetHeaderThemeState Method

Gets the state for a Windows Xp theme while the mouse moves over a cell.

[Visual Basic]

Overridable Protected Function GetHeaderThemeState( _

ByVal row As Integer, _

ByVal col As Integer _

) As Integer

[C#]

virtual protected int GetHeaderThemeState(

int row,

int col

);

[Delphi]

strict protected function GetHeaderThemeState(

row: Int32;

col: Int32

): Int32; virtual;

Parameters

row

Row under the mouse.

col

Column under the mouse.

Return Value

An integer representing the item state (2 for hot-tracking, 1 for normal).

Remarks

This method is for internal use. It allows inherited classes to customize the hot-tracking behavior.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetUserData Method

C1FlexGridBase.GetUserData Method

Overload List

Gets user data associated with a cell.

[Visual Basic] Overloads Overridable Public Function GetUserData(Integer, Integer) As Object

[C#] virtual public object GetUserData(int, int);

[Delphi] public function GetUserData(Int32; Int32) : Object; overload; virtual;

Gets user data associated with a cell.

[Visual Basic] Overloads Overridable Public Function GetUserData(Integer, String) As Object

[C#] virtual public object GetUserData(int, string);

[Delphi] public function GetUserData(Int32; String) : Object; overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetUserData Method (Int32, Int32)

C1FlexGridBase.GetUserData Method (Int32, Int32)

Gets user data associated with a cell.

[Visual Basic]

Overloads Overridable Public Function GetUserData( _

ByVal row As Integer, _

ByVal col As Integer _

) As Object

[C#]

virtual public object GetUserData(

int row,

int col

);

[Delphi]

public function GetUserData(

row: Int32;

col: Int32

): Object; overload; virtual;

Parameters

row

Row index.

col

Column index.

Return Value

Object associated with the cell.

Remarks

The user data is not used internally by the grid. It is reserved for additional data that you may want to associate with a cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetUserData Method (Int32, String)

C1FlexGridBase.GetUserData Method (Int32, String)

Gets user data associated with a cell.

[Visual Basic]

Overloads Overridable Public Function GetUserData( _

ByVal row As Integer, _

ByVal colName As String _

) As Object

[C#]

virtual public object GetUserData(

int row,

string colName

);

[Delphi]

public function GetUserData(

row: Int32;

colName: String

): Object; overload; virtual;

Parameters

row

Row index.

colName

Column name.

Return Value

Object associated with the cell.

Remarks

The user data is not used internally by the grid. It is reserved for additional data that you may want to associate with a cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.HitTest Method

C1FlexGridBase.HitTest Method

Overload List

Returns information about the control at the current mouse position.

[Visual Basic] Overloads Public Function HitTest() As HitTestInfo

[C#] public HitTestInfo HitTest();

[Delphi] public function HitTest() : HitTestInfo; overload;

Returns information about the control at a specified point on the control surface.

[Visual Basic] Overloads Public Function HitTest(Point) As HitTestInfo

[C#] public HitTestInfo HitTest(Point);

[Delphi] public function HitTest(Point) : HitTestInfo; overload;

Returns information about the control at a specified point on the control surface.

[Visual Basic] Overloads Public Function HitTest(Integer, Integer) As HitTestInfo

[C#] public HitTestInfo HitTest(int, int);

[Delphi] public function HitTest(Int32; Int32) : HitTestInfo; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.HitTest Method ()

C1FlexGridBase.HitTest Method ()

Returns information about the control at the current mouse position.

[Visual Basic]

Overloads Public Function HitTest() As HitTestInfo

[C#]

public HitTestInfo HitTest()

[Delphi]

public function HitTest():
HitTestInfo;
overload;

Return Value

A HitTestInfo object that contains information about the point.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.HitTest Method (Point)

C1FlexGridBase.HitTest Method (Point)

Returns information about the control at a specified point on the control surface.

[Visual Basic]

Overloads Public Function HitTest( _

ByVal pt As Point _

) As HitTestInfo

[C#]

public HitTestInfo HitTest(

Point pt

);

[Delphi]

public function HitTest(

pt: Point

): HitTestInfo; overload;

Parameters

pt

System.Drawing.Point in client coordinates.

Return Value

A HitTestInfo object that contains information about the point.

Remarks

This method is especially useful when handling the BeforeMouseDown event. It allows you to determine whether the mouse is over a specific cell, grid buttons, resizing elements, etc.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.HitTest Method (Int32, Int32)

C1FlexGridBase.HitTest Method (Int32, Int32)

Returns information about the control at a specified point on the control surface.

[Visual Basic]

Overloads Public Function HitTest( _

ByVal x As Integer, _

ByVal y As Integer _

) As HitTestInfo

[C#]

public HitTestInfo HitTest(

int x,

int y

);

[Delphi]

public function HitTest(

x: Int32;

y: Int32

): HitTestInfo; overload;

Parameters

x

The horizontal position of the client coordinate.

y

The vertical position of the client coordinate.

Return Value

A HitTestInfo object that contains information about the point.

Remarks

This method is especially useful when handling the BeforeMouseDown event. It allows you to determine whether the mouse is over a specific cell, grid buttons, resizing elements, etc.

Example

The code below shows hit test information whenever the user clicks the mouse:

private void _flex_BeforeMouseDown(object sender, BeforeMouseDownEventArgs e)

{

HitTestInfo hti = _flex.HitTest(e.X, e.Y);

Console.WriteLine("at {0},{1}: row {2} col {3} type {4}",

hti.X, hti.Y, hti.Row, hti.Column, hti.Type);

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Invalidate Method

C1FlexGridBase.Invalidate Method

Overload List

Invalidates a cell range, causing it to be repainted.

[Visual Basic] Overloads Overrides Public Sub Invalidate(CellRange)

[C#] override public Invalidate(CellRange);

[Delphi] public procedure Invalidate(CellRange); overload; override;

Invalidates a cell, causing it to be repainted.

[Visual Basic] Overloads Public Sub Invalidate(Integer, Integer)

[C#] public Invalidate(int, int);

[Delphi] public procedure Invalidate(Int32; Int32); overload;

Invalidates a cell range, causing it to be repainted.

[Visual Basic] Overloads Public Sub Invalidate(Integer, Integer, Integer, Integer)

[C#] public Invalidate(int, int, int, int);

[Delphi] public procedure Invalidate(Int32; Int32; Int32; Int32); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Invalidate Method (CellRange)

C1FlexGridBase.Invalidate Method (CellRange)

Invalidates a cell range, causing it to be repainted.

[Visual Basic]

Overloads Overrides Public Sub Invalidate( _

ByVal rg As CellRange _

)

[C#]

override public void Invalidate(

CellRange rg

);

[Delphi]

public procedure Invalidate(

rg: CellRange

); overload; override;

Parameters

rg

CellRange that will be invalidated.

Remarks

This method is rarely used by the programmer, since the grid automatically performs invalidation as needed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Invalidate Method (Int32, Int32)

C1FlexGridBase.Invalidate Method (Int32, Int32)

Invalidates a cell, causing it to be repainted.

[Visual Basic]

Overloads Public Sub Invalidate( _

ByVal row As Integer, _

ByVal col As Integer _

)

[C#]

public void Invalidate(

int row,

int col

);

[Delphi]

public procedure Invalidate(

row: Int32;

col: Int32

); overload;

Parameters

row

Row index.

col

Column index.

Remarks

This method is rarely used by the programmer, since the grid automatically performs invalidation as needed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Invalidate Method (Int32, Int32, Int32, Int32)

C1FlexGridBase.Invalidate Method (Int32, Int32, Int32, Int32)

Invalidates a cell range, causing it to be repainted.

[Visual Basic]

Overloads Public Sub Invalidate( _

ByVal topRow As Integer, _

ByVal leftCol As Integer, _

ByVal bottomRow As Integer, _

ByVal rightCol As Integer _

)

[C#]

public void Invalidate(

int topRow,

int leftCol,

int bottomRow,

int rightCol

);

[Delphi]

public procedure Invalidate(

topRow: Int32;

leftCol: Int32;

bottomRow: Int32;

rightCol: Int32

); overload;

Parameters

topRow

Top row in the range.

leftCol

Left column in the range.

bottomRow

Bottom row in the range.

rightCol

Right column in the range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.IsCellCursor Method

C1FlexGridBase.IsCellCursor Method

Gets a value that determines if a cell contains the grid cursor.

[Visual Basic]

Overridable Public Function IsCellCursor( _

ByVal row As Integer, _

ByVal col As Integer _

) As Boolean

[C#]

virtual public bool IsCellCursor(

int row,

int col

);

[Delphi]

public function IsCellCursor(

row: Int32;

col: Int32

): Boolean; virtual;

Parameters

row

Row index.

col

Column index.

Return Value

True if the cell contains the cursor, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.IsCellFixed Method

C1FlexGridBase.IsCellFixed Method

Gets a value that determines if a cell belongs to a fixed row or column.

[Visual Basic]

Overridable Public Function IsCellFixed( _

ByVal row As Integer, _

ByVal col As Integer _

) As Boolean

[C#]

virtual public bool IsCellFixed(

int row,

int col

);

[Delphi]

public function IsCellFixed(

row: Int32;

col: Int32

): Boolean; virtual;

Parameters

row

Row index.

col

Column index.

Return Value

True if the cell is fixed, False othwerwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.IsCellHighlighted Method

C1FlexGridBase.IsCellHighlighted Method

Gets a value that determines if a cell is part of the selection and should be highlighted.

[Visual Basic]

Overridable Public Function IsCellHighlighted( _

ByVal row As Integer, _

ByVal col As Integer _

) As Boolean

[C#]

virtual public bool IsCellHighlighted(

int row,

int col

);

[Delphi]

public function IsCellHighlighted(

row: Int32;

col: Int32

): Boolean; virtual;

Parameters

row

Row index.

col

Column index.

Return Value

True if the cell should be highlighted, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.IsCellValid Method

C1FlexGridBase.IsCellValid Method

Gets a value that determines if a pair of cell coordinates are valid.

[Visual Basic]

Overridable Public Function IsCellValid( _

ByVal row As Integer, _

ByVal col As Integer _

) As Boolean

[C#]

virtual public bool IsCellValid(

int row,

int col

);

[Delphi]

public function IsCellValid(

row: Int32;

col: Int32

): Boolean; virtual;

Parameters

row

Row index.

col

Column index.

Return Value

True if the cell coordinates are valid, False othwerwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.IsInputChar Method

C1FlexGridBase.IsInputChar Method

Determines if a character is an input character that the control recognizes.

[Visual Basic]

Overrides Protected Function IsInputChar( _

ByVal charCode As Char _

) As Boolean

[C#]

override protected bool IsInputChar(

char charCode

);

[Delphi]

strict protected function IsInputChar(

charCode: Char

): Boolean; override;

Parameters

charCode

The character to test.

Return Value

True if the character should be sent directly to the control and not preprocessed, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.IsInputKey Method

C1FlexGridBase.IsInputKey Method

Determines whether the specified key is a regular input key or a special key that requires preprocessing.

[Visual Basic]

Overrides Protected Function IsInputKey( _

ByVal keyData As Keys _

) As Boolean

[C#]

override protected bool IsInputKey(

Keys keyData

);

[Delphi]

strict protected function IsInputKey(

keyData: Keys

): Boolean; override;

Parameters

keyData

One of the System.Windows.Forms.Keys values.

Return Value

True if the specified key is a regular input key, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LoadExcel Method

C1FlexGridBase.LoadExcel Method

Overload List

Loads the grid from the first worksheet in a Microsoft Excel (.xls) file.

[Visual Basic] Overloads Public Sub LoadExcel(String)

[C#] public LoadExcel(string);

[Delphi] public procedure LoadExcel(String); overload;

Loads the grid from a Microsoft Excel (.xls) file.

[Visual Basic] Overloads Public Sub LoadExcel(String, String)

[C#] public LoadExcel(string, string);

[Delphi] public procedure LoadExcel(String; String); overload;

Loads the grid from a Microsoft Excel (.xls) file.

[Visual Basic] Overloads Public Sub LoadExcel(String, String, FileFlags)

[C#] public LoadExcel(string, string, FileFlags);

[Delphi] public procedure LoadExcel(String; String; FileFlags); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LoadExcel Method (String)

C1FlexGridBase.LoadExcel Method (String)

Loads the grid from the first worksheet in a Microsoft Excel (.xls) file.

[Visual Basic]

Overloads Public Sub LoadExcel( _

ByVal fileName As String _

)

[C#]

public void LoadExcel(

string fileName

);

[Delphi]

public procedure LoadExcel(

fileName: String

); overload;

Parameters

fileName

Name of the file to load, including the path.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LoadExcel Method (String, String)

C1FlexGridBase.LoadExcel Method (String, String)

Loads the grid from a Microsoft Excel (.xls) file.

[Visual Basic]

Overloads Public Sub LoadExcel( _

ByVal fileName As String, _

ByVal sheetName As String _

)

[C#]

public void LoadExcel(

string fileName,

string sheetName

);

[Delphi]

public procedure LoadExcel(

fileName: String;

sheetName: String

); overload;

Parameters

fileName

Name of the file to load, including the path.

sheetName

Name of the worksheet to load.

Remarks

Use the LoadExcelSheetNames method to obtain a list of the worksheets in an xls file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LoadExcel Method (String, String, FileFlags)

C1FlexGridBase.LoadExcel Method (String, String, FileFlags)

Loads the grid from a Microsoft Excel (.xls) file.

[Visual Basic]

Overloads Public Sub LoadExcel( _

ByVal fileName As String, _

ByVal sheetName As String, _

ByVal flags As FileFlags _

)

[C#]

public void LoadExcel(

string fileName,

string sheetName,

FileFlags flags

);

[Delphi]

public procedure LoadExcel(

fileName: String;

sheetName: String;

flags: FileFlags

); overload;

Parameters

fileName

Name of the file to load, including the path.

sheetName

Name of the worksheet to load.

flags

Options to use when loading the file.

Remarks

Use the LoadExcelSheetNames method to obtain a list of the worksheets in an XLS file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LoadExcelSheetNames Method

C1FlexGridBase.LoadExcelSheetNames Method

Gets a list with the names of the worksheets in a Microsoft Excel (.xls) file.

[Visual Basic]

Public Function LoadExcelSheetNames( _

ByVal fileName As String _

) As String()

[C#]

public string[] LoadExcelSheetNames(

string fileName

);

[Delphi]

public function LoadExcelSheetNames(

fileName: String

): array of String;

Parameters

fileName

Name of the Excel file, including the path.

Return Value

An array containing the names of the worksheets defined in the file.

Remarks

This method is used to obtain a list of sheet names that can later be used to load and save specific sheets using the LoadExcel (String, String, FileFlags) and SaveExcel (String, String, FileFlags) methods.

Example

The code below loads all sheets in an Excel workbook into a collection of grids in a TabControl:

// clear tabControl

tabControl.TabPages.Clear();

// load sheet names

string fileName = "c:\book1.xls";

string[] sheets = _flexGrid.LoadExcelSheetNames(fileName);

// load each sheet

foreach (string sheetName in sheets)

{

// create a new grid for this sheet

C1FlexGrid flex = new C1FlexGrid();

flex.Dock = DockStyle.Fill;

// load sheet into new grid

flex.LoadExcel(fileName, sheetName);

// add grid to the tabControl

TabPage page = new TabPage();

page.Controls.Add(flex);

page.Text = sheetName;

tabControl.TabPages.Add(page);

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LoadGrid Method

C1FlexGridBase.LoadGrid Method

Overload List

Loads the grid from a file.

[Visual Basic] Overloads Public Sub LoadGrid(String, FileFormatEnum)

[C#] public LoadGrid(string, FileFormatEnum);

[Delphi] public procedure LoadGrid(String; FileFormatEnum); overload;

Loads the grid from a file.

[Visual Basic] Overloads Public Sub LoadGrid(String, FileFormatEnum, FileFlags)

[C#] public LoadGrid(string, FileFormatEnum, FileFlags);

[Delphi] public procedure LoadGrid(String; FileFormatEnum; FileFlags); overload;

Loads the grid from a file.

[Visual Basic] Overloads Public Sub LoadGrid(String, FileFormatEnum, FileFlags, Encoding)

[C#] public LoadGrid(string, FileFormatEnum, FileFlags, Encoding);

[Delphi] public procedure LoadGrid(String; FileFormatEnum; FileFlags; Encoding); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LoadGrid Method (String, FileFormatEnum)

C1FlexGridBase.LoadGrid Method (String, FileFormatEnum)

Loads the grid from a file.

[Visual Basic]

Overloads Public Sub LoadGrid( _

ByVal fileName As String, _

ByVal format As FileFormatEnum _

)

[C#]

public void LoadGrid(

string fileName,

FileFormatEnum format

);

[Delphi]

public procedure LoadGrid(

fileName: String;

format: FileFormatEnum

); overload;

Parameters

fileName

Name of the file to load, including the path.

format

File format to use.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LoadGrid Method (String, FileFormatEnum, FileFlags)

C1FlexGridBase.LoadGrid Method (String, FileFormatEnum, FileFlags)

Loads the grid from a file.

[Visual Basic]

Overloads Public Sub LoadGrid( _

ByVal fileName As String, _

ByVal format As FileFormatEnum, _

ByVal flags As FileFlags _

)

[C#]

public void LoadGrid(

string fileName,

FileFormatEnum format,

FileFlags flags

);

[Delphi]

public procedure LoadGrid(

fileName: String;

format: FileFormatEnum;

flags: FileFlags

); overload;

Parameters

fileName

Name of the file to load, including the path.

format

File format to use.

flags

Options to use when loading the file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LoadGrid Method (String, FileFormatEnum, FileFlags, Encoding)

C1FlexGridBase.LoadGrid Method (String, FileFormatEnum, FileFlags, Encoding)

Loads the grid from a file.

[Visual Basic]

Overloads Public Sub LoadGrid( _

ByVal fileName As String, _

ByVal format As FileFormatEnum, _

ByVal flags As FileFlags, _

ByVal encoding As Encoding _

)

[C#]

public void LoadGrid(

string fileName,

FileFormatEnum format,

FileFlags flags,

Encoding encoding

);

[Delphi]

public procedure LoadGrid(

fileName: String;

format: FileFormatEnum;

flags: FileFlags;

encoding: Encoding

); overload;

Parameters

fileName

Name of the file to load, including the path.

format

File format to use.

flags

Options to use when loading the file.

encoding

System.Text.Encoding to use when saving the file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnBackColorChanged Method

C1FlexGridBase.OnBackColorChanged Method

Raises the System.Windows.Forms.Control.BackColorChanged event.

[Visual Basic]

Overrides Protected Sub OnBackColorChanged( _

ByVal e As EventArgs _

)

[C#]

override protected void OnBackColorChanged(

EventArgs e

);

[Delphi]

strict protected procedure OnBackColorChanged(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnBindingContextChanged Method

C1FlexGridBase.OnBindingContextChanged Method

Raises the System.Windows.Forms.Control.BindingContextChanged event.

[Visual Basic]

Overrides Protected Sub OnBindingContextChanged( _

ByVal e As EventArgs _

)

[C#]

override protected void OnBindingContextChanged(

EventArgs e

);

[Delphi]

strict protected procedure OnBindingContextChanged(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnDoubleClick Method

C1FlexGridBase.OnDoubleClick Method

Raises the System.Windows.Forms.Control.DoubleClick event.

[Visual Basic]

Overrides Protected Sub OnDoubleClick( _

ByVal e As EventArgs _

)

[C#]

override protected void OnDoubleClick(

EventArgs e

);

[Delphi]

strict protected procedure OnDoubleClick(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnDragDrop Method

C1FlexGridBase.OnDragDrop Method

Raises the System.Windows.Forms.Control.DragDrop event.

[Visual Basic]

Overrides Protected Sub OnDragDrop( _

ByVal e As DragEventArgs _

)

[C#]

override protected void OnDragDrop(

DragEventArgs e

);

[Delphi]

strict protected procedure OnDragDrop(

e: DragEventArgs

); override;

Parameters

e

A System.Windows.Forms.DragEventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnDragEnter Method

C1FlexGridBase.OnDragEnter Method

Raises the System.Windows.Forms.Control.DragEnter event.

[Visual Basic]

Overrides Protected Sub OnDragEnter( _

ByVal e As DragEventArgs _

)

[C#]

override protected void OnDragEnter(

DragEventArgs e

);

[Delphi]

strict protected procedure OnDragEnter(

e: DragEventArgs

); override;

Parameters

e

A System.Windows.Forms.DragEventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnDragOver Method

C1FlexGridBase.OnDragOver Method

Raises the System.Windows.Forms.Control.DragOver event.

[Visual Basic]

Overrides Protected Sub OnDragOver( _

ByVal e As DragEventArgs _

)

[C#]

override protected void OnDragOver(

DragEventArgs e

);

[Delphi]

strict protected procedure OnDragOver(

e: DragEventArgs

); override;

Parameters

e

A System.Windows.Forms.DragEventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnFontChanged Method

C1FlexGridBase.OnFontChanged Method

Raises the System.Windows.Forms.Control.FontChanged event.

[Visual Basic]

Overrides Protected Sub OnFontChanged( _

ByVal e As EventArgs _

)

[C#]

override protected void OnFontChanged(

EventArgs e

);

[Delphi]

strict protected procedure OnFontChanged(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnForeColorChanged Method

C1FlexGridBase.OnForeColorChanged Method

Raises the System.Windows.Forms.Control.ForeColorChanged event.

[Visual Basic]

Overrides Protected Sub OnForeColorChanged( _

ByVal e As EventArgs _

)

[C#]

override protected void OnForeColorChanged(

EventArgs e

);

[Delphi]

strict protected procedure OnForeColorChanged(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnGotFocus Method

C1FlexGridBase.OnGotFocus Method

Raises the System.Windows.Forms.Control.GotFocus event.

[Visual Basic]

Overrides Protected Sub OnGotFocus( _

ByVal e As EventArgs _

)

[C#]

override protected void OnGotFocus(

EventArgs e

);

[Delphi]

strict protected procedure OnGotFocus(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnHandleDestroyed Method

C1FlexGridBase.OnHandleDestroyed Method

Raises the System.Windows.Forms.Control.HandleDestroyed event.

[Visual Basic]

Overrides Protected Sub OnHandleDestroyed( _

ByVal e As EventArgs _

)

[C#]

override protected void OnHandleDestroyed(

EventArgs e

);

[Delphi]

strict protected procedure OnHandleDestroyed(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnKeyDown Method

C1FlexGridBase.OnKeyDown Method

Raises the System.Windows.Forms.Control.KeyDown event.

[Visual Basic]

Overrides Protected Sub OnKeyDown( _

ByVal e As KeyEventArgs _

)

[C#]

override protected void OnKeyDown(

KeyEventArgs e

);

[Delphi]

strict protected procedure OnKeyDown(

e: KeyEventArgs

); override;

Parameters

e

A System.Windows.Forms.KeyEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnKeyPress Method

C1FlexGridBase.OnKeyPress Method

Raises the System.Windows.Forms.Control.KeyPress event.

[Visual Basic]

Overrides Protected Sub OnKeyPress( _

ByVal e As KeyPressEventArgs _

)

[C#]

override protected void OnKeyPress(

KeyPressEventArgs e

);

[Delphi]

strict protected procedure OnKeyPress(

e: KeyPressEventArgs

); override;

Parameters

e

A System.Windows.Forms.KeyPressEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnLeave Method

C1FlexGridBase.OnLeave Method

Raises the System.Windows.Forms.Control.Leave event.

[Visual Basic]

Overrides Protected Sub OnLeave( _

ByVal e As EventArgs _

)

[C#]

override protected void OnLeave(

EventArgs e

);

[Delphi]

strict protected procedure OnLeave(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnLostFocus Method

C1FlexGridBase.OnLostFocus Method

Raises the System.Windows.Forms.Control.LostFocus event.

[Visual Basic]

Overrides Protected Sub OnLostFocus( _

ByVal e As EventArgs _

)

[C#]

override protected void OnLostFocus(

EventArgs e

);

[Delphi]

strict protected procedure OnLostFocus(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnMouseDown Method

C1FlexGridBase.OnMouseDown Method

Raises the System.Windows.Forms.Control.MouseDown event.

[Visual Basic]

Overrides Protected Sub OnMouseDown( _

ByVal e As MouseEventArgs _

)

[C#]

override protected void OnMouseDown(

MouseEventArgs e

);

[Delphi]

strict protected procedure OnMouseDown(

e: MouseEventArgs

); override;

Parameters

e

A System.Windows.Forms.MouseEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnMouseLeave Method

C1FlexGridBase.OnMouseLeave Method

Raises the System.Windows.Forms.Control.MouseLeave event.

[Visual Basic]

Overrides Protected Sub OnMouseLeave( _

ByVal e As EventArgs _

)

[C#]

override protected void OnMouseLeave(

EventArgs e

);

[Delphi]

strict protected procedure OnMouseLeave(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnMouseMove Method

C1FlexGridBase.OnMouseMove Method

Raises the System.Windows.Forms.Control.MouseMove event.

[Visual Basic]

Overrides Protected Sub OnMouseMove( _

ByVal e As MouseEventArgs _

)

[C#]

override protected void OnMouseMove(

MouseEventArgs e

);

[Delphi]

strict protected procedure OnMouseMove(

e: MouseEventArgs

); override;

Parameters

e

A System.Windows.Forms.MouseEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnMouseUp Method

C1FlexGridBase.OnMouseUp Method

Raises the System.Windows.Forms.Control.MouseUp event.

[Visual Basic]

Overrides Protected Sub OnMouseUp( _

ByVal e As MouseEventArgs _

)

[C#]

override protected void OnMouseUp(

MouseEventArgs e

);

[Delphi]

strict protected procedure OnMouseUp(

e: MouseEventArgs

); override;

Parameters

e

A System.Windows.Forms.MouseEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnPaint Method

C1FlexGridBase.OnPaint Method

Raises the System.Windows.Forms.Control.Paint event.

[Visual Basic]

Overrides Protected Sub OnPaint( _

ByVal e As PaintEventArgs _

)

[C#]

override protected void OnPaint(

PaintEventArgs e

);

[Delphi]

strict protected procedure OnPaint(

e: PaintEventArgs

); override;

Parameters

e

A System.Windows.Forms.PaintEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnPaintBackground Method

C1FlexGridBase.OnPaintBackground Method

Raises the System.Windows.Forms.Control.PaintBackground(System.Windows.Forms.PaintEventArgs,System.Drawing.Rectangle) event.

[Visual Basic]

Overrides Protected Sub OnPaintBackground( _

ByVal e As PaintEventArgs _

)

[C#]

override protected void OnPaintBackground(

PaintEventArgs e

);

[Delphi]

strict protected procedure OnPaintBackground(

e: PaintEventArgs

); override;

Parameters

e

A System.Windows.Forms.PaintEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnScroll Method

C1FlexGridBase.OnScroll Method

Called when the grid contents scroll.

[Visual Basic]

Overrides Protected Sub OnScroll( _

ByVal sb As ScrollBars _

)

[C#]

override protected void OnScroll(

ScrollBars sb

);

[Delphi]

strict protected procedure OnScroll(

sb: ScrollBars

); override;

Parameters

sb

System.Windows.Forms.ScrollBars value that specifies the scroll direction.

Remarks

This method is for internal use. It allows inherited classes to customize the grid scrolling behavior.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnScrollTip Method

C1FlexGridBase.OnScrollTip Method

Raises the BeforeScrollTip event.

[Visual Basic]

Overrides Protected Sub OnScrollTip( _

ByVal newValue As Integer _

)

[C#]

override protected void OnScrollTip(

int newValue

);

[Delphi]

strict protected procedure OnScrollTip(

newValue: Int32

); override;

Parameters

newValue

New value for the vertical scroll bar.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnSizeChanged Method

C1FlexGridBase.OnSizeChanged Method

Raises the System.Windows.Forms.Control.SizeChanged event.

[Visual Basic]

Overrides Protected Sub OnSizeChanged( _

ByVal e As EventArgs _

)

[C#]

override protected void OnSizeChanged(

EventArgs e

);

[Delphi]

strict protected procedure OnSizeChanged(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnThemeChanged Method

C1FlexGridBase.OnThemeChanged Method

Called when the control receives a WM_THEMECHANGED message.

[Visual Basic]

Overrides Protected Sub OnThemeChanged()

[C#]

override protected void OnThemeChanged()

[Delphi]

strict protected procedure OnThemeChanged(); override;

Remarks

The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnValidating Method

C1FlexGridBase.OnValidating Method

Raises the System.Windows.Forms.Control.Validating event.

[Visual Basic]

Overrides Protected Sub OnValidating( _

ByVal e As CancelEventArgs _

)

[C#]

override protected void OnValidating(

CancelEventArgs e

);

[Delphi]

strict protected procedure OnValidating(

e: CancelEventArgs

); override;

Parameters

e

A System.ComponentModel.CancelEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OnVisibleChanged Method

C1FlexGridBase.OnVisibleChanged Method

Raises the System.Windows.Forms.Control.VisibleChanged event.

[Visual Basic]

Overrides Protected Sub OnVisibleChanged( _

ByVal e As EventArgs _

)

[C#]

override protected void OnVisibleChanged(

EventArgs e

);

[Delphi]

strict protected procedure OnVisibleChanged(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.PrintGrid Method

C1FlexGridBase.PrintGrid Method

Overload List

Prints the grid, optionally showing a page setup or print preview dialog.

[Visual Basic] Overloads Public Function PrintGrid(String) As Boolean

[C#] public bool PrintGrid(string);

[Delphi] public function PrintGrid(String) : Boolean; overload;

Prints the grid, optionally showing a page setup or print preview dialog.

[Visual Basic] Overloads Public Function PrintGrid(String, PrintGridFlags) As Boolean

[C#] public bool PrintGrid(string, PrintGridFlags);

[Delphi] public function PrintGrid(String; PrintGridFlags) : Boolean; overload;

Prints the grid, optionally showing a page setup or print preview dialog.

[Visual Basic] Overloads Public Function PrintGrid(String, PrintGridFlags, String, String) As Boolean

[C#] public bool PrintGrid(string, PrintGridFlags, string, string);

[Delphi] public function PrintGrid(String; PrintGridFlags; String; String) : Boolean; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.PrintGrid Method (String)

C1FlexGridBase.PrintGrid Method (String)

Prints the grid, optionally showing a page setup or print preview dialog.

[Visual Basic]

Overloads Public Function PrintGrid( _

ByVal docName As String _

) As Boolean

[C#]

public bool PrintGrid(

string docName

);

[Delphi]

public function PrintGrid(

docName: String

): Boolean; overload;

Parameters

docName

The document name, which appears on the progress dialogs and on the print job windows.

Return Value

True if the grid was printed, False if the user canceled the operation.

Remarks

Use the PrintParameters property to set up options such as page orientation and margins, header and footer fonts, etc.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.PrintGrid Method (String, PrintGridFlags)

C1FlexGridBase.PrintGrid Method (String, PrintGridFlags)

Prints the grid, optionally showing a page setup or print preview dialog.

[Visual Basic]

Overloads Public Function PrintGrid( _

ByVal docName As String, _

ByVal flags As PrintGridFlags _

) As Boolean

[C#]

public bool PrintGrid(

string docName,

PrintGridFlags flags

);

[Delphi]

public function PrintGrid(

docName: String;

flags: PrintGridFlags

): Boolean; overload;

Parameters

docName

The document name, which appears on the progress dialogs and on the print job windows.

flags

Flags that select printing options.

Return Value

True if the grid was printed, False if the user canceled the operation.

Remarks

Use the PrintParameters property to set up options such as page orientation and margins, header and footer fonts, etc.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.PrintGrid Method (String, PrintGridFlags, String, String)

C1FlexGridBase.PrintGrid Method (String, PrintGridFlags, String, String)

Prints the grid, optionally showing a page setup or print preview dialog.

[Visual Basic]

Overloads Public Function PrintGrid( _

ByVal docName As String, _

ByVal flags As PrintGridFlags, _

ByVal header As String, _

ByVal footer As String _

) As Boolean

[C#]

public bool PrintGrid(

string docName,

PrintGridFlags flags,

string header,

string footer

);

[Delphi]

public function PrintGrid(

docName: String;

flags: PrintGridFlags;

header: String;

footer: String

): Boolean; overload;

Parameters

docName

The document name, which appears on the progress dialogs and on the print job windows.

flags

Flags that select printing options.

header

String that appears on the top of every page.

footer

String that appears on the bottom of every page.

Return Value

True if the grid was printed, False if the user canceled the operation.

Remarks

The header and footer strings may contain up to three tab-delimited sections, which are aligned to the left, center, and right of the page. The strings may also contain placeholders that are replaced with the current page number and total number of pages ("{0}" and "{1}").

Use the PrintParameters property to set up options such as page orientation and margins, header and footer fonts, etc.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ReadXml Method

C1FlexGridBase.ReadXml Method

Overload List

Loads the grid from an XML document.

[Visual Basic] Overloads Public Sub ReadXml(Stream)

[C#] public ReadXml(Stream);

[Delphi] public procedure ReadXml(Stream); overload;

Loads the grid from an XML document.

[Visual Basic] Overloads Public Sub ReadXml(String)

[C#] public ReadXml(string);

[Delphi] public procedure ReadXml(String); overload;

Loads the grid from an XML document.

[Visual Basic] Overloads Public Sub ReadXml(TextReader)

[C#] public ReadXml(TextReader);

[Delphi] public procedure ReadXml(TextReader); overload;

Loads the grid from an XML document.

[Visual Basic] Overloads Public Sub ReadXml(XmlDocument)

[C#] public ReadXml(XmlDocument);

[Delphi] public procedure ReadXml(XmlDocument); overload;

Loads the grid from an XML document.

[Visual Basic] Overloads Public Sub ReadXml(XmlNode)

[C#] public ReadXml(XmlNode);

[Delphi] public procedure ReadXml(XmlNode); overload;

Loads the grid from an XML document.

[Visual Basic] Overloads Public Sub ReadXml(XmlReader)

[C#] public ReadXml(XmlReader);

[Delphi] public procedure ReadXml(XmlReader); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ReadXml Method (Stream)

C1FlexGridBase.ReadXml Method (Stream)

Loads the grid from an XML document.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal stream As Stream _

)

[C#]

public void ReadXml(

Stream stream

);

[Delphi]

public procedure ReadXml(

stream: Stream

); overload;

Parameters

stream

System.IO.Stream object to use for loading the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ReadXml Method (String)

C1FlexGridBase.ReadXml Method (String)

Loads the grid from an XML document.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal fileName As String _

)

[C#]

public void ReadXml(

string fileName

);

[Delphi]

public procedure ReadXml(

fileName: String

); overload;

Parameters

fileName

Name of the file to load, including the path.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ReadXml Method (TextReader)

C1FlexGridBase.ReadXml Method (TextReader)

Loads the grid from an XML document.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal tr As TextReader _

)

[C#]

public void ReadXml(

TextReader tr

);

[Delphi]

public procedure ReadXml(

tr: TextReader

); overload;

Parameters

tr

System.IO.TextReader object to use for loading the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ReadXml Method (XmlDocument)

C1FlexGridBase.ReadXml Method (XmlDocument)

Loads the grid from an XML document.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal doc As XmlDocument _

)

[C#]

public void ReadXml(

XmlDocument doc

);

[Delphi]

public procedure ReadXml(

doc: XmlDocument

); overload;

Parameters

doc

System.Xml.XmlDocument object to use for loading the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ReadXml Method (XmlNode)

C1FlexGridBase.ReadXml Method (XmlNode)

Loads the grid from an XML document.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal node As XmlNode _

)

[C#]

public void ReadXml(

XmlNode node

);

[Delphi]

public procedure ReadXml(

node: XmlNode

); overload;

Parameters

node

System.Xml.XmlNode object to use for loading the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ReadXml Method (XmlReader)

C1FlexGridBase.ReadXml Method (XmlReader)

Loads the grid from an XML document.

[Visual Basic]

Overloads Public Sub ReadXml( _

ByVal xr As XmlReader _

)

[C#]

public void ReadXml(

XmlReader xr

);

[Delphi]

public procedure ReadXml(

xr: XmlReader

); overload;

Parameters

xr

System.Xml.XmlReader object to use for loading the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.RemoveItem Method

C1FlexGridBase.RemoveItem Method

Overload List

Removes the last row from the grid.

[Visual Basic] Overloads Public Sub RemoveItem()

[C#] public RemoveItem();

[Delphi] public procedure RemoveItem(); overload;

Removes a row at a specified position from the grid.

[Visual Basic] Overloads Public Sub RemoveItem(Integer)

[C#] public RemoveItem(int);

[Delphi] public procedure RemoveItem(Int32); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.RemoveItem Method ()

C1FlexGridBase.RemoveItem Method ()

Removes the last row from the grid.

[Visual Basic]

Overloads Public Sub RemoveItem()

[C#]

public void RemoveItem()

[Delphi]

public procedure RemoveItem(); overload;

Remarks

You can also add and remove rows using the Rows collection.

The RemoveItem method is provided for consistency, since the grid also has an AddItem (String) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.RemoveItem Method (Int32)

C1FlexGridBase.RemoveItem Method (Int32)

Removes a row at a specified position from the grid.

[Visual Basic]

Overloads Public Sub RemoveItem( _

ByVal index As Integer _

)

[C#]

public void RemoveItem(

int index

);

[Delphi]

public procedure RemoveItem(

index: Int32

); overload;

Parameters

index

Index of the row to be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SaveExcel Method

C1FlexGridBase.SaveExcel Method

Overload List

Saves the grid contents to a Microsoft Excel (.xls) file.

[Visual Basic] Overloads Public Sub SaveExcel(String)

[C#] public SaveExcel(string);

[Delphi] public procedure SaveExcel(String); overload;

Saves the grid contents to a Microsoft Excel (.xls) file.

[Visual Basic] Overloads Public Sub SaveExcel(String, String)

[C#] public SaveExcel(string, string);

[Delphi] public procedure SaveExcel(String; String); overload;

Saves the grid contents to a Microsoft Excel (.xls) file.

[Visual Basic] Overloads Public Sub SaveExcel(String, String, FileFlags)

[C#] public SaveExcel(string, string, FileFlags);

[Delphi] public procedure SaveExcel(String; String; FileFlags); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SaveExcel Method (String)

C1FlexGridBase.SaveExcel Method (String)

Saves the grid contents to a Microsoft Excel (.xls) file.

[Visual Basic]

Overloads Public Sub SaveExcel( _

ByVal fileName As String _

)

[C#]

public void SaveExcel(

string fileName

);

[Delphi]

public procedure SaveExcel(

fileName: String

); overload;

Parameters

fileName

Name of the file to save, including the path.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SaveExcel Method (String, String)

C1FlexGridBase.SaveExcel Method (String, String)

Saves the grid contents to a Microsoft Excel (.xls) file.

[Visual Basic]

Overloads Public Sub SaveExcel( _

ByVal fileName As String, _

ByVal sheetName As String _

)

[C#]

public void SaveExcel(

string fileName,

string sheetName

);

[Delphi]

public procedure SaveExcel(

fileName: String;

sheetName: String

); overload;

Parameters

fileName

Name of the file to save, including the path.

sheetName

Name of the sheet to add to the Excel workbook.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SaveExcel Method (String, String, FileFlags)

C1FlexGridBase.SaveExcel Method (String, String, FileFlags)

Saves the grid contents to a Microsoft Excel (.xls) file.

[Visual Basic]

Overloads Public Sub SaveExcel( _

ByVal fileName As String, _

ByVal sheetName As String, _

ByVal flags As FileFlags _

)

[C#]

public void SaveExcel(

string fileName,

string sheetName,

FileFlags flags

);

[Delphi]

public procedure SaveExcel(

fileName: String;

sheetName: String;

flags: FileFlags

); overload;

Parameters

fileName

Name of the file to save, including the path.

sheetName

Name of the sheet to add to the Excel workbook.

flags

Options to use when saving the file.

Remarks

If the specified file exists, the control will add or replace a single worksheet in it. Existing sheets will be preserved if possible.

The worksheet to add or replace is identified by the sheetName parameter.

If the specified file is in use by another application (usually Excel), the method will fail.

This method does not require Microsoft Excel to be installed on the machine.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SaveGrid Method

C1FlexGridBase.SaveGrid Method

Overload List

Saves the grid contents to a file.

[Visual Basic] Overloads Public Sub SaveGrid(String, FileFormatEnum)

[C#] public SaveGrid(string, FileFormatEnum);

[Delphi] public procedure SaveGrid(String; FileFormatEnum); overload;

Saves the grid contents to a file.

[Visual Basic] Overloads Public Sub SaveGrid(String, FileFormatEnum, FileFlags)

[C#] public SaveGrid(string, FileFormatEnum, FileFlags);

[Delphi] public procedure SaveGrid(String; FileFormatEnum; FileFlags); overload;

Saves the grid contents to a file.

[Visual Basic] Overloads Public Sub SaveGrid(String, FileFormatEnum, FileFlags, Encoding)

[C#] public SaveGrid(string, FileFormatEnum, FileFlags, Encoding);

[Delphi] public procedure SaveGrid(String; FileFormatEnum; FileFlags; Encoding); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SaveGrid Method (String, FileFormatEnum)

C1FlexGridBase.SaveGrid Method (String, FileFormatEnum)

Saves the grid contents to a file.

[Visual Basic]

Overloads Public Sub SaveGrid( _

ByVal fileName As String, _

ByVal format As FileFormatEnum _

)

[C#]

public void SaveGrid(

string fileName,

FileFormatEnum format

);

[Delphi]

public procedure SaveGrid(

fileName: String;

format: FileFormatEnum

); overload;

Parameters

fileName

Name of the file to save, including the path.

format

File format to use.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SaveGrid Method (String, FileFormatEnum, FileFlags)

C1FlexGridBase.SaveGrid Method (String, FileFormatEnum, FileFlags)

Saves the grid contents to a file.

[Visual Basic]

Overloads Public Sub SaveGrid( _

ByVal fileName As String, _

ByVal format As FileFormatEnum, _

ByVal flags As FileFlags _

)

[C#]

public void SaveGrid(

string fileName,

FileFormatEnum format,

FileFlags flags

);

[Delphi]

public procedure SaveGrid(

fileName: String;

format: FileFormatEnum;

flags: FileFlags

); overload;

Parameters

fileName

Name of the file to save, including the path.

format

File format to use.

flags

Options to use when saving the file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SaveGrid Method (String, FileFormatEnum, FileFlags, Encoding)

C1FlexGridBase.SaveGrid Method (String, FileFormatEnum, FileFlags, Encoding)

Saves the grid contents to a file.

[Visual Basic]

Overloads Public Sub SaveGrid( _

ByVal fileName As String, _

ByVal format As FileFormatEnum, _

ByVal flags As FileFlags, _

ByVal encoding As Encoding _

)

[C#]

public void SaveGrid(

string fileName,

FileFormatEnum format,

FileFlags flags,

Encoding encoding

);

[Delphi]

public procedure SaveGrid(

fileName: String;

format: FileFormatEnum;

flags: FileFlags;

encoding: Encoding

); overload;

Parameters

fileName

Name of the file to save, including the path.

format

File format to use.

flags

Options to use when saving the file.

encoding

System.Text.Encoding to use when saving the file.

Remarks

Grids saved to CSV and other text files include data only (no formatting information is saved).

Grids saved to Excel files include data and formatting information. Images are not saved.

Grids can also be persisted to XML format using the WriteXml (String) and ReadXml (String) methods.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Select Method

C1FlexGridBase.Select Method

Overload List

Selects a range of cells and scrolls it into view.

[Visual Basic] Overloads Public Sub Select(CellRange)

[C#] public Select(CellRange);

[Delphi] public procedure Select(CellRange); overload;

Selects a range of cells.

[Visual Basic] Overloads Public Sub Select(CellRange, Boolean)

[C#] public Select(CellRange, bool);

[Delphi] public procedure Select(CellRange; Boolean); overload;

Selects a cell and scrolls it into view.

[Visual Basic] Overloads Public Sub Select(Integer, Integer)

[C#] public Select(int, int);

[Delphi] public procedure Select(Int32; Int32); overload;

Selects a cell.

[Visual Basic] Overloads Public Sub Select(Integer, Integer, Boolean)

[C#] public Select(int, int, bool);

[Delphi] public procedure Select(Int32; Int32; Boolean); overload;

Selects a range of cells and scrolls it into view.

[Visual Basic] Overloads Public Sub Select(Integer, Integer, Integer, Integer)

[C#] public Select(int, int, int, int);

[Delphi] public procedure Select(Int32; Int32; Int32; Int32); overload;

Selects a range of cells.

[Visual Basic] Overloads Public Sub Select(Integer, Integer, Integer, Integer, Boolean)

[C#] public Select(int, int, int, int, bool);

[Delphi] public procedure Select(Int32; Int32; Int32; Int32; Boolean); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Select Method (CellRange)

C1FlexGridBase.Select Method (CellRange)

Selects a range of cells and scrolls it into view.

[Visual Basic]

Overloads Public Sub Select( _

ByVal rg As CellRange _

)

[C#]

public void Select(

CellRange rg

);

[Delphi]

public procedure Select(

rg: CellRange

); overload;

Parameters

rg

CellRange that specifies the cells that will be selected.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Select Method (CellRange, Boolean)

C1FlexGridBase.Select Method (CellRange, Boolean)

Selects a range of cells.

[Visual Basic]

Overloads Public Sub Select( _

ByVal rg As CellRange, _

ByVal show As Boolean _

)

[C#]

public void Select(

CellRange rg,

bool show

);

[Delphi]

public procedure Select(

rg: CellRange;

show: Boolean

); overload;

Parameters

rg

CellRange that specifies the cells that will be selected.

show

Whether to scroll the new selection into view.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Select Method (Int32, Int32)

C1FlexGridBase.Select Method (Int32, Int32)

Selects a cell and scrolls it into view.

[Visual Basic]

Overloads Public Sub Select( _

ByVal row As Integer, _

ByVal col As Integer _

)

[C#]

public void Select(

int row,

int col

);

[Delphi]

public procedure Select(

row: Int32;

col: Int32

); overload;

Parameters

row

New value for the Row property.

col

New value for the Col property.

Remarks

Using the Select (CellRange, Boolean) method is equivalent to setting the Row and Col properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Select Method (Int32, Int32, Boolean)

C1FlexGridBase.Select Method (Int32, Int32, Boolean)

Selects a cell.

[Visual Basic]

Overloads Public Sub Select( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal show As Boolean _

)

[C#]

public void Select(

int row,

int col,

bool show

);

[Delphi]

public procedure Select(

row: Int32;

col: Int32;

show: Boolean

); overload;

Parameters

row

New value for the Row property.

col

New value for the Col property.

show

Whether to scroll the new selection into view.

Remarks

Using the Select (CellRange, Boolean) method is equivalent to setting the Row and Col properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Select Method (Int32, Int32, Int32, Int32)

C1FlexGridBase.Select Method (Int32, Int32, Int32, Int32)

Selects a range of cells and scrolls it into view.

[Visual Basic]

Overloads Public Sub Select( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal rowSel As Integer, _

ByVal colSel As Integer _

)

[C#]

public void Select(

int row,

int col,

int rowSel,

int colSel

);

[Delphi]

public procedure Select(

row: Int32;

col: Int32;

rowSel: Int32;

colSel: Int32

); overload;

Parameters

row

New value for the Row property.

col

New value for the Col property.

rowSel

New value for the RowSel property.

colSel

New value for the ColSel property.

Remarks

Using the Select (CellRange, Boolean) method is equivalent to setting the Row, Col, RowSel, and ColSel properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Select Method (Int32, Int32, Int32, Int32, Boolean)

C1FlexGridBase.Select Method (Int32, Int32, Int32, Int32, Boolean)

Selects a range of cells.

[Visual Basic]

Overloads Public Sub Select( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal rowSel As Integer, _

ByVal colSel As Integer, _

ByVal show As Boolean _

)

[C#]

public void Select(

int row,

int col,

int rowSel,

int colSel,

bool show

);

[Delphi]

public procedure Select(

row: Int32;

col: Int32;

rowSel: Int32;

colSel: Int32;

show: Boolean

); overload;

Parameters

row

New value for the Row property.

col

New value for the Col property.

rowSel

New value for the RowSel property.

colSel

New value for the ColSel property.

show

Whether to scroll the new selection into view.

Remarks

Using the Select (CellRange, Boolean) method is equivalent to setting the Row, Col, RowSel, and ColSel properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetCellCheck Method

C1FlexGridBase.SetCellCheck Method

Sets the state of the checkbox in a grid cell.

[Visual Basic]

Overridable Public Sub SetCellCheck( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal check As CheckEnum _

)

[C#]

virtual public void SetCellCheck(

int row,

int col,

CheckEnum check

);

[Delphi]

public procedure SetCellCheck(

row: Int32;

col: Int32;

check: CheckEnum

); virtual;

Parameters

row

Row index.

col

Column index.

check

CheckEnum value to assign to the cell.

Remarks

For details and examples, see the GetCellCheck method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetCellImage Method

C1FlexGridBase.SetCellImage Method

Sets the image displayed in a grid cell.

[Visual Basic]

Public Sub SetCellImage( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal newImage As Image _

)

[C#]

public void SetCellImage(

int row,

int col,

Image newImage

);

[Delphi]

public procedure SetCellImage(

row: Int32;

col: Int32;

newImage: Image

);

Parameters

row

Row index.

col

Column index.

newImage

An System.Drawing.Image object containing an image to display in the cell.

Remarks

In addition to the usual cell contents, you can display images in cells. There are two methods for showing images in cells:

1. You can use the SetCellImage and GetCellImage methods to assign images directly to the cells. In this case, the cell contents and the image are independent. To update the image, you need to call SetCellImage again.

2. You can use the ImageMap property to associate images with specific cell values. In this case, images are updated automatically whenever the cell contents change. The ImageAndText property allows you to specify whether the control should display the images in addition to or instead of the cell text.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetCellStyle Method

C1FlexGridBase.SetCellStyle Method

Overload List

Assigns a custom CellStyle to a cell.

[Visual Basic] Overloads Public Sub SetCellStyle(Integer, Integer, CellStyle)

[C#] public SetCellStyle(int, int, CellStyle);

[Delphi] public procedure SetCellStyle(Int32; Int32; CellStyle); overload;

Assigns a custom CellStyle to a cell.

[Visual Basic] Overloads Public Sub SetCellStyle(Integer, Integer, String)

[C#] public SetCellStyle(int, int, string);

[Delphi] public procedure SetCellStyle(Int32; Int32; String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetCellStyle Method (Int32, Int32, CellStyle)

C1FlexGridBase.SetCellStyle Method (Int32, Int32, CellStyle)

Assigns a custom CellStyle to a cell.

[Visual Basic]

Overloads Public Sub SetCellStyle( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal newStyle As CellStyle _

)

[C#]

public void SetCellStyle(

int row,

int col,

CellStyle newStyle

);

[Delphi]

public procedure SetCellStyle(

row: Int32;

col: Int32;

newStyle: CellStyle

); overload;

Parameters

row

Row index.

col

Column index

newStyle

The CellStyle to associate with the cell.

Remarks

The SetCellStyle (Int32, Int32, CellStyle) method is useful is you want to assign a new style to a single cell. You can also reset the cell style by setting it to Null (Nothing, in VB).

To apply a custom cell style to an entire row or column, set the Row or Style properties.

To apply a custom style to a range cells, use a CellRange object. For example:

CellRange rg = _flex.GetCellRange(3, 3, 10, 10);

rg.Style = _flex.Styles["MyRangeStyle"];

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetCellStyle Method (Int32, Int32, String)

C1FlexGridBase.SetCellStyle Method (Int32, Int32, String)

Assigns a custom CellStyle to a cell.

[Visual Basic]

Overloads Public Sub SetCellStyle( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal styleName As String _

)

[C#]

public void SetCellStyle(

int row,

int col,

string styleName

);

[Delphi]

public procedure SetCellStyle(

row: Int32;

col: Int32;

styleName: String

); overload;

Parameters

row

Row index.

col

Column index

styleName

Name of the new style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetData Method

C1FlexGridBase.SetData Method

Overload List

Assigns a value to a range of cells, coercing the value into each cell's specified DataType.

[Visual Basic] Overloads Overridable Public Function SetData(CellRange, Object) As Boolean

[C#] virtual public bool SetData(CellRange, object);

[Delphi] public function SetData(CellRange; Object) : Boolean; overload; virtual;

Assigns a value to a range of cells.

[Visual Basic] Overloads Overridable Public Function SetData(CellRange, Object, Boolean) As Boolean

[C#] virtual public bool SetData(CellRange, object, bool);

[Delphi] public function SetData(CellRange; Object; Boolean) : Boolean; overload; virtual;

Assigns a value to a grid cell, coercing the value into the cell's specified DataType.

[Visual Basic] Overloads Overridable Public Function SetData(Integer, Integer, Object) As Boolean

[C#] virtual public bool SetData(int, int, object);

[Delphi] public function SetData(Int32; Int32; Object) : Boolean; overload; virtual;

Assigns a value to a grid cell, coercing the value into the cell's specified data type.

[Visual Basic] Overloads Overridable Public Function SetData(Integer, String, Object) As Boolean

[C#] virtual public bool SetData(int, string, object);

[Delphi] public function SetData(Int32; String; Object) : Boolean; overload; virtual;

Assigns a value to a grid cell.

[Visual Basic] Overloads Overridable Public Function SetData(Integer, Integer, Object, Boolean) As Boolean

[C#] virtual public bool SetData(int, int, object, bool);

[Delphi] public function SetData(Int32; Int32; Object; Boolean) : Boolean; overload; virtual;

Assigns a value to a grid cell.

[Visual Basic] Overloads Overridable Public Function SetData(Integer, String, Object, Boolean) As Boolean

[C#] virtual public bool SetData(int, string, object, bool);

[Delphi] public function SetData(Int32; String; Object; Boolean) : Boolean; overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetData Method (CellRange, Object)

C1FlexGridBase.SetData Method (CellRange, Object)

Assigns a value to a range of cells, coercing the value into each cell's specified DataType.

[Visual Basic]

Overloads Overridable Public Function SetData( _

ByVal rg As CellRange, _

ByVal value As Object _

) As Boolean

[C#]

virtual public bool SetData(

CellRange rg,

object value

);

[Delphi]

public function SetData(

rg: CellRange;

value: Object

): Boolean; overload; virtual;

Parameters

rg

CellRange that specifies the cells that will be assigned a new value.

value

Value that will be assigned to all cells in the range.

Return Value

True if the value was assigned to all cells in the destination range, False if the value could not be assigned to all cells in the range (usually because it could not be converted to the appropriate type).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetData Method (CellRange, Object, Boolean)

C1FlexGridBase.SetData Method (CellRange, Object, Boolean)

Assigns a value to a range of cells.

[Visual Basic]

Overloads Overridable Public Function SetData( _

ByVal rg As CellRange, _

ByVal value As Object, _

ByVal coerce As Boolean _

) As Boolean

[C#]

virtual public bool SetData(

CellRange rg,

object value,

bool coerce

);

[Delphi]

public function SetData(

rg: CellRange;

value: Object;

coerce: Boolean

): Boolean; overload; virtual;

Parameters

rg

CellRange that specifies the cells that will be assigned a new value.

value

Value that will be assigned to all cells in the range.

coerce

Whether the value should be converted to the column's data type.

Return Value

True if the value was assigned to all cells in the destination range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetData Method (Int32, Int32, Object)

C1FlexGridBase.SetData Method (Int32, Int32, Object)

Assigns a value to a grid cell, coercing the value into the cell's specified DataType.

[Visual Basic]

Overloads Overridable Public Function SetData( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal value As Object _

) As Boolean

[C#]

virtual public bool SetData(

int row,

int col,

object value

);

[Delphi]

public function SetData(

row: Int32;

col: Int32;

value: Object

): Boolean; overload; virtual;

Parameters

row

Row index.

col

Column index.

value

Value to assign to the cell.

Return Value

True if the value was assigned to the cell, False if the value could not be assigned (usually because it could not be converted to the appropriate type).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetData Method (Int32, String, Object)

C1FlexGridBase.SetData Method (Int32, String, Object)

Assigns a value to a grid cell, coercing the value into the cell's specified data type.

[Visual Basic]

Overloads Overridable Public Function SetData( _

ByVal row As Integer, _

ByVal colName As String, _

ByVal value As Object _

) As Boolean

[C#]

virtual public bool SetData(

int row,

string colName,

object value

);

[Delphi]

public function SetData(

row: Int32;

colName: String;

value: Object

): Boolean; overload; virtual;

Parameters

row

Row index.

colName

Column name.

value

Value to assign to the cell.

Return Value

True if the value was assigned to the cell, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetData Method (Int32, Int32, Object, Boolean)

C1FlexGridBase.SetData Method (Int32, Int32, Object, Boolean)

Assigns a value to a grid cell.

[Visual Basic]

Overloads Overridable Public Function SetData( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal value As Object, _

ByVal coerce As Boolean _

) As Boolean

[C#]

virtual public bool SetData(

int row,

int col,

object value,

bool coerce

);

[Delphi]

public function SetData(

row: Int32;

col: Int32;

value: Object;

coerce: Boolean

): Boolean; overload; virtual;

Parameters

row

Row index.

col

Column index.

value

Value to assign to the cell.

coerce

Whether the value should be converted to the column's data type.

Return Value

True if the value was assigned to the cell.

Remarks

If coerce is set to True and the value cannot be converted into the proper data type, the grid will fire the GridError event and the cell will retain its original value.

Using SetData (Int32, Int32, Object, Boolean) with coerce set to True is equivalent to setting the grid's indexer. For example, the following lines of code are equivalent:

flex.SetData(1, 1, "Hello", true);

flex[1, 1] = "Hello"; // same thing

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetData Method (Int32, String, Object, Boolean)

C1FlexGridBase.SetData Method (Int32, String, Object, Boolean)

Assigns a value to a grid cell.

[Visual Basic]

Overloads Overridable Public Function SetData( _

ByVal row As Integer, _

ByVal colName As String, _

ByVal value As Object, _

ByVal coerce As Boolean _

) As Boolean

[C#]

virtual public bool SetData(

int row,

string colName,

object value,

bool coerce

);

[Delphi]

public function SetData(

row: Int32;

colName: String;

value: Object;

coerce: Boolean

): Boolean; overload; virtual;

Parameters

row

Row index.

colName

Column name.

value

Value to assign to the cell.

coerce

Whether the value should be converted to the column's data type.

Return Value

True if the value was assigned to the cell, False otherwise.

Remarks

If coerce is set to True and the value cannot be converted into the proper data type, the grid will fire the GridError event and the cell will retain its original value.

Using SetData (Int32, Int32, Object, Boolean) with coerce set to True is equivalent to setting the grid's indexer. For example, the following lines of code are equivalent:

flex.SetData(1, "ColName", "Hello", true);

flex[1, "ColName"] = "Hello"; // same thing

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetDataBinding Method

C1FlexGridBase.SetDataBinding Method

Overload List

Sets the DataSource and DataMember properties.

[Visual Basic] Overloads Public Sub SetDataBinding(Object, String)

[C#] public SetDataBinding(object, string);

[Delphi] public procedure SetDataBinding(Object; String); overload;

Sets the DataSource and DataMember properties, optionally keeping the current column layout.

[Visual Basic] Overloads Public Sub SetDataBinding(Object, String, Boolean)

[C#] public SetDataBinding(object, string, bool);

[Delphi] public procedure SetDataBinding(Object; String; Boolean); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetDataBinding Method (Object, String)

C1FlexGridBase.SetDataBinding Method (Object, String)

Sets the DataSource and DataMember properties.

[Visual Basic]

Overloads Public Sub SetDataBinding( _

ByVal dataSource As Object, _

ByVal dataMember As String _

)

[C#]

public void SetDataBinding(

object dataSource,

string dataMember

);

[Delphi]

public procedure SetDataBinding(

dataSource: Object;

dataMember: String

); overload;

Parameters

dataSource

The new data source object.

dataMember

The table to bind to within the data source object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetDataBinding Method (Object, String, Boolean)

C1FlexGridBase.SetDataBinding Method (Object, String, Boolean)

Sets the DataSource and DataMember properties, optionally keeping the current column layout.

[Visual Basic]

Overloads Public Sub SetDataBinding( _

ByVal dataSource As Object, _

ByVal dataMember As String, _

ByVal preserveLayout As Boolean _

)

[C#]

public void SetDataBinding(

object dataSource,

string dataMember,

bool preserveLayout

);

[Delphi]

public procedure SetDataBinding(

dataSource: Object;

dataMember: String;

preserveLayout: Boolean

); overload;

Parameters

dataSource

The new data source object.

dataMember

The table to bind to within the data source object.

preserveLayout

Whether the current column layout should be preserved or re-generated automatically based on the data source schema.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetUserData Method

C1FlexGridBase.SetUserData Method

Overload List

Assigns user data to a cell.

[Visual Basic] Overloads Overridable Public Sub SetUserData(Integer, Integer, Object)

[C#] virtual public SetUserData(int, int, object);

[Delphi] public procedure SetUserData(Int32; Int32; Object); overload; virtual;

Assigns user data to a cell.

[Visual Basic] Overloads Overridable Public Sub SetUserData(Integer, String, Object)

[C#] virtual public SetUserData(int, string, object);

[Delphi] public procedure SetUserData(Int32; String; Object); overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetUserData Method (Int32, Int32, Object)

C1FlexGridBase.SetUserData Method (Int32, Int32, Object)

Assigns user data to a cell.

[Visual Basic]

Overloads Overridable Public Sub SetUserData( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal data As Object _

)

[C#]

virtual public void SetUserData(

int row,

int col,

object data

);

[Delphi]

public procedure SetUserData(

row: Int32;

col: Int32;

data: Object

); overload; virtual;

Parameters

row

Row index.

col

Column index.

data

User data to assign to the cell.

Remarks

The user data is not used internally by the grid. It is reserved for additional data that you may want to associate with a cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetUserData Method (Int32, String, Object)

C1FlexGridBase.SetUserData Method (Int32, String, Object)

Assigns user data to a cell.

[Visual Basic]

Overloads Overridable Public Sub SetUserData( _

ByVal row As Integer, _

ByVal colName As String, _

ByVal data As Object _

)

[C#]

virtual public void SetUserData(

int row,

string colName,

object data

);

[Delphi]

public procedure SetUserData(

row: Int32;

colName: String;

data: Object

); overload; virtual;

Parameters

row

Row index.

colName

Column name.

data

User data to assign to the cell.

Remarks

The user data is not used internally by the grid. It is reserved for additional data that you may want to associate with a cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ShowCell Method

C1FlexGridBase.ShowCell Method

Scrolls a cell into view.

[Visual Basic]

Overridable Public Sub ShowCell( _

ByVal row As Integer, _

ByVal col As Integer _

)

[C#]

virtual public void ShowCell(

int row,

int col

);

[Delphi]

public procedure ShowCell(

row: Int32;

col: Int32

); virtual;

Parameters

row

Row index.

col

Column index.

Remarks

This method does not affect the current selection. To move the cursor to a specific cell and optionally bring it into view, use the Select (CellRange, Boolean) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ShowSortAt Method

C1FlexGridBase.ShowSortAt Method

Shows the sorting glyph on a column header.

[Visual Basic]

Public Sub ShowSortAt( _

ByVal order As SortFlags, _

ByVal col As Integer _

)

[C#]

public void ShowSortAt(

SortFlags order,

int col

);

[Delphi]

public procedure ShowSortAt(

order: SortFlags;

col: Int32

);

Parameters

order

SortFlags value that specifies the glyph to display.

col

Column index.

Remarks

This method is useful if you want to perform custom sorting and need control over the appearance and position of the sorting glyph (the little triangle that appears on the header of sorted columns).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Sort Method

C1FlexGridBase.Sort Method

Overload List

Sorts the grid using the specified comparer.

[Visual Basic] Overloads Overridable Public Sub Sort(IComparer)

[C#] virtual public Sort(IComparer);

[Delphi] public procedure Sort(IComparer); overload; virtual;

Sorts a range of cells in the grid.

[Visual Basic] Overloads Overridable Public Sub Sort(SortFlags, CellRange)

[C#] virtual public Sort(SortFlags, CellRange);

[Delphi] public procedure Sort(SortFlags; CellRange); overload; virtual;

Sorts the grid contents based on a column.

[Visual Basic] Overloads Overridable Public Sub Sort(SortFlags, Integer)

[C#] virtual public Sort(SortFlags, int);

[Delphi] public procedure Sort(SortFlags; Int32); overload; virtual;

Sorts a group of rows using the specified comparer.

[Visual Basic] Overloads Overridable Public Sub Sort(Integer, Integer, IComparer)

[C#] virtual public Sort(int, int, IComparer);

[Delphi] public procedure Sort(Int32; Int32; IComparer); overload; virtual;

Sorts the grid contents based on a column range.

[Visual Basic] Overloads Overridable Public Sub Sort(SortFlags, Integer, Integer)

[C#] virtual public Sort(SortFlags, int, int);

[Delphi] public procedure Sort(SortFlags; Int32; Int32); overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Sort Method (IComparer)

C1FlexGridBase.Sort Method (IComparer)

Sorts the grid using the specified comparer.

[Visual Basic]

Overloads Overridable Public Sub Sort( _

ByVal comparer As IComparer _

)

[C#]

virtual public void Sort(

IComparer comparer

);

[Delphi]

public procedure Sort(

comparer: IComparer

); overload; virtual;

Parameters

comparer

An System.Collections.IComparer object that compares Row objects.

Remarks

The System.Collections.IComparer interface has a single method called System.Collections.IComparer.Compare(System.Object,System.Object) that takes two objects as arguments (in this case, they will be Row objects) and returns -1, 0, or +1. For more details, see the documentation for System.Collections.IComparer.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Sort Method (SortFlags, CellRange)

C1FlexGridBase.Sort Method (SortFlags, CellRange)

Sorts a range of cells in the grid.

[Visual Basic]

Overloads Overridable Public Sub Sort( _

ByVal order As SortFlags, _

ByVal rg As CellRange _

)

[C#]

virtual public void Sort(

SortFlags order,

CellRange rg

);

[Delphi]

public procedure Sort(

order: SortFlags;

rg: CellRange

); overload; virtual;

Parameters

order

SortFlags value that specifies the sort direction and options.

rg

CellRange object that specifies the range of cells to sort.

Remarks

When you sort multiple columns, the same sorting options are applied to each column, starting from the leftmost column in the range and proceeding to the right.

To sort multiple columns using a different sorting order for each, you can either call the Sort (SortFlags, Int32) method multiple times or set each column's Sort property and call the Sort (SortFlags, Int32) method including the SortFlags.UseColSort flag in the flags parameter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Sort Method (SortFlags, Int32)

C1FlexGridBase.Sort Method (SortFlags, Int32)

Sorts the grid contents based on a column.

[Visual Basic]

Overloads Overridable Public Sub Sort( _

ByVal order As SortFlags, _

ByVal col As Integer _

)

[C#]

virtual public void Sort(

SortFlags order,

int col

);

[Delphi]

public procedure Sort(

order: SortFlags;

col: Int32

); overload; virtual;

Parameters

order

SortFlags value that specifies the sort direction and options.

col

Column to sort on.

Remarks

The grid uses a stable sorting algorithm. This means that the sorting keeps the relative order of records when the sorting key is the same. For example, if you sort a list of files by name, then by extension, the list will still be sorted by name within each extension group.

If the grid is bound to a data source, it automatically defers the sorting request to the data source object. In this case, the request may succeed or fail, depending on whether or not the data source supports sorting.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Sort Method (Int32, Int32, IComparer)

C1FlexGridBase.Sort Method (Int32, Int32, IComparer)

Sorts a group of rows using the specified comparer.

[Visual Basic]

Overloads Overridable Public Sub Sort( _

ByVal rowStart As Integer, _

ByVal rowCount As Integer, _

ByVal comparer As IComparer _

)

[C#]

virtual public void Sort(

int rowStart,

int rowCount,

IComparer comparer

);

[Delphi]

public procedure Sort(

rowStart: Int32;

rowCount: Int32;

comparer: IComparer

); overload; virtual;

Parameters

rowStart

First row in the sort range.

rowCount

Number of rows in the sort range.

comparer

An System.Collections.IComparer object that compares Row objects.

Remarks

The System.Collections.IComparer interface has a single method called System.Collections.IComparer.Compare(System.Object,System.Object) that takes two objects as arguments (in this case, they will be Row objects) and returns -1, 0, or +1. For more details, see the documentation for System.Collections.IComparer.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Sort Method (SortFlags, Int32, Int32)

C1FlexGridBase.Sort Method (SortFlags, Int32, Int32)

Sorts the grid contents based on a column range.

[Visual Basic]

Overloads Overridable Public Sub Sort( _

ByVal order As SortFlags, _

ByVal col1 As Integer, _

ByVal col2 As Integer _

)

[C#]

virtual public void Sort(

SortFlags order,

int col1,

int col2

);

[Delphi]

public procedure Sort(

order: SortFlags;

col1: Int32;

col2: Int32

); overload; virtual;

Parameters

order

SortFlags value that specifies the sort direction and options.

col1

First column in the range.

col2

Last column in the range.

Remarks

When you sort multiple columns, the same sorting options are applied to each column, starting from the leftmost column in the range and proceeding to the right.

To sort multiple columns using a different sorting order for each, you can either call the Sort (SortFlags, Int32) method multiple times or set each column's Sort property and call the Sort (SortFlags, Int32) method including the SortFlags.UseColSort flag in the order parameter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.StartEditing Method

C1FlexGridBase.StartEditing Method

Overload List

Puts the grid in edit mode and starts editing the current cell.

[Visual Basic] Overloads Public Function StartEditing() As Boolean

[C#] public bool StartEditing();

[Delphi] public function StartEditing() : Boolean; overload;

Puts the grid in edit mode and starts editing a cell.

[Visual Basic] Overloads Public Function StartEditing(Integer, Integer) As Boolean

[C#] public bool StartEditing(int, int);

[Delphi] public function StartEditing(Int32; Int32) : Boolean; overload;

Puts the grid in edit mode and starts editing a cell.

[Visual Basic] Overloads Overridable Public Function StartEditing(Integer, Integer, Char) As Boolean

[C#] virtual public bool StartEditing(int, int, char);

[Delphi] public function StartEditing(Int32; Int32; Char) : Boolean; overload; virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.StartEditing Method ()

C1FlexGridBase.StartEditing Method ()

Puts the grid in edit mode and starts editing the current cell.

[Visual Basic]

Overloads Public Function StartEditing() As Boolean

[C#]

public bool StartEditing()

[Delphi]

public function StartEditing(): Boolean; overload;

Return Value

True if the grid entered edit mode successfully, False otherwise.

Remarks

If the AllowEditing property is set to True, the control goes into edit mode automatically when the user presses the edit key (F2), the space bar, or any printable character. You may use the StartEditing (Int32, Int32, Char) method to force the control into cell-editing mode.

The StartEditing (Int32, Int32, Char) method forces the control into editing mode even if AllowEditing is set to False. You may also use it to allow editing of fixed cells.

Example

The code below uses the StartEditing (Int32, Int32, Char) method to keep the grid in edit mode while the user moves the selection (like the .NET DataGrid control):

private void _flex_RowColChange(object sender, System.EventArgs e)

{

_flex.StartEditing();

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.StartEditing Method (Int32, Int32)

C1FlexGridBase.StartEditing Method (Int32, Int32)

Puts the grid in edit mode and starts editing a cell.

[Visual Basic]

Overloads Public Function StartEditing( _

ByVal row As Integer, _

ByVal col As Integer _

) As Boolean

[C#]

public bool StartEditing(

int row,

int col

);

[Delphi]

public function StartEditing(

row: Int32;

col: Int32

): Boolean; overload;

Parameters

row

Row index.

col

Column index.

Return Value

True if the grid entered edit mode successfully, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.StartEditing Method (Int32, Int32, Char)

C1FlexGridBase.StartEditing Method (Int32, Int32, Char)

Puts the grid in edit mode and starts editing a cell.

[Visual Basic]

Overloads Overridable Public Function StartEditing( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal key As Char _

) As Boolean

[C#]

virtual public bool StartEditing(

int row,

int col,

char key

);

[Delphi]

public function StartEditing(

row: Int32;

col: Int32;

key: Char

): Boolean; overload; virtual;

Parameters

row

Row index.

col

Column index.

key

Initial character to be sent to the editor.

Return Value

True if the grid entered edit mode successfully, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Subtotal Method

C1FlexGridBase.Subtotal Method

Overload List

Groups rows based on cell contents and calculates aggregate values.

[Visual Basic] Overloads Public Sub Subtotal(AggregateEnum)

[C#] public Subtotal(AggregateEnum);

[Delphi] public procedure Subtotal(AggregateEnum); overload;

Groups rows based on cell contents and calculates aggregate values.

[Visual Basic] Overloads Public Sub Subtotal(AggregateEnum, Integer, Integer, Integer)

[C#] public Subtotal(AggregateEnum, int, int, int);

[Delphi] public procedure Subtotal(AggregateEnum; Int32; Int32; Int32); overload;

Groups rows based on cell contents and calculates aggregate values.

[Visual Basic] Overloads Public Sub Subtotal(AggregateEnum, Integer, Integer, Integer, String)

[C#] public Subtotal(AggregateEnum, int, int, int, string);

[Delphi] public procedure Subtotal(AggregateEnum; Int32; Int32; Int32; String); overload;

Groups rows based on cell contents and calculates aggregate values.

[Visual Basic] Overloads Public Sub Subtotal(AggregateEnum, Integer, Integer, Integer, Integer, String)

[C#] public Subtotal(AggregateEnum, int, int, int, int, string);

[Delphi] public procedure Subtotal(AggregateEnum; Int32; Int32; Int32; Int32; String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Subtotal Method (AggregateEnum)

C1FlexGridBase.Subtotal Method (AggregateEnum)

Groups rows based on cell contents and calculates aggregate values.

[Visual Basic]

Overloads Public Sub Subtotal( _

ByVal aggType As AggregateEnum _

)

[C#]

public void Subtotal(

AggregateEnum aggType

);

[Delphi]

public procedure Subtotal(

aggType: AggregateEnum

); overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

Remarks

This version of the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method does not take any column parameters, and is useful only for clearing the subtotals. For example:

flex.Subtotal(AggregateEnum.Clear); // clear all subtotals

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Subtotal Method (AggregateEnum, Int32, Int32, Int32)

C1FlexGridBase.Subtotal Method (AggregateEnum, Int32, Int32, Int32)

Groups rows based on cell contents and calculates aggregate values.

[Visual Basic]

Overloads Public Sub Subtotal( _

ByVal aggType As AggregateEnum, _

ByVal level As Integer, _

ByVal groupOn As Integer, _

ByVal totalOn As Integer _

)

[C#]

public void Subtotal(

AggregateEnum aggType,

int level,

int groupOn,

int totalOn

);

[Delphi]

public procedure Subtotal(

aggType: AggregateEnum;

level: Int32;

groupOn: Int32;

totalOn: Int32

); overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

level

Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.

groupOn

Column used to detect group breaks.

totalOn

Column that contains values to be aggregated (usually numeric).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Subtotal Method (AggregateEnum, Int32, Int32, Int32, String)

C1FlexGridBase.Subtotal Method (AggregateEnum, Int32, Int32, Int32, String)

Groups rows based on cell contents and calculates aggregate values.

[Visual Basic]

Overloads Public Sub Subtotal( _

ByVal aggType As AggregateEnum, _

ByVal level As Integer, _

ByVal groupOn As Integer, _

ByVal totalOn As Integer, _

ByVal caption As String _

)

[C#]

public void Subtotal(

AggregateEnum aggType,

int level,

int groupOn,

int totalOn,

string caption

);

[Delphi]

public procedure Subtotal(

aggType: AggregateEnum;

level: Int32;

groupOn: Int32;

totalOn: Int32;

caption: String

); overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

level

Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.

groupOn

Column used to detect group breaks.

totalOn

Column that contains values to be aggregated (usually numeric).

caption

Text to insert in the subtotal rows.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.Subtotal Method (AggregateEnum, Int32, Int32, Int32, Int32, String)

C1FlexGridBase.Subtotal Method (AggregateEnum, Int32, Int32, Int32, Int32, String)

Groups rows based on cell contents and calculates aggregate values.

[Visual Basic]

Overloads Public Sub Subtotal( _

ByVal aggType As AggregateEnum, _

ByVal level As Integer, _

ByVal groupFrom As Integer, _

ByVal groupTo As Integer, _

ByVal totalOn As Integer, _

ByVal caption As String _

)

[C#]

public void Subtotal(

AggregateEnum aggType,

int level,

int groupFrom,

int groupTo,

int totalOn,

string caption

);

[Delphi]

public procedure Subtotal(

aggType: AggregateEnum;

level: Int32;

groupFrom: Int32;

groupTo: Int32;

totalOn: Int32;

caption: String

); overload;

Parameters

aggType

AggregateEnum value that specifies the type of aggregate to calculate.

level

Outline level to assign to the new subtotal rows. This parameter allows the creation of multi-level subtotals and affects the display of the outline tree.

groupFrom

First column in the range used to detect group breaks.

groupTo

Last column in the range used to detect group breaks.

totalOn

Column that contains values to be aggregated (usually numeric).

caption

Text to insert in the subtotal rows.

Remarks

The Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method inserts rows containing aggregate values. These new rows are set to behave as tree nodes so they can be collapsed and expanded to display a dynamic hierarchical outline.

You can control the appearance and behavior of the outline tree using the Tree property.

The node rows added by the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method have their Row property automatically set to one of the Styles.Subtotal* styles. You can use the Styles collection to modify the appearance of all subtotal rows on the grid.

To create an outline tree manually, insert node rows using the Rows method, or convert regular rows into nodes by setting the Row property to True for the node rows. Then use the Row property to set the outline level for the new nodes.

Example

The code below assumes a grid with four columns: "Product", "Region", "Employee", and "Sales".

The code groups on the first two columns, calculating total sales for each product and for each region within each product.

If the user drags a column to a new position, the tree is automatically rebuilt to show the new grouping (by Employee, Region, etc).

private void UpdateTotals()

{

// no repainging until we're done

_flex.Redraw = false;

// clear old subtotals, if any

_flex.Subtotal(AggregateEnum.Clear);

// sort the grid on the columns that will be grouped

_flex.Sort(SortFlags.Ascending, 0, 3);

// show outline tree on column 0

_flex.Tree.Column = 0;

// get a grand total (use -1 instead of column index)

_flex.Subtotal(AggregateEnum.Sum, -1, -1, 3, "Grand Total");

// total on column 0 (initially Product)

_flex.Subtotal(AggregateEnum.Sum, 0, 0, 3);

// total on column 1 (initially Region)

_flex.Subtotal(AggregateEnum.Sum, 1, 1, 3);

// show outline level 1

_flex.Tree.Show(1);

// restore painting

_flex.Redraw = true;

}

private void _flex_AfterDragColumn(object sender, C1.Win.C1FlexGrid.DragRowColEventArgs e)

{

UpdateTotals(); // user moved a column, update totals

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.WriteXml Method

C1FlexGridBase.WriteXml Method

Overload List

Saves the grid contents to an XML document.

[Visual Basic] Overloads Public Sub WriteXml(Stream)

[C#] public WriteXml(Stream);

[Delphi] public procedure WriteXml(Stream); overload;

Saves the grid contents to an XML document.

[Visual Basic] Overloads Public Sub WriteXml(String)

[C#] public WriteXml(string);

[Delphi] public procedure WriteXml(String); overload;

Saves the grid contents to an XML document.

[Visual Basic] Overloads Public Sub WriteXml(TextWriter)

[C#] public WriteXml(TextWriter);

[Delphi] public procedure WriteXml(TextWriter); overload;

Saves the grid contents to an XML document.

[Visual Basic] Overloads Public Sub WriteXml(XmlTextWriter)

[C#] public WriteXml(XmlTextWriter);

[Delphi] public procedure WriteXml(XmlTextWriter); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.WriteXml Method (Stream)

C1FlexGridBase.WriteXml Method (Stream)

Saves the grid contents to an XML document.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal stream As Stream _

)

[C#]

public void WriteXml(

Stream stream

);

[Delphi]

public procedure WriteXml(

stream: Stream

); overload;

Parameters

stream

The System.IO.Stream where the document is saved.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.WriteXml Method (String)

C1FlexGridBase.WriteXml Method (String)

Saves the grid contents to an XML document.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal fileName As String _

)

[C#]

public void WriteXml(

string fileName

);

[Delphi]

public procedure WriteXml(

fileName: String

); overload;

Parameters

fileName

Name of the file to save, including the path.

Remarks

The grid serializes all its contents into the XML document, including the data stored in the cells, row and column properties, styles, images, etc.

Objects of custom types stored in the grid are also serialized as long as they have an associated System.ComponentModel.TypeConverter that provides conversions to and from string.

The WriteXml (String) method has several overloads that allow you to save several grids into a single XML document, along with other information stored in the XML document.

Example

The code below saves a grid into an XML file:

// save a grid into am Xml file

flex.WriteXml(fileName);

The code below saves two grids into an XML file, then reads them back in reverse order:

// prepare XmlTextWriter

XmlTextWriter w = new XmlTextWriter(fileName, new UTF8Encoding(false));

w.Formatting = Formatting.Indented;

w.WriteStartDocument();

w.WriteStartElement("Grids");

// save first grid

w.WriteStartElement(c1FlexGrid1.Name);

c1FlexGrid1.WriteXml(w);

w.WriteEndElement();

// save second grid

w.WriteStartElement(c1FlexGrid2.Name);

c1FlexGrid2.WriteXml(w);

w.WriteEndElement();

// close document

w.WriteEndElement();

w.Close();

// load document from file

XmlDocument doc = new XmlDocument();

doc.Load(fileName);

XmlNode n = doc.SelectSingleNode("Grids");

// load grids in reverse order

c1FlexGrid2.ReadXml(n.ChildNodes[0]);

c1FlexGrid1.ReadXml(n.ChildNodes[1]);

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.WriteXml Method (TextWriter)

C1FlexGridBase.WriteXml Method (TextWriter)

Saves the grid contents to an XML document.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal tw As TextWriter _

)

[C#]

public void WriteXml(

TextWriter tw

);

[Delphi]

public procedure WriteXml(

tw: TextWriter

); overload;

Parameters

tw

The System.IO.TextWriter where the document is saved.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.WriteXml Method (XmlTextWriter)

C1FlexGridBase.WriteXml Method (XmlTextWriter)

Saves the grid contents to an XML document.

[Visual Basic]

Overloads Public Sub WriteXml( _

ByVal w As XmlTextWriter _

)

[C#]

public void WriteXml(

XmlTextWriter w

);

[Delphi]

public procedure WriteXml(

w: XmlTextWriter

); overload;

Parameters

w

The System.Xml.XmlTextWriter where the document is saved.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase Events

C1FlexGridBase Events

The events of the C1FlexGridBase class are listed here. For a complete list of C1FlexGridBase class members, see the C1FlexGridBase Members topic.

Public Events

AfterAddRow | Fires after a new row is added by the user.
AfterCollapse | Fires after a node row is collapsed or expanded.
AfterDataRefresh | Fires after any data source change notifications.
AfterDeleteRow | Fires after one or more rows are deleted by the user.
AfterDragColumn | Fires after the user finishes dragging a column.
AfterDragRow | Fires after the user finishes dragging a row.
AfterEdit | Fires after a cell has been edited.
AfterFreezeColumn | Fires after columns are frozen by dragging the frozen column divider.
AfterFreezeRow | Fires after rows are frozen by dragging the frozen row divider.
AfterResizeColumn | Fires after a column is resized by dragging the column header.
AfterResizeRow | Fires after a row is resized by dragging the row header.
AfterRowColChange | Fires after the current cell changes ( Row and Col properties).
AfterScroll | Fires after the grid scrolls.
AfterSelChange | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
AfterSort | Fires after a column is sorted by a click on a column header.
BackColorChanged (inherited from Control) | Event fired when the value of BackColor property is changed on Control
BackgroundImageChanged (inherited from Control) | Event fired when the value of BackgroundImage property is changed on Control
BeforeAddRow | Fires before a new row is added by the user.
BeforeAutosizeColumn | Fires before a column is automatically resized by a double-click on a column header.
BeforeAutosizeRow | Fires before a row is automatically resized by a double-click on a row header.
BeforeCollapse | Fires before a node row is collapsed or expanded.
BeforeDeleteRow | Fires before a row is deleted by the user.
BeforeDoubleClick | Fires before the DoubleClick event is handled by the grid.
BeforeDragColumn | Fires before the user starts dragging a column.
BeforeDragRow | Fires before the user starts dragging a row.
BeforeEdit | Fires before the grid enters edit mode, and also when the cell that has the focus needs to be painted.
BeforeFreezeColumn | Fires before columns are frozen by dragging the frozen column divider.
BeforeFreezeRow | Fires before rows are frozen by dragging the frozen row divider.
BeforeMouseDown | Fires before the System.Windows.Forms.Control.MouseDown event is handled by the grid.
BeforePageBreak | Fires while the control is being printed to provide control over page breaks.
BeforeResizeColumn | Fires before a column is resized by dragging the column header.
BeforeResizeRow | Fires before a row is resized by dragging the row header.
BeforeRowColChange | Fires before the current cell changes ( Row and Col properties).
BeforeScroll | Fires before the grid scrolls.
BeforeScrollTip | Fires before the vertical scrolltip is displayed.
BeforeSelChange | Fires before the selection changes ( Row, Col, RowSel, ColSel properties).
BeforeSort | Fires before a column is sorted by a click on a column header.
BeginPrint | Fires before the grid starts printing.
BindingContextChanged (inherited from Control) | Event fired when the value of BindingContext property is changed on Control
CancelAddRow | Fires when the cursor leaves the new row without making any changes to it.
CausesValidationChanged (inherited from Control) | Event fired when the value of CausesValidation property is changed on Control
CellButtonClick | Fires after the user clicks a cell button.
CellChanged | Fires after the contents of a cell have changed.
ChangeEdit | Fires in edit mode, after the contents of the editor change.
ChangeUICues (inherited from Control) | Occurs when focus rectangles and keyboard cue underlines are being shown or hidden.
Click (inherited from Control) | Occurs when the control is clicked.
ComboCloseUp | Fires in edit mode, when the dropdown portion of an editor closes.
ComboDropDown | Fires in edit mode, when the dropdown portion of an editor opens.
ContextMenuChanged (inherited from Control) | Event fired when the value of ContextMenu property is changed on Control
ControlAdded (inherited from Control) | Occurs when a control is added to this control.
ControlRemoved (inherited from Control) | Occurs when a control is removed from this control.
CursorChanged (inherited from Control) | Event fired when the value of Cursor property is changed on Control
DockChanged (inherited from Control) | Event fired when the value of Dock property is changed on Control
DoubleClick (inherited from Control) | Occurs when the control is double-clicked.
DragDrop (inherited from Control) | Occurs when the mouse drags an item and the user releases the mouse indicating that the item should be 'dropped' into this Control.
DragEnter (inherited from Control) | Occurs when the mouse drags an item into the client area for this Control.
DragLeave (inherited from Control) | Occurs when the mouse drags an item and is no longer over the client area for this Control.
DragOver (inherited from Control) | Occurs when the mouse drags an item and is moving over the client area of this Control.
EnabledChanged (inherited from Control) | Occurs when the control's enabled state changes.
EndPrint | Fires after the grid finishes printing.
Enter (inherited from Control) | Occurs when the control becomes the active control of the form.
EnterCell | Fires after the current cell changes ( Row and Col properties).
FontChanged (inherited from Control) | Event fired when the value of Font property is changed on Control
ForeColorChanged (inherited from Control) | Event fired when the value of ForeColor property is changed on Control
GetCellErrorInfo | Fires when ShowErrors is set to True and the control needs error information for a cell.
GetRowErrorInfo | Fires when ShowErrors is set to True and the control needs error information for a row.
GetUnboundValue | Fires when the grid needs to retrieve data for an unbound cell.
GiveFeedback (inherited from Control) | Occurs when the mouse drags an item. The system requests that the Control provide feedback to that effect.
GotFocus (inherited from Control) | Occurs when the control gets focus.
GridChanged | Fires when the grid or its contents change.
GridError | Fires after the data source reports an error condition.
HandleCreated (inherited from Control) | Occurs when the control's native handle is created.
HandleDestroyed (inherited from Control) | Occurs when the control's native handle is destroyed.
HelpRequested (inherited from Control) | Occurs when the user invokes help for the control.
ImeModeChanged (inherited from Control) | Occurs when the control's IME mode changes
Invalidated (inherited from Control) | Occurs when one of the invalidate methods is called.
KeyDown (inherited from Control) | Occurs when a key is first pressed.
KeyDownEdit | Fires in edit mode, when the user presses a key.
KeyPress (inherited from Control) | Occurs after the user is finished pressing a key.
KeyPressEdit | Fires in edit mode, when the user presses a character key.
KeyUp (inherited from Control) | Occurs when a key is released.
KeyUpEdit | Fires in edit mode, when the user releases a key.
Layout (inherited from Control) | Occurs when the control is about to lay out its contents.
Leave (inherited from Control) | Occurs when the control is no longer the active control of the form.
LeaveCell | Fires before the current cell changes ( Row and Col properties).
LeaveEdit | Fires after the control leaves edit mode.
LocationChanged (inherited from Control) | Event fired when the value of Location property is changed on Control
LostFocus (inherited from Control) | Occurs when the control gets focus.
MouseDown (inherited from Control) | Occurs when a mouse button is pressed.
MouseEnter (inherited from Control) | Occurs when the mouse enters the visible part of the control.
MouseHover (inherited from Control) | Occurs when the mouse remains stationary inside of the control for an amount of time.
MouseHoverCell | Fires when the mouse enters or leaves a cell.
MouseLeave (inherited from Control) | Occurs when the mouse leaves the visible part of the control.
MouseMove (inherited from Control) | Occurs when the mouse is moved.
MouseUp (inherited from Control) | Occurs when a mouse button is released.
MouseWheel (inherited from Control) | Occurs when the mouse wheel is rolled.
Move (inherited from Control) | Occurs when a control is moved.
OwnerDrawCell | Fires before the grid draws a cell, when the DrawMode property is set to DrawModeEnum.OwnerDraw.
Paint (inherited from Control) | Occurs when a control needs repainting.
ParentChanged (inherited from Control) | Event fired when the value of Parent property is changed on Control
PrintPage | Fires after the grid finishes printing a page.
QueryAccessibilityHelp (inherited from Control) | Occurs when an Accessibility client invokes help for the control.
QueryContinueDrag (inherited from Control) | Occurs when the mouse drags an item. The system requests whether the drag and drop operation should be allowed to continue.
Resize (inherited from Control) | Occurs when a control is resized.
RightToLeftChanged (inherited from Control) | Event fired when the value of RightToLeft property is changed on Control
RowColChange | Fires after the current cell changes ( Row and Col properties).
SelChange | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
SetUnboundValue | Fires when the grid needs to store data in an unbound cell.
SetupEditor | Fires after a cell editor has been initialized by the grid, to allow additional custom initialization.
SizeChanged (inherited from Control) | Event fired when the value of Size property is changed on Control
StartDrag | Fires before the grid starts an automatic OLE drag operation.
StartEdit | Fires before the control enters edit mode.
StyleChanged (inherited from Control) | Event fired when the window style of a Control is changed
SystemColorsChanged (inherited from Control) | Event fired when the system colors change
TabIndexChanged (inherited from Control) | Event fired when the value of TabIndex property is changed on Control
TabStopChanged (inherited from Control) | Event fired when the value of TabStop property is changed on Control
TextChanged (inherited from Control) | Event fired when the value of Text property is changed on Control
Validated (inherited from Control) | Occurs after a control has been successfully validated.
ValidateEdit | Fires before the control exits cell edit mode, while the editor is still active.
Validating (inherited from Control) | Occurs when a control is being validated. Set to True the Cancel property on the event parameter to cancel the validation.
VisibleChanged (inherited from Control) | Occurs when the control's visibility changes.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterAddRow Event

C1FlexGridBase.AfterAddRow Event

Fires after a new row is added by the user.

[Visual Basic]

Public Event AfterAddRow As RowColEventHandler

[C#]

public event RowColEventHandler AfterAddRow

[Delphi]

public property AfterAddRow: RowColEventHandler read remove_AfterAddRow write add_AfterAddRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterCollapse Event

C1FlexGridBase.AfterCollapse Event

Fires after a node row is collapsed or expanded.

[Visual Basic]

Public Event AfterCollapse As RowColEventHandler

[C#]

public event RowColEventHandler AfterCollapse

[Delphi]

public property AfterCollapse: RowColEventHandler read remove_AfterCollapse write add_AfterCollapse;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterDataRefresh Event

C1FlexGridBase.AfterDataRefresh Event

Fires after any data source change notifications.

[Visual Basic]

Public Event AfterDataRefresh As ListChangedEventHandler

[C#]

public event ListChangedEventHandler AfterDataRefresh

[Delphi]

public property AfterDataRefresh: ListChangedEventHandler read remove_AfterDataRefresh write add_AfterDataRefresh;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterDeleteRow Event

C1FlexGridBase.AfterDeleteRow Event

Fires after one or more rows are deleted by the user.

[Visual Basic]

Public Event AfterDeleteRow As RowColEventHandler

[C#]

public event RowColEventHandler AfterDeleteRow

[Delphi]

public property AfterDeleteRow: RowColEventHandler read remove_AfterDeleteRow write add_AfterDeleteRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterDragColumn Event

C1FlexGridBase.AfterDragColumn Event

Fires after the user finishes dragging a column.

[Visual Basic]

Public Event AfterDragColumn As DragRowColEventHandler

[C#]

public event DragRowColEventHandler AfterDragColumn

[Delphi]

public property AfterDragColumn: DragRowColEventHandler read remove_AfterDragColumn write add_AfterDragColumn;

Remarks

This event only fires when the user drags a column using the mouse.

It does not fire when a column is moved using the Move method.

You can prevent specific columns from being dragged by the user by setting their AllowDragging property to False.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterDragRow Event

C1FlexGridBase.AfterDragRow Event

Fires after the user finishes dragging a row.

[Visual Basic]

Public Event AfterDragRow As DragRowColEventHandler

[C#]

public event DragRowColEventHandler AfterDragRow

[Delphi]

public property AfterDragRow: DragRowColEventHandler read remove_AfterDragRow write add_AfterDragRow;

Remarks

This event only fires when the user drags a row using the mouse.

It does not fire when a row is moved using the Move method.

You can prevent specific rows from being dragged by the user by setting their Row property to False.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterEdit Event

C1FlexGridBase.AfterEdit Event

Fires after a cell has been edited.

[Visual Basic]

Public Event AfterEdit As RowColEventHandler

[C#]

public event RowColEventHandler AfterEdit

[Delphi]

public property AfterEdit: RowColEventHandler read remove_AfterEdit write add_AfterEdit;

Remarks

This event does not fire if the user cancels the edits by pressing the ESC key.

The LeaveEdit event fires whenever the grid leaves edit mode, even if the edits were canceled.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterFreezeColumn Event

C1FlexGridBase.AfterFreezeColumn Event

Fires after columns are frozen by dragging the frozen column divider.

[Visual Basic]

Public Event AfterFreezeColumn As RowColEventHandler

[C#]

public event RowColEventHandler AfterFreezeColumn

[Delphi]

public property AfterFreezeColumn: RowColEventHandler read remove_AfterFreezeColumn write add_AfterFreezeColumn;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterFreezeRow Event

C1FlexGridBase.AfterFreezeRow Event

Fires after rows are frozen by dragging the frozen row divider.

[Visual Basic]

Public Event AfterFreezeRow As RowColEventHandler

[C#]

public event RowColEventHandler AfterFreezeRow

[Delphi]

public property AfterFreezeRow: RowColEventHandler read remove_AfterFreezeRow write add_AfterFreezeRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterResizeColumn Event

C1FlexGridBase.AfterResizeColumn Event

Fires after a column is resized by dragging the column header.

[Visual Basic]

Public Event AfterResizeColumn As RowColEventHandler

[C#]

public event RowColEventHandler AfterResizeColumn

[Delphi]

public property AfterResizeColumn: RowColEventHandler read remove_AfterResizeColumn write add_AfterResizeColumn;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterResizeRow Event

C1FlexGridBase.AfterResizeRow Event

Fires after a row is resized by dragging the row header.

[Visual Basic]

Public Event AfterResizeRow As RowColEventHandler

[C#]

public event RowColEventHandler AfterResizeRow

[Delphi]

public property AfterResizeRow: RowColEventHandler read remove_AfterResizeRow write add_AfterResizeRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterRowColChange Event

C1FlexGridBase.AfterRowColChange Event

Fires after the current cell changes ( Row and Col properties).

[Visual Basic]

Public Event AfterRowColChange As RangeEventHandler

[C#]

public event RangeEventHandler AfterRowColChange

[Delphi]

public property AfterRowColChange: RangeEventHandler read remove_AfterRowColChange write add_AfterRowColChange;

Remarks

This event fires before the Row or Col properties change, either as a result of user actions (mouse or keyboard) or through code. It allows you to display additional information about the currently selected row, column, or cell.

To perform validation or prevent certain cells from being selected, use the BeforeRowColChange and BeforeSelChange events instead.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterScroll Event

C1FlexGridBase.AfterScroll Event

Fires after the grid scrolls.

[Visual Basic]

Public Event AfterScroll As RangeEventHandler

[C#]

public event RangeEventHandler AfterScroll

[Delphi]

public property AfterScroll: RangeEventHandler read remove_AfterScroll write add_AfterScroll;

Remarks

This event allows you to prevent the user from scrolling the grid while an operation is being performed on the current selection.

Example

The code below prevents the grid from scrolling while the grid is in edit mode.

private void _flex_BeforeScroll(object sender, C1.Win.C1FlexGrid.RangeEventArgs e)

{

if (_flex.Editor != null)

e.Cancel = true;

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterSelChange Event

C1FlexGridBase.AfterSelChange Event

Fires after the selection changes ( Row, Col, RowSel, ColSel properties).

[Visual Basic]

Public Event AfterSelChange As RangeEventHandler

[C#]

public event RangeEventHandler AfterSelChange

[Delphi]

public property AfterSelChange: RangeEventHandler read remove_AfterSelChange write add_AfterSelChange;

Remarks

This event is fired after the RowSel or ColSel properties change, either as a result of user actions (mouse or keyboard) or through code.

This event is useful if you want to display additional information about the current selection. To perform validation or prevent certain cells from being selected, use the BeforeRowColChange and BeforeSelChange events instead.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.AfterSort Event

C1FlexGridBase.AfterSort Event

Fires after a column is sorted by a click on a column header.

[Visual Basic]

Public Event AfterSort As SortColEventHandler

[C#]

public event SortColEventHandler AfterSort

[Delphi]

public property AfterSort: SortColEventHandler read remove_AfterSort write add_AfterSort;

Remarks

This event only fires if the sorting was caused by a click on a column header cell (see the AllowSorting property). It does not fire after sorting with the Sort (SortFlags, Int32) method.

This event is useful if you want to update user interface elements to reflect the new sorting. To prevent certain columns from being sorted, or to alter their default sorting order, use the Col or handle the BeforeSort event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeAddRow Event

C1FlexGridBase.BeforeAddRow Event

Fires before a new row is added by the user.

[Visual Basic]

Public Event BeforeAddRow As RowColEventHandler

[C#]

public event RowColEventHandler BeforeAddRow

[Delphi]

public property BeforeAddRow: RowColEventHandler read remove_BeforeAddRow write add_BeforeAddRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeAutosizeColumn Event

C1FlexGridBase.BeforeAutosizeColumn Event

Fires before a column is automatically resized by a double-click on a column header.

[Visual Basic]

Public Event BeforeAutosizeColumn As RowColEventHandler

[C#]

public event RowColEventHandler BeforeAutosizeColumn

[Delphi]

public property BeforeAutosizeColumn: RowColEventHandler read remove_BeforeAutosizeColumn write add_BeforeAutosizeColumn;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeAutosizeRow Event

C1FlexGridBase.BeforeAutosizeRow Event

Fires before a row is automatically resized by a double-click on a row header.

[Visual Basic]

Public Event BeforeAutosizeRow As RowColEventHandler

[C#]

public event RowColEventHandler BeforeAutosizeRow

[Delphi]

public property BeforeAutosizeRow: RowColEventHandler read remove_BeforeAutosizeRow write add_BeforeAutosizeRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeCollapse Event

C1FlexGridBase.BeforeCollapse Event

Fires before a node row is collapsed or expanded.

[Visual Basic]

Public Event BeforeCollapse As RowColEventHandler

[C#]

public event RowColEventHandler BeforeCollapse

[Delphi]

public property BeforeCollapse: RowColEventHandler read remove_BeforeCollapse write add_BeforeCollapse;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeDeleteRow Event

C1FlexGridBase.BeforeDeleteRow Event

Fires before a row is deleted by the user.

[Visual Basic]

Public Event BeforeDeleteRow As RowColEventHandler

[C#]

public event RowColEventHandler BeforeDeleteRow

[Delphi]

public property BeforeDeleteRow: RowColEventHandler read remove_BeforeDeleteRow write add_BeforeDeleteRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeDoubleClick Event

C1FlexGridBase.BeforeDoubleClick Event

Fires before the DoubleClick event is handled by the grid.

[Visual Basic]

Public Event BeforeDoubleClick As BeforeMouseDownEventHandler

[C#]

public event BeforeMouseDownEventHandler BeforeDoubleClick

[Delphi]

public property BeforeDoubleClick: BeforeMouseDownEventHandler read remove_BeforeDoubleClick write add_BeforeDoubleClick;

Remarks

This event fires before the grid processes the System.Windows.Forms.Control.DoubleClick event, and gives the program a chance to customize the behavior of the control and optionally cancel the default handling of the mouse.

Example

The code below handles the BeforeDoubleClick event to detect double-clicks on cells in a specific column and provide a custom edit dialog instead of using the built-in editor.

private void _flex_BeforeDoubleClick(object sender, C1.Win.C1FlexGrid.BeforeMouseDownEventArgs e)

{

// detect double-clicks on column "Customer"

HitTestInfo hti = _flex.HitTest(e.X, e.Y);

if (hti.Type == HitTestTypeEnum.Cell && _flex[hti.Column].Name == "Customer")

{

e.Cancel = true; // cancel default handling

ShowCustomEditDialog(hti.Row, hti.Column); // handle row drag/drop

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeDragColumn Event

C1FlexGridBase.BeforeDragColumn Event

Fires before the user starts dragging a column.

[Visual Basic]

Public Event BeforeDragColumn As DragRowColEventHandler

[C#]

public event DragRowColEventHandler BeforeDragColumn

[Delphi]

public property BeforeDragColumn: DragRowColEventHandler read remove_BeforeDragColumn write add_BeforeDragColumn;

Remarks

This event only fires when the user drags a column using the mouse.

It is does not fire when a column is moved using the Move method.

You can prevent specific columns from being dragged by the user by setting their AllowDragging property to False.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeDragRow Event

C1FlexGridBase.BeforeDragRow Event

Fires before the user starts dragging a row.

[Visual Basic]

Public Event BeforeDragRow As DragRowColEventHandler

[C#]

public event DragRowColEventHandler BeforeDragRow

[Delphi]

public property BeforeDragRow: DragRowColEventHandler read remove_BeforeDragRow write add_BeforeDragRow;

Remarks

This event only fires when the user drags a row using the mouse.

It does not fire when a row is moved using the Move method.

You can prevent specific rows from being dragged by the user by setting their Row property to False.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeEdit Event

C1FlexGridBase.BeforeEdit Event

Fires before the grid enters edit mode, and also when the cell that has the focus needs to be painted.

[Visual Basic]

Public Event BeforeEdit As RowColEventHandler

[C#]

public event RowColEventHandler BeforeEdit

[Delphi]

public property BeforeEdit: RowColEventHandler read remove_BeforeEdit write add_BeforeEdit;

Remarks

This event doesn't fire only when the grid is about to enter edit mode.

It also fires while painting cells, in order to support drawing the editor's drop-down buttons.

The StartEdit event fires only when the grid is about to enter edit mode.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeFreezeColumn Event

C1FlexGridBase.BeforeFreezeColumn Event

Fires before columns are frozen by dragging the frozen column divider.

[Visual Basic]

Public Event BeforeFreezeColumn As RowColEventHandler

[C#]

public event RowColEventHandler BeforeFreezeColumn

[Delphi]

public property BeforeFreezeColumn: RowColEventHandler read remove_BeforeFreezeColumn write add_BeforeFreezeColumn;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeFreezeRow Event

C1FlexGridBase.BeforeFreezeRow Event

Fires before rows are frozen by dragging the frozen row divider.

[Visual Basic]

Public Event BeforeFreezeRow As RowColEventHandler

[C#]

public event RowColEventHandler BeforeFreezeRow

[Delphi]

public property BeforeFreezeRow: RowColEventHandler read remove_BeforeFreezeRow write add_BeforeFreezeRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeMouseDown Event

C1FlexGridBase.BeforeMouseDown Event

Fires before the System.Windows.Forms.Control.MouseDown event is handled by the grid.

[Visual Basic]

Public Event BeforeMouseDown As BeforeMouseDownEventHandler

[C#]

public event BeforeMouseDownEventHandler BeforeMouseDown

[Delphi]

public property BeforeMouseDown: BeforeMouseDownEventHandler read remove_BeforeMouseDown write add_BeforeMouseDown;

Remarks

This event fires before the grid processes the System.Windows.Forms.Control.MouseDown event, and gives the program a chance to customize the behavior of the control and optionally cancel the default handling of the mouse.

Example

The code below handles the BeforeMouseDown event to detect clicks on row headers and provide OLE drag and drop functionality.

private void _flex_BeforeMouseDown(object sender, C1.Win.C1FlexGrid.BeforeMouseDownEventArgs e)

{

// start dragging when the user clicks the row headers

HitTestInfo hti = _flex.HitTest(e.X, e.Y);

if (hti.Type == HitTestTypeEnum.RowHeader)

{

e.Cancel = true; // cancel default handling

HandleRowDragDrop(hti.Row); // handle row drag/drop

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforePageBreak Event

C1FlexGridBase.BeforePageBreak Event

Fires while the control is being printed to provide control over page breaks.

[Visual Basic]

Public Event BeforePageBreak As RowColEventHandler

[C#]

public event RowColEventHandler BeforePageBreak

[Delphi]

public property BeforePageBreak: RowColEventHandler read remove_BeforePageBreak write add_BeforePageBreak;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeResizeColumn Event

C1FlexGridBase.BeforeResizeColumn Event

Fires before a column is resized by dragging the column header.

[Visual Basic]

Public Event BeforeResizeColumn As RowColEventHandler

[C#]

public event RowColEventHandler BeforeResizeColumn

[Delphi]

public property BeforeResizeColumn: RowColEventHandler read remove_BeforeResizeColumn write add_BeforeResizeColumn;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeResizeRow Event

C1FlexGridBase.BeforeResizeRow Event

Fires before a row is resized by dragging the row header.

[Visual Basic]

Public Event BeforeResizeRow As RowColEventHandler

[C#]

public event RowColEventHandler BeforeResizeRow

[Delphi]

public property BeforeResizeRow: RowColEventHandler read remove_BeforeResizeRow write add_BeforeResizeRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeRowColChange Event

C1FlexGridBase.BeforeRowColChange Event

Fires before the current cell changes ( Row and Col properties).

[Visual Basic]

Public Event BeforeRowColChange As RangeEventHandler

[C#]

public event RangeEventHandler BeforeRowColChange

[Delphi]

public property BeforeRowColChange: RangeEventHandler read remove_BeforeRowColChange write add_BeforeRowColChange;

Remarks

This event fires before the Row or Col properties change, either as a result of user actions or through code. It allows you to prevent the selection of certain cells, thus creating "protected" ranges on a grid.

BeforeRowColChange fires only when the Row or Col properties are about to change. To detect extended selections, you also need to handle the BeforeSelChange event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeScroll Event

C1FlexGridBase.BeforeScroll Event

Fires before the grid scrolls.

[Visual Basic]

Public Event BeforeScroll As RangeEventHandler

[C#]

public event RangeEventHandler BeforeScroll

[Delphi]

public property BeforeScroll: RangeEventHandler read remove_BeforeScroll write add_BeforeScroll;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeScrollTip Event

C1FlexGridBase.BeforeScrollTip Event

Fires before the vertical scrolltip is displayed.

[Visual Basic]

Public Event BeforeScrollTip As RowColEventHandler

[C#]

public event RowColEventHandler BeforeScrollTip

[Delphi]

public property BeforeScrollTip: RowColEventHandler read remove_BeforeScrollTip write add_BeforeScrollTip;

Remarks

This event fires only if the ScrollTips property is set to True. It allows you to set the ScrollTipText property to a descriptive string for the given row.

Example

The code below uses the BeforeScrollTip event to display a scroll tip showing the value of the first cell that will become visible when the user stops scrolling.

_flex.ScrollTips = true;

_flex.ScrollTrack = false;

private void _flex_BeforeScrollTip(object sender, RowColEventArgs e)

{

string tip = string.Format("Row {0}\n{1}", e.Row, _flex[e.Row,1]);

_flex.ScrollTipText = tip;

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeSelChange Event

C1FlexGridBase.BeforeSelChange Event

Fires before the selection changes ( Row, Col, RowSel, ColSel properties).

[Visual Basic]

Public Event BeforeSelChange As RangeEventHandler

[C#]

public event RangeEventHandler BeforeSelChange

[Delphi]

public property BeforeSelChange: RangeEventHandler read remove_BeforeSelChange write add_BeforeSelChange;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeforeSort Event

C1FlexGridBase.BeforeSort Event

Fires before a column is sorted by a click on a column header.

[Visual Basic]

Public Event BeforeSort As SortColEventHandler

[C#]

public event SortColEventHandler BeforeSort

[Delphi]

public property BeforeSort: SortColEventHandler read remove_BeforeSort write add_BeforeSort;

Remarks

This event only fires if the sorting was caused by a click on a column header. It does not fire before sorting with the Sort (SortFlags, Int32) method.

This event is useful when you want to prevent the user from sorting certain columns or to specify custom sorting orders for specific columns. You may do so by modifying the value of the Order parameter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.BeginPrint Event

C1FlexGridBase.BeginPrint Event

Fires before the grid starts printing.

[Visual Basic]

Public Event BeginPrint As PrintEventHandler

[C#]

public event PrintEventHandler BeginPrint

[Delphi]

public property BeginPrint: PrintEventHandler read remove_BeginPrint write add_BeginPrint;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CancelAddRow Event

C1FlexGridBase.CancelAddRow Event

Fires when the cursor leaves the new row without making any changes to it.

[Visual Basic]

Public Event CancelAddRow As RowColEventHandler

[C#]

public event RowColEventHandler CancelAddRow

[Delphi]

public property CancelAddRow: RowColEventHandler read remove_CancelAddRow write add_CancelAddRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CellButtonClick Event

C1FlexGridBase.CellButtonClick Event

Fires after the user clicks a cell button.

[Visual Basic]

Public Event CellButtonClick As RowColEventHandler

[C#]

public event RowColEventHandler CellButtonClick

[Delphi]

public property CellButtonClick: RowColEventHandler read remove_CellButtonClick write add_CellButtonClick;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.CellChanged Event

C1FlexGridBase.CellChanged Event

Fires after the contents of a cell have changed.

[Visual Basic]

Public Event CellChanged As RowColEventHandler

[C#]

public event RowColEventHandler CellChanged

[Delphi]

public property CellChanged: RowColEventHandler read remove_CellChanged write add_CellChanged;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ChangeEdit Event

C1FlexGridBase.ChangeEdit Event

Fires in edit mode, after the contents of the editor change.

[Visual Basic]

Public Event ChangeEdit As EventHandler

[C#]

public event EventHandler ChangeEdit

[Delphi]

public property ChangeEdit: EventHandler read remove_ChangeEdit write add_ChangeEdit;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ComboCloseUp Event

C1FlexGridBase.ComboCloseUp Event

Fires in edit mode, when the dropdown portion of an editor closes.

[Visual Basic]

Public Event ComboCloseUp As RowColEventHandler

[C#]

public event RowColEventHandler ComboCloseUp

[Delphi]

public property ComboCloseUp: RowColEventHandler read remove_ComboCloseUp write add_ComboCloseUp;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ComboDropDown Event

C1FlexGridBase.ComboDropDown Event

Fires in edit mode, when the dropdown portion of an editor opens.

[Visual Basic]

Public Event ComboDropDown As RowColEventHandler

[C#]

public event RowColEventHandler ComboDropDown

[Delphi]

public property ComboDropDown: RowColEventHandler read remove_ComboDropDown write add_ComboDropDown;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.EndPrint Event

C1FlexGridBase.EndPrint Event

Fires after the grid finishes printing.

[Visual Basic]

Public Event EndPrint As PrintEventHandler

[C#]

public event PrintEventHandler EndPrint

[Delphi]

public property EndPrint: PrintEventHandler read remove_EndPrint write add_EndPrint;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.EnterCell Event

C1FlexGridBase.EnterCell Event

Fires after the current cell changes ( Row and Col properties).

[Visual Basic]

Public Event EnterCell As EventHandler

[C#]

public event EventHandler EnterCell

[Delphi]

public property EnterCell: EventHandler read remove_EnterCell write add_EnterCell;

Remarks

This event fires after the cursor enters a cell, either as a result of user actions (mouse or keyboard), or through code.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetCellErrorInfo Event

C1FlexGridBase.GetCellErrorInfo Event

Fires when ShowErrors is set to True and the control needs error information for a cell.

[Visual Basic]

Public Event GetCellErrorInfo As GetErrorInfoEventHandler

[C#]

public event GetErrorInfoEventHandler GetCellErrorInfo

[Delphi]

public property GetCellErrorInfo: GetErrorInfoEventHandler read remove_GetCellErrorInfo write add_GetCellErrorInfo;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetRowErrorInfo Event

C1FlexGridBase.GetRowErrorInfo Event

Fires when ShowErrors is set to True and the control needs error information for a row.

[Visual Basic]

Public Event GetRowErrorInfo As GetErrorInfoEventHandler

[C#]

public event GetErrorInfoEventHandler GetRowErrorInfo

[Delphi]

public property GetRowErrorInfo: GetErrorInfoEventHandler read remove_GetRowErrorInfo write add_GetRowErrorInfo;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GetUnboundValue Event

C1FlexGridBase.GetUnboundValue Event

Fires when the grid needs to retrieve data for an unbound cell.

[Visual Basic]

Public Event GetUnboundValue As UnboundValueEventHandler

[C#]

public event UnboundValueEventHandler GetUnboundValue

[Delphi]

public property GetUnboundValue: UnboundValueEventHandler read remove_GetUnboundValue write add_GetUnboundValue;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GridChanged Event

C1FlexGridBase.GridChanged Event

Fires when the grid or its contents change.

[Visual Basic]

Public Event GridChanged As GridChangedEventHandler

[C#]

public event GridChangedEventHandler GridChanged

[Delphi]

public property GridChanged: GridChangedEventHandler read remove_GridChanged write add_GridChanged;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.GridError Event

C1FlexGridBase.GridError Event

Fires after the data source reports an error condition.

[Visual Basic]

Public Event GridError As GridErrorEventHandler

[C#]

public event GridErrorEventHandler GridError

[Delphi]

public property GridError: GridErrorEventHandler read remove_GridError write add_GridError;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.KeyDownEdit Event

C1FlexGridBase.KeyDownEdit Event

Fires in edit mode, when the user presses a key.

[Visual Basic]

Public Event KeyDownEdit As KeyEditEventHandler

[C#]

public event KeyEditEventHandler KeyDownEdit

[Delphi]

public property KeyDownEdit: KeyEditEventHandler read remove_KeyDownEdit write add_KeyDownEdit;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.KeyPressEdit Event

C1FlexGridBase.KeyPressEdit Event

Fires in edit mode, when the user presses a character key.

[Visual Basic]

Public Event KeyPressEdit As KeyPressEditEventHandler

[C#]

public event KeyPressEditEventHandler KeyPressEdit

[Delphi]

public property KeyPressEdit: KeyPressEditEventHandler read remove_KeyPressEdit write add_KeyPressEdit;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.KeyUpEdit Event

C1FlexGridBase.KeyUpEdit Event

Fires in edit mode, when the user releases a key.

[Visual Basic]

Public Event KeyUpEdit As KeyEditEventHandler

[C#]

public event KeyEditEventHandler KeyUpEdit

[Delphi]

public property KeyUpEdit: KeyEditEventHandler read remove_KeyUpEdit write add_KeyUpEdit;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LeaveCell Event

C1FlexGridBase.LeaveCell Event

Fires before the current cell changes ( Row and Col properties).

[Visual Basic]

Public Event LeaveCell As EventHandler

[C#]

public event EventHandler LeaveCell

[Delphi]

public property LeaveCell: EventHandler read remove_LeaveCell write add_LeaveCell;

Remarks

This event fires before the cursor leaves the current cell, either as a result of user actions (mouse or keyboard), or through code.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.LeaveEdit Event

C1FlexGridBase.LeaveEdit Event

Fires after the control leaves edit mode.

[Visual Basic]

Public Event LeaveEdit As RowColEventHandler

[C#]

public event RowColEventHandler LeaveEdit

[Delphi]

public property LeaveEdit: RowColEventHandler read remove_LeaveEdit write add_LeaveEdit;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.MouseHoverCell Event

C1FlexGridBase.MouseHoverCell Event

Fires when the mouse enters or leaves a cell.

[Visual Basic]

Public Event MouseHoverCell As EventHandler

[C#]

public event EventHandler MouseHoverCell

[Delphi]

public property MouseHoverCell: EventHandler read remove_MouseHoverCell write add_MouseHoverCell;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.OwnerDrawCell Event

C1FlexGridBase.OwnerDrawCell Event

Fires before the grid draws a cell, when the DrawMode property is set to DrawModeEnum.OwnerDraw.

[Visual Basic]

Public Event OwnerDrawCell As OwnerDrawCellEventHandler

[C#]

public event OwnerDrawCellEventHandler OwnerDrawCell

[Delphi]

public property OwnerDrawCell: OwnerDrawCellEventHandler read remove_OwnerDrawCell write add_OwnerDrawCell;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.PrintPage Event

C1FlexGridBase.PrintPage Event

Fires after the grid finishes printing a page.

[Visual Basic]

Public Event PrintPage As PrintPageEventHandler

[C#]

public event PrintPageEventHandler PrintPage

[Delphi]

public property PrintPage: PrintPageEventHandler read remove_PrintPage write add_PrintPage;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.RowColChange Event

C1FlexGridBase.RowColChange Event

Fires after the current cell changes ( Row and Col properties).

[Visual Basic]

Public Event RowColChange As EventHandler

[C#]

public event EventHandler RowColChange

[Delphi]

public property RowColChange: EventHandler read remove_RowColChange write add_RowColChange;

Remarks

RowColChange fires when the Row or Col properties change, either as a result of user actions (mouse or keyboard) or through code.

This event does not fire when the selection changes (RowSel or ColSel properties) but the active cell (Row, Col) remains the same. In this case, the SelChange event fires instead.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SelChange Event

C1FlexGridBase.SelChange Event

Fires after the selection changes ( Row, Col, RowSel, ColSel properties).

[Visual Basic]

Public Event SelChange As EventHandler

[C#]

public event EventHandler SelChange

[Delphi]

public property SelChange: EventHandler read remove_SelChange write add_SelChange;

Remarks

SelChange fires after the Row, Col, RowSel, or ColSel properties change, either as a result of user actions (mouse or keyboard) or through code.

This event also fires while the user extends the selection with the mouse.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetUnboundValue Event

C1FlexGridBase.SetUnboundValue Event

Fires when the grid needs to store data in an unbound cell.

[Visual Basic]

Public Event SetUnboundValue As UnboundValueEventHandler

[C#]

public event UnboundValueEventHandler SetUnboundValue

[Delphi]

public property SetUnboundValue: UnboundValueEventHandler read remove_SetUnboundValue write add_SetUnboundValue;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.SetupEditor Event

C1FlexGridBase.SetupEditor Event

Fires after a cell editor has been initialized by the grid, to allow additional custom initialization.

[Visual Basic]

Public Event SetupEditor As RowColEventHandler

[C#]

public event RowColEventHandler SetupEditor

[Delphi]

public property SetupEditor: RowColEventHandler read remove_SetupEditor write add_SetupEditor;

Remarks

This event can be used to customize the behavior of the cell editor by setting properties on the editor control.

For example, the code below checks to see if the editor being used is a TextBox, and then sets the editor's CharacterCasing and MaxLength properties.

private void _flex_SetupEditor(object sender, RowColEventArgs e)

{

TextBox tb = _flex.Editor as TextBox;

if (tb != null)

{

if (_flex.Cols[e.Col].Name == "ID")

tb.MaxLength = 4;

else

tb.MaxLength = 32000;

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.StartDrag Event

C1FlexGridBase.StartDrag Event

Fires before the grid starts an automatic OLE drag operation.

[Visual Basic]

Public Event StartDrag As DragEventHandler

[C#]

public event DragEventHandler StartDrag

[Delphi]

public property StartDrag: DragEventHandler read remove_StartDrag write add_StartDrag;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.StartEdit Event

C1FlexGridBase.StartEdit Event

Fires before the control enters edit mode.

[Visual Basic]

Public Event StartEdit As RowColEventHandler

[C#]

public event RowColEventHandler StartEdit

[Delphi]

public property StartEdit: RowColEventHandler read remove_StartEdit write add_StartEdit;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridBase.ValidateEdit Event

C1FlexGridBase.ValidateEdit Event

Fires before the control exits cell edit mode, while the editor is still active.

[Visual Basic]

Public Event ValidateEdit As ValidateEditEventHandler

[C#]

public event ValidateEditEventHandler ValidateEdit

[Delphi]

public property ValidateEdit: ValidateEditEventHandler read remove_ValidateEdit write add_ValidateEdit;

Remarks

When this event fires, the contents of the editor have not been applied to the grid. You can validate the editor contents and cancel the edits if necessary. For example, the code below checks to make sure the value entered is an integer between 0 and 100:

private void _flex_ValidateEdit(object sender, ValidateEditEventArgs e)

{

if (_flex.Cols[e.Col].Name = "Score")

{

try

{

int value = int.Parse(_flex.Editor.Text);

if (value >= 0 && value <= 50)

return; // accept edits

}

catch {}

// error or invalid range, refuse edits

e.Cancel = true;

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellBorder Class

CellBorder Class

The CellBorder class encapsulates properties that control the appearance of borders in CellStyle objects.

For a list of all members of this type, see CellBorder Members.

System.Object

C1.Win.C1FlexGrid.CellBorder

[Visual Basic]

Public Class CellBorder

[C#]

public class CellBorder

[Delphi]

type CellBorder = class;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellBorder Members

CellBorder Members

CellBorder overview

Public Properties

Color | Gets or sets the border color (except for 3D borders).
Direction | Gets or sets the border direction.
Style | Gets or sets the border style.
Width | Gets or sets the border width (except for 3D borders).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellBorder Properties

CellBorder Properties

The properties of the CellBorder class are listed here. For a complete list of CellBorder class members, see the CellBorder Members topic.

Public Properties

Color | Gets or sets the border color (except for 3D borders).
Direction | Gets or sets the border direction.
Style | Gets or sets the border style.
Width | Gets or sets the border width (except for 3D borders).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellBorder.Color Property

CellBorder.Color Property

Gets or sets the border color (except for 3D borders).

[Visual Basic]

Public Property Color As Color

[C#]

public Color Color {get;set;}

[Delphi]

public property Color: Color read get_Color write set_Color;

Remarks

3D borders are always drawn using the system colors defined for highlights and shadows.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellBorder.Direction Property

CellBorder.Direction Property

Gets or sets the border direction.

[Visual Basic]

Public Property Direction As BorderDirEnum

[C#]

public BorderDirEnum Direction {get;set;}

[Delphi]

public property Direction: BorderDirEnum read get_Direction write set_Direction;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellBorder.Style Property

CellBorder.Style Property

Gets or sets the border style.

[Visual Basic]

Public Property Style As BorderStyleEnum

[C#]

public BorderStyleEnum Style {get;set;}

[Delphi]

public property Style: BorderStyleEnum read get_Style write set_Style;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellBorder.Width Property

CellBorder.Width Property

Gets or sets the border width (except for 3D borders).

[Visual Basic]

Public Property Width As Integer

[C#]

public int Width {get;set;}

[Delphi]

public property Width: Int32 read get_Width write set_Width;

Remarks

3D borders are always one or two pixels wide.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange Structure

CellRange Structure

Encapsulates properties of cell ranges, allowing the called to set properties for a group of cells with a single statement.

For a list of all members of this type, see CellRange Members.

System.Object

System.ValueType

C1.Win.C1FlexGrid.CellRange

[Visual Basic]

Public Structure CellRange

[C#]

public struct CellRange

[Delphi]

type CellRange = record;

Remarks

The CellRange structure does not have a public constructor. To create a CellRange object, use the GetCellRange (Int32, Int32) method.

Note that CellRange is a structure, not a class. This means the object is used as a value, not as a reference. If you pass a CellRange to a method and change the object within that method, the original value is not modified.

Ranges are defined by two rows and two columns (r1, c1, r2, and c2). These values do not have to be in order (r1 may be smaller or greater than r2). To obtain the values in order, use the Normalize method or the TopRow, BottomRow, LeftCol, and RightCol properties.

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange Members

CellRange Members

CellRange overview

Public Fields

c1 | Gets or sets the range's first column index.
c2 | Gets or sets the range's last column index.
r1 | Gets or sets the range's first row index.
r2 | Gets or sets the range's last row index.

Public Properties

BottomRow | Gets the index of the bottom row in the range.
Checkbox | Gets or sets the state of the checkbox in the range.
Clip | Gets or sets a string containing the values of all cells in the range.
Data | Gets or sets the data stored in every cell in the range.
DataDisplay | Gets the value in cell ( r1, c1), formatted as a string.
Image | Gets or sets the Image assigned to cells in the range.
IsSingleCell | Gets a value that indicates if the range contains a single cell.
IsValid | Gets a value that indicates if the range contains valid row and column indices.
LeftCol | Gets the index of the left column in the range.
RightCol | Gets the index of the right column in the range.
Style | Gets or sets the style used to display every cell in the range.
StyleDisplay | Gets the style used to render cell ( r1, c1).
StyleNew | Gets or sets the style used to display every cell in the range, creating a new style if necessary.
TopRow | Gets the index of the top row in the range.
UserData | Gets or sets arbitrary used data assigned to cells in the range.

Public Methods

Clear | Clears selected elements from the range.
Contains | Determines whether the range contains a given cell.
ContainsCol | Determines whether the range contains a given column.
ContainsRow | Determines whether the range contains a given row.
Normalize | Normalizes the range so that r1 is the TopRow, r2 is the BottomRow, c1 is the LeftCol, and c2 is the RightCol.
ToString | Overriden. Gets a string representation for this object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange Fields

CellRange Fields

The fields of the CellRange structure are listed here. For a complete list of CellRange structure members, see the CellRange Members topic.

c1 | Gets or sets the range's first column index.
c2 | Gets or sets the range's last column index.
r1 | Gets or sets the range's first row index.
r2 | Gets or sets the range's last row index.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.c1 Field

CellRange.c1 Field

Gets or sets the range's first column index.

[Visual Basic]

Public c1 As Integer

[C#]

public int c1

[Delphi]

public c1: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.c2 Field

CellRange.c2 Field

Gets or sets the range's last column index.

[Visual Basic]

Public c2 As Integer

[C#]

public int c2

[Delphi]

public c2: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.r1 Field

CellRange.r1 Field

Gets or sets the range's first row index.

[Visual Basic]

Public r1 As Integer

[C#]

public int r1

[Delphi]

public r1: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.r2 Field

CellRange.r2 Field

Gets or sets the range's last row index.

[Visual Basic]

Public r2 As Integer

[C#]

public int r2

[Delphi]

public r2: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange Properties

CellRange Properties

The properties of the CellRange structure are listed here. For a complete list of CellRange structure members, see the CellRange Members topic.

BottomRow | Gets the index of the bottom row in the range.
Checkbox | Gets or sets the state of the checkbox in the range.
Clip | Gets or sets a string containing the values of all cells in the range.
Data | Gets or sets the data stored in every cell in the range.
DataDisplay | Gets the value in cell ( r1, c1), formatted as a string.
Image | Gets or sets the Image assigned to cells in the range.
IsSingleCell | Gets a value that indicates if the range contains a single cell.
IsValid | Gets a value that indicates if the range contains valid row and column indices.
LeftCol | Gets the index of the left column in the range.
RightCol | Gets the index of the right column in the range.
Style | Gets or sets the style used to display every cell in the range.
StyleDisplay | Gets the style used to render cell ( r1, c1).
StyleNew | Gets or sets the style used to display every cell in the range, creating a new style if necessary.
TopRow | Gets the index of the top row in the range.
UserData | Gets or sets arbitrary used data assigned to cells in the range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.BottomRow Property

CellRange.BottomRow Property

Gets the index of the bottom row in the range.

[Visual Basic]

Public ReadOnly Property BottomRow As Integer

[C#]

public int BottomRow {get;}

[Delphi]

public property BottomRow: Int32 read get_BottomRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.Checkbox Property

CellRange.Checkbox Property

Gets or sets the state of the checkbox in the range.

[Visual Basic]

Public Property Checkbox As CheckEnum

[C#]

public CheckEnum Checkbox {get;set;}

[Delphi]

public property Checkbox: CheckEnum read get_Checkbox write set_Checkbox;

Remarks

When getting, this property returns the checkbox value that corresponds to cell ( r1, c1). When setting, it applies the new value to all cells in the range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.Clip Property

CellRange.Clip Property

Gets or sets a string containing the values of all cells in the range.

[Visual Basic]

Public Property Clip As String

[C#]

public string Clip {get;set;}

[Delphi]

public property Clip: String read get_Clip write set_Clip;

Remarks

The cell values are delimited by characters specified by the ClipSeparators property.

By default, columns are separated by tabs (\t or vbTab) and rows by line breaks (\n or vbCr).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.Data Property

CellRange.Data Property

Gets or sets the data stored in every cell in the range.

[Visual Basic]

Public Property Data As Object

[C#]

public object Data {get;set;}

[Delphi]

public property Data: Object read get_Data write set_Data;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.DataDisplay Property

CellRange.DataDisplay Property

Gets the value in cell ( r1, c1), formatted as a string.

[Visual Basic]

Public ReadOnly Property DataDisplay As String

[C#]

public string DataDisplay {get;}

[Delphi]

public property DataDisplay: String read get_DataDisplay;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.Image Property

CellRange.Image Property

Gets or sets the Image assigned to cells in the range.

[Visual Basic]

Public Property Image As Image

[C#]

public Image Image {get;set;}

[Delphi]

public property Image: Image read get_Image write set_Image;

Remarks

When getting, this property returns the Image assigned to cell ( r1, c1). When setting, it applies the new value to all cells in the range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.IsSingleCell Property

CellRange.IsSingleCell Property

Gets a value that indicates if the range contains a single cell.

[Visual Basic]

Public ReadOnly Property IsSingleCell As Boolean

[C#]

public bool IsSingleCell {get;}

[Delphi]

public property IsSingleCell: Boolean read get_IsSingleCell;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.IsValid Property

CellRange.IsValid Property

Gets a value that indicates if the range contains valid row and column indices.

[Visual Basic]

Public ReadOnly Property IsValid As Boolean

[C#]

public bool IsValid {get;}

[Delphi]

public property IsValid: Boolean read get_IsValid;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.LeftCol Property

CellRange.LeftCol Property

Gets the index of the left column in the range.

[Visual Basic]

Public ReadOnly Property LeftCol As Integer

[C#]

public int LeftCol {get;}

[Delphi]

public property LeftCol: Int32 read get_LeftCol;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.RightCol Property

CellRange.RightCol Property

Gets the index of the right column in the range.

[Visual Basic]

Public ReadOnly Property RightCol As Integer

[C#]

public int RightCol {get;}

[Delphi]

public property RightCol: Int32 read get_RightCol;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.Style Property

CellRange.Style Property

Gets or sets the style used to display every cell in the range.

[Visual Basic]

Public Property Style As CellStyle

[C#]

public CellStyle Style {get;set;}

[Delphi]

public property Style: CellStyle read get_Style write set_Style;

Remarks

Getting or setting the range style ensures that every cell in the range has the same style.

Example

The code below creates a CellRange structure and uses it to apply a custom style to the entire range.

// create a style

CellStyle cs = _flex.Styles.Add("red");

cs.BackColor = Color.Red;

// create a cell range and assign it a style

CellRange rg = _flex.GetCellRange(1, 1, 5, 5);

rg.Style = cs;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.StyleDisplay Property

CellRange.StyleDisplay Property

Gets the style used to render cell ( r1, c1).

[Visual Basic]

Public ReadOnly Property StyleDisplay As CellStyle

[C#]

public CellStyle StyleDisplay {get;}

[Delphi]

public property StyleDisplay: CellStyle read get_StyleDisplay;

Remarks

This property never returns null. It will return the custom style assigned to the first cell in the range, to the cell's row, column, or a built-in style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.StyleNew Property

CellRange.StyleNew Property

Gets or sets the style used to display every cell in the range, creating a new style if necessary.

[Visual Basic]

Public ReadOnly Property StyleNew As CellStyle

[C#]

public CellStyle StyleNew {get;}

[Delphi]

public property StyleNew: CellStyle read get_StyleNew;

Remarks

This property never returns null. If the range does not have a style assigned to it, a new style will be created automatically.

Example

The code below creates a CellRange structure and uses it to apply a custom style to the entire range.

// create a cell range

CellRange rg = _flex.GetCellRange(1, 1, 5, 5);

// make sure range is red

rg.StyleNew.BackColor = Color.Red;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.TopRow Property

CellRange.TopRow Property

Gets the index of the top row in the range.

[Visual Basic]

Public ReadOnly Property TopRow As Integer

[C#]

public int TopRow {get;}

[Delphi]

public property TopRow: Int32 read get_TopRow;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.UserData Property

CellRange.UserData Property

Gets or sets arbitrary used data assigned to cells in the range.

[Visual Basic]

Public Property UserData As Object

[C#]

public object UserData {get;set;}

[Delphi]

public property UserData: Object read get_UserData write set_UserData;

Remarks

When getting, this property returns the user data assigned to cell ( r1, c1). When setting, it applies the new value to all cells in the range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange Methods

CellRange Methods

The methods of the CellRange structure are listed here. For a complete list of CellRange structure members, see the CellRange Members topic.

Clear | Clears selected elements from the range.
Contains | Determines whether the range contains a given cell.
ContainsCol | Determines whether the range contains a given column.
ContainsRow | Determines whether the range contains a given row.
Normalize | Normalizes the range so that r1 is the TopRow, r2 is the BottomRow, c1 is the LeftCol, and c2 is the RightCol.
ToString | Overriden. Gets a string representation for this object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.Clear Method

CellRange.Clear Method

Clears selected elements from the range.

[Visual Basic]

Public Sub Clear( _

ByVal clearFlags As ClearFlags _

)

[C#]

public void Clear(

ClearFlags clearFlags

);

[Delphi]

public procedure Clear(

clearFlags: ClearFlags

);

Parameters

clearFlags

ClearFlags value that specifies which elements should be cleared.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.Contains Method

CellRange.Contains Method

Determines whether the range contains a given cell.

[Visual Basic]

Public Function Contains( _

ByVal row As Integer, _

ByVal col As Integer _

) As Boolean

[C#]

public bool Contains(

int row,

int col

);

[Delphi]

public function Contains(

row: Int32;

col: Int32

): Boolean;

Parameters

row

Index of the row to check.

col

Index of the column to check.

Return Value

True if the range contains the cell, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.ContainsCol Method

CellRange.ContainsCol Method

Determines whether the range contains a given column.

[Visual Basic]

Public Function ContainsCol( _

ByVal col As Integer _

) As Boolean

[C#]

public bool ContainsCol(

int col

);

[Delphi]

public function ContainsCol(

col: Int32

): Boolean;

Parameters

col

Index of the column to check.

Return Value

True if the range contains the column, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.ContainsRow Method

CellRange.ContainsRow Method

Determines whether the range contains a given row.

[Visual Basic]

Public Function ContainsRow( _

ByVal row As Integer _

) As Boolean

[C#]

public bool ContainsRow(

int row

);

[Delphi]

public function ContainsRow(

row: Int32

): Boolean;

Parameters

row

Index of the row to check.

Return Value

True if the range contains the row, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.Normalize Method

CellRange.Normalize Method

Normalizes the range so that r1 is the TopRow, r2 is the BottomRow, c1 is the LeftCol, and c2 is the RightCol.

[Visual Basic]

Public Sub Normalize()

[C#]

public void Normalize()

[Delphi]

public procedure Normalize();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellRange.ToString Method

CellRange.ToString Method

Gets a string representation for this object.

[Visual Basic]

Overrides Public Function ToString() As String

[C#]

override public string ToString()

[Delphi]

public function ToString(): String; override;

Return Value

A string representation for this object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle Class

CellStyle Class

The CellStyle class encapsulates properties that control the appearance of grid cells. This information includes the background and foreground colors, font, text and image alignment, etc.

For a list of all members of this type, see CellStyle Members.

System.Object

C1.Win.C1FlexGrid.CellStyle

[Visual Basic]

Public Class CellStyle

[C#]

public class CellStyle

[Delphi]

type CellStyle = class;

Remarks

The Styles property exposes a collection of grid styles, and has methods for creating and removing styles from the grid.

You can create and define styles at design time, but right-clicking the grid and selecting the "Edit Styles" menu option.

Styles follow a hierarchical model similar to styles in Microsoft Word or in cascading style sheets. Every property in a CellStyle object may be left unassigned, in which case the value is inherited from a parent style. The parent style is usually the built-in Normal style.

To determine which elements are defined in a particular style, use the DefinedElements property.

When you modify the properties of a CellStyle object, all cells that use that style are automatically repainted to reflect the changes.

Styles may be assigned to CellRange, Row, and Column objects, as shown in the example below.

Example

The example below creates three CellStyle objects and assigns them to grid rows, columns, and cell ranges.

// create style with red background

CellStyle cs = _flex.Styles.Add("red");

cs.BackColor = Color.Red;

// create style with green background

cs = _flex.Styles.Add("green");

cs.BackColor = Color.Green;

// create style with bold font

cs = _flex.Styles.Add("bold");

cs.Font = new Font("Tahoma", 8, FontStyle.Bold);

// assign red style to a column

_flex.Cols[3].Style = _flex.Styles["red"];

// assign green style to a row

_flex.Rows[3].Style = _flex.Styles["green"];

// assign bold style to a cell range

CellRange rg = _flex.GetCellRange(2, 2, 4, 4);

rg.Style = _flex.Styles["bold"];

After running this code, the third column of the grid will be painted with a red background. The third row will be painted with a green background. The cell at the intersection will be painted in red, because column styles have priority over row styles. The remaining style elements for these cells (font, alignment, etc) are not defined in the new styles and are automatically inherited from the parent style (Normal).

The cells around the intersection will have a bold font. The style that defines the bold font does not specify a background color, so that element is inherited from the parent style, which may be the "red", "green", or "normal" styles.

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle Members

CellStyle Members

CellStyle overview

Public Properties

BackColor | Gets or sets the color used to paint the cell background.
Border | Gets the CellBorder object associated with this style.
ComboList | Gets or sets a pipe-delimited list of valid values.
DataMap | Gets or sets an System.Collections.IDictionary used to associate cell values with display values.
DataType | Gets or sets the data type for the style.
DefinedElements | Gets or sets which elements are defined in this style.
Display | Gets or sets whether to show images, text, or both.
EditMask | Gets or sets the mask string used to edit values.
Editor | Gets or sets the custom editor used to edit cells that have this style.
Font | Gets or sets the font used to paint text in the cell.
ForeColor | Gets or sets the color of the text in the cell.
Format | Gets or sets the format string used to display values.
ImageAlign | Gets or sets the image alignment.
ImageMap | Gets or sets an System.Collections.IDictionary used to associate cell values with images.
ImageSpacing | Gets or sets the space between images and text in a cell, in pixels.
Margins | Gets or sets the margins between the edges of the cell and its contents, in pixels.
Name | Gets or sets the style name.
TextAlign | Gets or sets the text alignment.
TextDirection | Gets or sets the text direction.
TextEffect | Gets or sets the 3D effect used to paint text.
Trimming | Gets or sets how long strings are trimmed to fit the cell.
UserData | Gets or sets arbitrary user data associated with this style.
WordWrap | Gets or sets whether strings should automatically wrap within the cell.

Public Methods

BuildString | Returns a compact string representation of this style.
Clear | Overloaded. Clears all elements in this style.
Equals | Overriden. Determines whether two CellStyle objects are equal.
GetHashCode | Overriden. Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
MergeWith | Copies all elements defined in a source style to this style.
ParseString | Rebuilds this style based on a description contained in a string.
Render | Overloaded. Renders a string and an image into a Graphics object using this style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle Properties

CellStyle Properties

The properties of the CellStyle class are listed here. For a complete list of CellStyle class members, see the CellStyle Members topic.

Public Properties

BackColor | Gets or sets the color used to paint the cell background.
Border | Gets the CellBorder object associated with this style.
ComboList | Gets or sets a pipe-delimited list of valid values.
DataMap | Gets or sets an System.Collections.IDictionary used to associate cell values with display values.
DataType | Gets or sets the data type for the style.
DefinedElements | Gets or sets which elements are defined in this style.
Display | Gets or sets whether to show images, text, or both.
EditMask | Gets or sets the mask string used to edit values.
Editor | Gets or sets the custom editor used to edit cells that have this style.
Font | Gets or sets the font used to paint text in the cell.
ForeColor | Gets or sets the color of the text in the cell.
Format | Gets or sets the format string used to display values.
ImageAlign | Gets or sets the image alignment.
ImageMap | Gets or sets an System.Collections.IDictionary used to associate cell values with images.
ImageSpacing | Gets or sets the space between images and text in a cell, in pixels.
Margins | Gets or sets the margins between the edges of the cell and its contents, in pixels.
Name | Gets or sets the style name.
TextAlign | Gets or sets the text alignment.
TextDirection | Gets or sets the text direction.
TextEffect | Gets or sets the 3D effect used to paint text.
Trimming | Gets or sets how long strings are trimmed to fit the cell.
UserData | Gets or sets arbitrary user data associated with this style.
WordWrap | Gets or sets whether strings should automatically wrap within the cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.BackColor Property

CellStyle.BackColor Property

Gets or sets the color used to paint the cell background.

[Visual Basic]

Public Property BackColor As Color

[C#]

public Color BackColor {get;set;}

[Delphi]

public property BackColor: Color read get_BackColor write set_BackColor;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Border Property

CellStyle.Border Property

Gets the CellBorder object associated with this style.

[Visual Basic]

Public ReadOnly Property Border As CellBorder

[C#]

public CellBorder Border {get;}

[Delphi]

public property Border: CellBorder read get_Border;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.ComboList Property

CellStyle.ComboList Property

Gets or sets a pipe-delimited list of valid values.

[Visual Basic]

Public Property ComboList As String

[C#]

public string ComboList {get;set;}

[Delphi]

public property ComboList: String read get_ComboList write set_ComboList;

Remarks

If the cell is editable, this list of values is used to populate the drop-down System.Windows.Forms.ComboBox used to edit the cell.

If the list starts with a pipe character, then the list is not exclusive and the user may type values that are not on the list.

If the list contains three periods ("..."), then a button is displayed in the cell. When the user presses the button, the grid fires the CellButtonClick event.

If the list contains a pipe followed by three periods ("|..."), then a button is displayed in the cell as before, and the user may also type into the cell.

See also the DataMap property for an alternate way of specifying valid values for a cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.DataMap Property

CellStyle.DataMap Property

Gets or sets an System.Collections.IDictionary used to associate cell values with display values.

[Visual Basic]

Public Property DataMap As IDictionary

[C#]

public IDictionary DataMap {get;set;}

[Delphi]

public property DataMap: IDictionary read get_DataMap write set_DataMap;

Remarks

If the cell is editable, this list of values is used to populate the drop-down System.Windows.Forms.ComboBox used to edit the cell. In this case, the order of the items in the combo list is determined by the order of the elements in the dictionary.

The most common dictionary class, System.Collections.Hashtable, uses arbitrary order. If you want control over the item order, use a different dictionary class such as System.Collections.Specialized.ListDictionary.

The C1FlexGrid assembly also includes a MultiColumnDictionary class, which can be used to create multi-column and data-bound dictionaries.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.DataType Property

CellStyle.DataType Property

Gets or sets the data type for the style.

[Visual Basic]

Public Property DataType As Type

[C#]

public Type DataType {get;set;}

[Delphi]

public property DataType: Type read get_DataType write set_DataType;

Remarks

When the grid is bound to a data source, this property is set automatically based on the data schema.

This property is used to coerce values assigned to cells into the proper type.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.DefinedElements Property

CellStyle.DefinedElements Property

Gets or sets which elements are defined in this style.

[Visual Basic]

Public Property DefinedElements As StyleElementFlags

[C#]

public StyleElementFlags DefinedElements {get;set;}

[Delphi]

public property DefinedElements: StyleElementFlags read get_DefinedElements write set_DefinedElements;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Display Property

CellStyle.Display Property

Gets or sets whether to show images, text, or both.

[Visual Basic]

Public Property Display As DisplayEnum

[C#]

public DisplayEnum Display {get;set;}

[Delphi]

public property Display: DisplayEnum read get_Display write set_Display;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.EditMask Property

CellStyle.EditMask Property

Gets or sets the mask string used to edit values.

[Visual Basic]

Public Property EditMask As String

[C#]

public string EditMask {get;set;}

[Delphi]

public property EditMask: String read get_EditMask write set_EditMask;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Editor Property

CellStyle.Editor Property

Gets or sets the custom editor used to edit cells that have this style.

[Visual Basic]

Public Property Editor As Control

[C#]

public Control Editor {get;set;}

[Delphi]

public property Editor: Control read get_Editor write set_Editor;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Font Property

CellStyle.Font Property

Gets or sets the font used to paint text in the cell.

[Visual Basic]

Public Property Font As Font

[C#]

public Font Font {get;set;}

[Delphi]

public property Font: Font read get_Font write set_Font;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.ForeColor Property

CellStyle.ForeColor Property

Gets or sets the color of the text in the cell.

[Visual Basic]

Public Property ForeColor As Color

[C#]

public Color ForeColor {get;set;}

[Delphi]

public property ForeColor: Color read get_ForeColor write set_ForeColor;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Format Property

CellStyle.Format Property

Gets or sets the format string used to display values.

[Visual Basic]

Public Property Format As String

[C#]

public string Format {get;set;}

[Delphi]

public property Format: String read get_Format write set_Format;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.ImageAlign Property

CellStyle.ImageAlign Property

Gets or sets the image alignment.

[Visual Basic]

Public Property ImageAlign As ImageAlignEnum

[C#]

public ImageAlignEnum ImageAlign {get;set;}

[Delphi]

public property ImageAlign: ImageAlignEnum read get_ImageAlign write set_ImageAlign;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.ImageMap Property

CellStyle.ImageMap Property

Gets or sets an System.Collections.IDictionary used to associate cell values with images.

[Visual Basic]

Public Property ImageMap As IDictionary

[C#]

public IDictionary ImageMap {get;set;}

[Delphi]

public property ImageMap: IDictionary read get_ImageMap write set_ImageMap;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.ImageSpacing Property

CellStyle.ImageSpacing Property

Gets or sets the space between images and text in a cell, in pixels.

[Visual Basic]

Public Property ImageSpacing As Integer

[C#]

public int ImageSpacing {get;set;}

[Delphi]

public property ImageSpacing: Int32 read get_ImageSpacing write set_ImageSpacing;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Margins Property

CellStyle.Margins Property

Gets or sets the margins between the edges of the cell and its contents, in pixels.

[Visual Basic]

Public Property Margins As Margins

[C#]

public Margins Margins {get;set;}

[Delphi]

public property Margins: Margins read get_Margins write set_Margins;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Name Property

CellStyle.Name Property

Gets or sets the style name.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;

Remarks

Style names must be unique. Setting a style name to the name of an already existing style will throw an exception.

Style names must have one or more characters and may not include curly braces ('{' and '}').

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.TextAlign Property

CellStyle.TextAlign Property

Gets or sets the text alignment.

[Visual Basic]

Public Property TextAlign As TextAlignEnum

[C#]

public TextAlignEnum TextAlign {get;set;}

[Delphi]

public property TextAlign: TextAlignEnum read get_TextAlign write set_TextAlign;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.TextDirection Property

CellStyle.TextDirection Property

Gets or sets the text direction.

[Visual Basic]

Public Property TextDirection As TextDirectionEnum

[C#]

public TextDirectionEnum TextDirection {get;set;}

[Delphi]

public property TextDirection: TextDirectionEnum read get_TextDirection write set_TextDirection;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.TextEffect Property

CellStyle.TextEffect Property

Gets or sets the 3D effect used to paint text.

[Visual Basic]

Public Property TextEffect As TextEffectEnum

[C#]

public TextEffectEnum TextEffect {get;set;}

[Delphi]

public property TextEffect: TextEffectEnum read get_TextEffect write set_TextEffect;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Trimming Property

CellStyle.Trimming Property

Gets or sets how long strings are trimmed to fit the cell.

[Visual Basic]

Public Property Trimming As StringTrimming

[C#]

public StringTrimming Trimming {get;set;}

[Delphi]

public property Trimming: StringTrimming read get_Trimming write set_Trimming;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.UserData Property

CellStyle.UserData Property

Gets or sets arbitrary user data associated with this style.

[Visual Basic]

Public Property UserData As Object

[C#]

public object UserData {get;set;}

[Delphi]

public property UserData: Object read get_UserData write set_UserData;

Remarks

This data is not used by the control, and can be used to store any data that is useful to the application.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.WordWrap Property

CellStyle.WordWrap Property

Gets or sets whether strings should automatically wrap within the cell.

[Visual Basic]

Public Property WordWrap As Boolean

[C#]

public bool WordWrap {get;set;}

[Delphi]

public property WordWrap: Boolean read get_WordWrap write set_WordWrap;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle Methods

CellStyle Methods

The methods of the CellStyle class are listed here. For a complete list of CellStyle class members, see the CellStyle Members topic.

Public Methods

BuildString | Returns a compact string representation of this style.
Clear | Overloaded. Clears all elements in this style.
Equals | Overriden. Determines whether two CellStyle objects are equal.
GetHashCode | Overriden. Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
MergeWith | Copies all elements defined in a source style to this style.
ParseString | Rebuilds this style based on a description contained in a string.
Render | Overloaded. Renders a string and an image into a Graphics object using this style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.BuildString Method

CellStyle.BuildString Method

Returns a compact string representation of this style.

[Visual Basic]

Public Function BuildString() As String

[C#]

public string BuildString()

[Delphi]

public function BuildString(): String;

Remarks

This method is used to persist grid styles and can be used to define and save 'skins'.

See the BuildString and ParseString methods.para>

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Clear Method

CellStyle.Clear Method

Overload List

Clears all elements in this style.

[Visual Basic] Overloads Public Sub Clear()

[C#] public Clear();

[Delphi] public procedure Clear(); overload;

Clears selected elements from this style.

[Visual Basic] Overloads Public Sub Clear(StyleElementFlags)

[C#] public Clear(StyleElementFlags);

[Delphi] public procedure Clear(StyleElementFlags); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Clear Method ()

CellStyle.Clear Method ()

Clears all elements in this style.

[Visual Basic]

Overloads Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear(); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Clear Method (StyleElementFlags)

CellStyle.Clear Method (StyleElementFlags)

Clears selected elements from this style.

[Visual Basic]

Overloads Public Sub Clear( _

ByVal flags As StyleElementFlags _

)

[C#]

public void Clear(

StyleElementFlags flags

);

[Delphi]

public procedure Clear(

flags: StyleElementFlags

); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Equals Method

CellStyle.Equals Method

Determines whether two CellStyle objects are equal.

[Visual Basic]

Overrides Public Function Equals( _

ByVal o As Object _

) As Boolean

[C#]

override public bool Equals(

object o

);

[Delphi]

public function Equals(

o: Object

): Boolean; override;

Parameters

o

Style to compare with this style.

Return Value

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.GetHashCode Method

CellStyle.GetHashCode Method

Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

[Visual Basic]

Overrides Public Function GetHashCode() As Integer

[C#]

override public int GetHashCode()

[Delphi]

public function GetHashCode(): Int32; override;

Return Value

A hash code for the style instance.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.MergeWith Method

CellStyle.MergeWith Method

Copies all elements defined in a source style to this style.

[Visual Basic]

Public Sub MergeWith( _

ByVal sourceStyle As CellStyle _

)

[C#]

public void MergeWith(

CellStyle sourceStyle

);

[Delphi]

public procedure MergeWith(

sourceStyle: CellStyle

);

Remarks

Style elements not present in the source style are preserved.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.ParseString Method

CellStyle.ParseString Method

Rebuilds this style based on a description contained in a string.

[Visual Basic]

Public Function ParseString( _

ByVal str As String _

) As Boolean

[C#]

public bool ParseString(

string str

);

[Delphi]

public function ParseString(

str: String

): Boolean;

Remarks

This method is used to persist grid styles and can be used to define and save 'skins'.

See the BuildString and ParseString methods.para>

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Render Method

CellStyle.Render Method

Overload List

Renders a string and an image into a Graphics object using this style.

[Visual Basic] Overloads Public Sub Render(Graphics, Rectangle, Image)

[C#] public Render(Graphics, Rectangle, Image);

[Delphi] public procedure Render(Graphics; Rectangle; Image); overload;

Renders a string and an image into a Graphics object using this style.

[Visual Basic] Overloads Public Sub Render(Graphics, Rectangle, String)

[C#] public Render(Graphics, Rectangle, string);

[Delphi] public procedure Render(Graphics; Rectangle; String); overload;

Renders a string and an image into a Graphics object using this style.

[Visual Basic] Overloads Public Sub Render(Graphics, Rectangle, String, Image)

[C#] public Render(Graphics, Rectangle, string, Image);

[Delphi] public procedure Render(Graphics; Rectangle; String; Image); overload;

Renders a string and an image into a Graphics object using this style.

[Visual Basic] Overloads Public Sub Render(Graphics, Rectangle, String, Image, DrawCellFlags)

[C#] public Render(Graphics, Rectangle, string, Image, DrawCellFlags);

[Delphi] public procedure Render(Graphics; Rectangle; String; Image; DrawCellFlags); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Render Method (Graphics, Rectangle, Image)

CellStyle.Render Method (Graphics, Rectangle, Image)

Renders a string and an image into a Graphics object using this style.

[Visual Basic]

Overloads Public Sub Render( _

ByVal g As Graphics, _

ByVal rc As Rectangle, _

ByVal img As Image _

)

[C#]

public void Render(

Graphics g,

Rectangle rc,

Image img

);

[Delphi]

public procedure Render(

g: Graphics;

rc: Rectangle;

img: Image

); overload;

Parameters

g

System.Drawing.Graphics object to render into.

rc

Area where the element will be displayed.

img

Image to render.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Render Method (Graphics, Rectangle, String)

CellStyle.Render Method (Graphics, Rectangle, String)

Renders a string and an image into a Graphics object using this style.

[Visual Basic]

Overloads Public Sub Render( _

ByVal g As Graphics, _

ByVal rc As Rectangle, _

ByVal str As String _

)

[C#]

public void Render(

Graphics g,

Rectangle rc,

string str

);

[Delphi]

public procedure Render(

g: Graphics;

rc: Rectangle;

str: String

); overload;

Parameters

g

System.Drawing.Graphics object to render into.

rc

Area where the element will be displayed.

str

Text to render.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Render Method (Graphics, Rectangle, String, Image)

CellStyle.Render Method (Graphics, Rectangle, String, Image)

Renders a string and an image into a Graphics object using this style.

[Visual Basic]

Overloads Public Sub Render( _

ByVal g As Graphics, _

ByVal rc As Rectangle, _

ByVal str As String, _

ByVal img As Image _

)

[C#]

public void Render(

Graphics g,

Rectangle rc,

string str,

Image img

);

[Delphi]

public procedure Render(

g: Graphics;

rc: Rectangle;

str: String;

img: Image

); overload;

Parameters

g

System.Drawing.Graphics object to render into.

rc

Area where the element will be displayed.

str

Text to render.

img

Image to render.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyle.Render Method (Graphics, Rectangle, String, Image, DrawCellFlags)

CellStyle.Render Method (Graphics, Rectangle, String, Image, DrawCellFlags)

Renders a string and an image into a Graphics object using this style.

[Visual Basic]

Overloads Public Sub Render( _

ByVal g As Graphics, _

ByVal rc As Rectangle, _

ByVal str As String, _

ByVal img As Image, _

ByVal flags As DrawCellFlags _

)

[C#]

public void Render(

Graphics g,

Rectangle rc,

string str,

Image img,

DrawCellFlags flags

);

[Delphi]

public procedure Render(

g: Graphics;

rc: Rectangle;

str: String;

img: Image;

flags: DrawCellFlags

); overload;

Parameters

g

System.Drawing.Graphics object to render into.

rc

Area where the element will be displayed.

str

Text to render.

img

Image to render.

flags

Combination of DrawCellFlags that determines which elements will be rendered.

Remarks

This method allows using CellStyle objects to render objects outside the grid. It can be useful when implementing owner-drawn applications and style editors for example.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection Class

CellStyleCollection Class

Collection of CellStyle objects defined for a grid.

For a list of all members of this type, see CellStyleCollection Members.

System.Object

C1.Win.C1FlexGrid.CellStyleCollection

[Visual Basic]

Public Class CellStyleCollection

Implements ICollection, IEnumerable

[C#]

public class CellStyleCollection : ICollection, IEnumerable

[Delphi]

type CellStyleCollection = class (TObject, ICollection, IEnumerable);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection Members

CellStyleCollection Members

CellStyleCollection overview

Public Properties

Alternate | Gets the style used to paint scrollable cells in alternate rows.
Count | Gets the number of CellStyle objects in the collection.
Editor | Gets the style used to paint the cell being edited.
EmptyArea | Gets the style used to paint the area of the grid below and to the right of all the cells.
Fixed | Gets the style used to paint fixed cells.
Focus | Gets the style used to paint the current cell when the control has focus.
Frozen | Gets the style used to paint frozen cells (frozen cells are editable and selectable, but not scrollable).
Highlight | Gets the style used to paint highlighted selected cells.
Item | Overloaded. Gets a built-in CellStyle by style type.
NewRow | Gets the style used to paint cells in the new row template at the bottom of the grid.
Normal | Gets the default style used to paint scrollable cells.
Search | Gets the style used to paint the cell selected while auto-searching.

Public Methods

Add | Overloaded. Adds a new empty CellStyle object to the collection.
BuildString | Builds and returns a compact string representation of the style collection.
Clear | Clear all styles (even those in use) and reset the built-in styles.
ClearUnused | Clear all unused styles.
Contains | Checks whether the collection contains a given style.
IndexOf | Gets the index of a style in the collection.
ParseString | Parses a string containing style definitions.
Remove | Overloaded. Removes a custom style from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection Properties

CellStyleCollection Properties

The properties of the CellStyleCollection class are listed here. For a complete list of CellStyleCollection class members, see the CellStyleCollection Members topic.

Public Properties

Alternate | Gets the style used to paint scrollable cells in alternate rows.
Count | Gets the number of CellStyle objects in the collection.
Editor | Gets the style used to paint the cell being edited.
EmptyArea | Gets the style used to paint the area of the grid below and to the right of all the cells.
Fixed | Gets the style used to paint fixed cells.
Focus | Gets the style used to paint the current cell when the control has focus.
Frozen | Gets the style used to paint frozen cells (frozen cells are editable and selectable, but not scrollable).
Highlight | Gets the style used to paint highlighted selected cells.
Item | Overloaded. Gets a built-in CellStyle by style type.
NewRow | Gets the style used to paint cells in the new row template at the bottom of the grid.
Normal | Gets the default style used to paint scrollable cells.
Search | Gets the style used to paint the cell selected while auto-searching.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Alternate Property

CellStyleCollection.Alternate Property

Gets the style used to paint scrollable cells in alternate rows.

[Visual Basic]

Public ReadOnly Property Alternate As CellStyle

[C#]

public CellStyle Alternate {get;}

[Delphi]

public property Alternate: CellStyle read get_Alternate;

Remarks

This style is empty by default, so all scrollable cells are rendered using the Normal style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Count Property

CellStyleCollection.Count Property

Gets the number of CellStyle objects in the collection.

[Visual Basic]

Overridable Public ReadOnly Property Count As Integer Implements ICollection.Count

[C#]

virtual public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

Implements

ICollection.Count

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Editor Property

CellStyleCollection.Editor Property

Gets the style used to paint the cell being edited.

[Visual Basic]

Public ReadOnly Property Editor As CellStyle

[C#]

public CellStyle Editor {get;}

[Delphi]

public property Editor: CellStyle read get_Editor;

Remarks

This style is empty by default, so cells being edited are rendered using the Focus style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.EmptyArea Property

CellStyleCollection.EmptyArea Property

Gets the style used to paint the area of the grid below and to the right of all the cells.

[Visual Basic]

Public ReadOnly Property EmptyArea As CellStyle

[C#]

public CellStyle EmptyArea {get;}

[Delphi]

public property EmptyArea: CellStyle read get_EmptyArea;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Fixed Property

CellStyleCollection.Fixed Property

Gets the style used to paint fixed cells.

[Visual Basic]

Public ReadOnly Property Fixed As CellStyle

[C#]

public CellStyle Fixed {get;}

[Delphi]

public property Fixed: CellStyle read get_Fixed;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Focus Property

CellStyleCollection.Focus Property

Gets the style used to paint the current cell when the control has focus.

[Visual Basic]

Public ReadOnly Property Focus As CellStyle

[C#]

public CellStyle Focus {get;}

[Delphi]

public property Focus: CellStyle read get_Focus;

Remarks

This style is empty by default, so focused cells are rendered using the Normal style.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Frozen Property

CellStyleCollection.Frozen Property

Gets the style used to paint frozen cells (frozen cells are editable and selectable, but not scrollable).

[Visual Basic]

Public ReadOnly Property Frozen As CellStyle

[C#]

public CellStyle Frozen {get;}

[Delphi]

public property Frozen: CellStyle read get_Frozen;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Highlight Property

CellStyleCollection.Highlight Property

Gets the style used to paint highlighted selected cells.

[Visual Basic]

Public ReadOnly Property Highlight As CellStyle

[C#]

public CellStyle Highlight {get;}

[Delphi]

public property Highlight: CellStyle read get_Highlight;

Remarks

Use the HighLight property to determine whether cells should be highlighted when the control does not have the focus.

Use the SelectionMode property to determine what types of selection are allowed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Item Property

CellStyleCollection.Item Property

Overload List

Gets a built-in CellStyle by style type.

[Visual Basic] Overloads Public Default ReadOnly Property Item(CellStyleEnum) As CellStyle

[C#] public CellStyle this[CellStyleEnum]{get;}

[Delphi] public property Item[index: CellStyleEnum]: CellStyle read get_Item;

Gets a CellStyle by index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As CellStyle

[C#] public CellStyle this[int]{get;}

[Delphi] public property Item[index: Int32]: CellStyle read get_Item;

Gets a CellStyle by name.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As CellStyle

[C#] public CellStyle this[string]{get;}

[Delphi] public property Item[name: String]: CellStyle read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Item Property (CellStyleEnum)

CellStyleCollection.Item Property (CellStyleEnum)

Gets a built-in CellStyle by style type.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As CellStyleEnum _

) As CellStyle

[C#]

public CellStyle this[

CellStyleEnum index

] {get;}

[Delphi]

public property Item[

index: CellStyleEnum

]: CellStyle read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Item Property (Int32)

CellStyleCollection.Item Property (Int32)

Gets a CellStyle by index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As CellStyle

[C#]

public CellStyle this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: CellStyle read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Item Property (String)

CellStyleCollection.Item Property (String)

Gets a CellStyle by name.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As CellStyle

[C#]

public CellStyle this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: CellStyle read get_Item;

Remarks

If the specified name doesn't exist, this indexer returns null.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.NewRow Property

CellStyleCollection.NewRow Property

Gets the style used to paint cells in the new row template at the bottom of the grid.

[Visual Basic]

Public ReadOnly Property NewRow As CellStyle

[C#]

public CellStyle NewRow {get;}

[Delphi]

public property NewRow: CellStyle read get_NewRow;

Remarks

The new row template is only present when the AllowAddNew property is set to True.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Normal Property

CellStyleCollection.Normal Property

Gets the default style used to paint scrollable cells.

[Visual Basic]

Public ReadOnly Property Normal As CellStyle

[C#]

public CellStyle Normal {get;}

[Delphi]

public property Normal: CellStyle read get_Normal;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Search Property

CellStyleCollection.Search Property

Gets the style used to paint the cell selected while auto-searching.

[Visual Basic]

Public ReadOnly Property Search As CellStyle

[C#]

public CellStyle Search {get;}

[Delphi]

public property Search: CellStyle read get_Search;

Remarks

Use the AutoSearch property to enable auto-searching.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection Methods

CellStyleCollection Methods

The methods of the CellStyleCollection class are listed here. For a complete list of CellStyleCollection class members, see the CellStyleCollection Members topic.

Public Methods

Add | Overloaded. Adds a new empty CellStyle object to the collection.
BuildString | Builds and returns a compact string representation of the style collection.
Clear | Clear all styles (even those in use) and reset the built-in styles.
ClearUnused | Clear all unused styles.
Contains | Checks whether the collection contains a given style.
IndexOf | Gets the index of a style in the collection.
ParseString | Parses a string containing style definitions.
Remove | Overloaded. Removes a custom style from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Add Method

CellStyleCollection.Add Method

Overload List

Adds a new empty CellStyle object to the collection.

[Visual Basic] Overloads Public Function Add(String) As CellStyle

[C#] public CellStyle Add(string);

[Delphi] public function Add(String) : CellStyle; overload;

Adds a new CellStyle object to the collection.

[Visual Basic] Overloads Public Function Add(String, CellStyle) As CellStyle

[C#] public CellStyle Add(string, CellStyle);

[Delphi] public function Add(String; CellStyle) : CellStyle; overload;

Adds new CellStyle object to the collection.

[Visual Basic] Overloads Public Function Add(String, String) As CellStyle

[C#] public CellStyle Add(string, string);

[Delphi] public function Add(String; String) : CellStyle; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Add Method (String)

CellStyleCollection.Add Method (String)

Adds a new empty CellStyle object to the collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal name As String _

) As CellStyle

[C#]

public CellStyle Add(

string name

);

[Delphi]

public function Add(

name: String

): CellStyle; overload;

Parameters

name

Name of the new style.

Return Value

The new CellStyle object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Add Method (String, CellStyle)

CellStyleCollection.Add Method (String, CellStyle)

Adds a new CellStyle object to the collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal name As String, _

ByVal basedOn As CellStyle _

) As CellStyle

[C#]

public CellStyle Add(

string name,

CellStyle basedOn

);

[Delphi]

public function Add(

name: String;

basedOn: CellStyle

): CellStyle; overload;

Parameters

name

Name of the new style.

basedOn

Base style, used to initialize the properties of the new style.

Return Value

The new CellStyle object.

Remarks

If a style with the given name already exists, the existing style is returned and no exception is thrown.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Add Method (String, String)

CellStyleCollection.Add Method (String, String)

Adds new CellStyle object to the collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal name As String, _

ByVal basedOn As String _

) As CellStyle

[C#]

public CellStyle Add(

string name,

string basedOn

);

[Delphi]

public function Add(

name: String;

basedOn: String

): CellStyle; overload;

Parameters

name

Name of the new style.

basedOn

Name of the base style, used to initialize the properties of the new style.

Return Value

The new CellStyle object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.BuildString Method

CellStyleCollection.BuildString Method

Builds and returns a compact string representation of the style collection.

[Visual Basic]

Public Function BuildString( _

ByVal includeEmpty As Boolean _

) As String

[C#]

public string BuildString(

bool includeEmpty

);

[Delphi]

public function BuildString(

includeEmpty: Boolean

): String;

Parameters

includeEmpty

Whether styles with no attributes should be included.

Return Value

A compact string representation of the style collection.

Remarks

This method is used internally to implement design-time persistence.

It can also be used for implementing 'skins', by saving the current styles into a collection and later applying them to the grid using the ParseString method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Clear Method

CellStyleCollection.Clear Method

Clear all styles (even those in use) and reset the built-in styles.

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.ClearUnused Method

CellStyleCollection.ClearUnused Method

Clear all unused styles.

[Visual Basic]

Public Sub ClearUnused()

[C#]

public void ClearUnused()

[Delphi]

public procedure ClearUnused();

Remarks

Unused styles are unnamed styles that were created and are no longer assigned to any grid elements.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Contains Method

CellStyleCollection.Contains Method

Checks whether the collection contains a given style.

[Visual Basic]

Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean;

Parameters

name

Name of the style to look for.

Return Value

True if the collection contains a style called name, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.IndexOf Method

CellStyleCollection.IndexOf Method

Gets the index of a style in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal style As CellStyle _

) As Integer

[C#]

public int IndexOf(

CellStyle style

);

[Delphi]

public function IndexOf(

style: CellStyle

): Int32;

Parameters

style

Style object to look for.

Return Value

Index of the style in the collection, or -1 if the style is not a member of the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.ParseString Method

CellStyleCollection.ParseString Method

Parses a string containing style definitions.

[Visual Basic]

Public Function ParseString( _

ByVal styleDef As String _

) As Boolean

[C#]

public bool ParseString(

string styleDef

);

[Delphi]

public function ParseString(

styleDef: String

): Boolean;

Parameters

styleDef

String containing style definitions.

Return Value

Remarks

The style definition string is usually obtained from a call to BuildString method.

The new definitions are merged with the current ones. To completely replace the styles, call the Clear method before parsing the new styles.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Remove Method

CellStyleCollection.Remove Method

Overload List

Removes a custom style from the collection.

[Visual Basic] Overloads Public Sub Remove(CellStyle)

[C#] public Remove(CellStyle);

[Delphi] public procedure Remove(CellStyle); overload;

Removes a custom style from the collection.

[Visual Basic] Overloads Public Sub Remove(Integer)

[C#] public Remove(int);

[Delphi] public procedure Remove(Int32); overload;

Removes a custom style from the collection.

[Visual Basic] Overloads Public Sub Remove(String)

[C#] public Remove(string);

[Delphi] public procedure Remove(String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Remove Method (CellStyle)

CellStyleCollection.Remove Method (CellStyle)

Removes a custom style from the collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal style As CellStyle _

)

[C#]

public void Remove(

CellStyle style

);

[Delphi]

public procedure Remove(

style: CellStyle

); overload;

Parameters

style

Style to be removed from the collection.

Remarks

Built-in styles cannot be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Remove Method (Int32)

CellStyleCollection.Remove Method (Int32)

Removes a custom style from the collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal index As Integer _

)

[C#]

public void Remove(

int index

);

[Delphi]

public procedure Remove(

index: Int32

); overload;

Parameters

index

Index of the style to be removed.

Remarks

Built-in styles cannot be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleCollection.Remove Method (String)

CellStyleCollection.Remove Method (String)

Removes a custom style from the collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal name As String _

)

[C#]

public void Remove(

string name

);

[Delphi]

public procedure Remove(

name: String

); overload;

Parameters

name

Name of the style to be removed.

Remarks

Built-in styles cannot be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellStyleEnum Enumeration

CellStyleEnum Enumeration

Enumeration used to retrieve CellStyle objects from the Styles collection.

[Visual Basic]

Public Enum CellStyleEnum

[C#]

public enum CellStyleEnum

[Delphi]

type CellStyleEnum = (Alternate, Editor, EmptyArea, FirstCustomStyle, Fixed, Focus, Frozen, GrandTotal, Highlight, NewRow, Normal, Search, Subtotal0, Subtotal1, Subtotal2, Subtotal3, Subtotal4, Subtotal5);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Remarks

Cell styles can be retrieved from the the Styles collection using the indexer or the style name. Built-in styles can also be obtained directly through read-only properties.

Example

The code below shows three ways to obtain a reference to a grid's default style:

// s1, s2, and s3 are all references to the grid's Normal style:

CellStyle s1 = _flex.Styles[CellStyleEnum.Normal];

CellStyle s2 = _flex.Styles["Normal"];

CellStyle s3 = _flex.Styles.Normal;

Members

Member name | Description
Alternate | Style used to render scrollable cells in even-numbered rows.
Editor | Style used to render cells being edited.
EmptyArea | Style used to render the area of the grid where there are no cells.
FirstCustomStyle | Constant that indicates the first custom style.
Fixed | Style used to render fixed cells.
Focus | Style used to render the cell that has the focus.
Frozen | Style used to render cells that are frozen (editable and selectable, but not scrollable).
GrandTotal | Style automatically assigned to grand total nodes created with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method.
Highlight | Style used to render cells that are selected and highlighted.
NewRow | Style used to render the last row on the grid when the AllowAddNew property is set to True.
Normal | Style used to render scrollable normal cells.
Search | Style used to render cells that are being selected as the user types (see the AutoSearch property).
Subtotal0 | Style automatically assigned to level-0 nodes created with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method.
Subtotal1 | Style automatically assigned to level-1 nodes created with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method.
Subtotal2 | Style automatically assigned to level-2 nodes created with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method.
Subtotal3 | Style automatically assigned to level-3 nodes created with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method.
Subtotal4 | Style automatically assigned to level-4 nodes created with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method.
Subtotal5 | Style automatically assigned to level-5 nodes created with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CheckEnum Enumeration

CheckEnum Enumeration

Specifies the type of checkbox to draw in a cell.

[Visual Basic]

Public Enum CheckEnum

[C#]

public enum CheckEnum

[Delphi]

type CheckEnum = (Checked, None, TSChecked, TSGrayed, TSUnchecked, Unchecked);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Remarks

There are two types of check boxes: regular and tri-state.

Regular check boxes are used to display simple boolean values. They cycle through settings Checked and Unchecked when clicked with the mouse.

Tri-state check boxes are used to display values that may be True, False, or indeterminate (grayed). They cycle through settings TSChecked, TSGrayed, and TSUnchecked when clicked with the mouse.

Visually, Checked and Unchecked look the same as TSChecked and TSUnchecked.

Members

Member name | Description
Checked | Check box with a check mark in it.
None | No check box.
TSChecked | Tri-state check box with a check mark in it.
TSGrayed | Tri-state check box in grayed state.
TSUnchecked | Tri-state empty check box.
Unchecked | Empty check box.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ClearFlags Enumeration

ClearFlags Enumeration

Specifies which elements of the grid should be cleared by the Clear (ClearFlags, CellRange) method.

[Visual Basic]

Public Enum ClearFlags

[C#]

public enum ClearFlags

[Delphi]

type ClearFlags = (All, Content, Style, UserData);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Remarks

This enumeration contains flags that can be combined to customize the sorting process.

Members

Member name | Description
All | All of the above.
Content | Clear cell content, including data, images, and checkboxes if any.
Style | Clear custom styles assigned to cells.
UserData | Clear user data associated with cells.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column Class

Column Class

Class that represents a grid column.

For a list of all members of this type, see Column Members.

System.Object

C1.Win.C1FlexGrid.RowCol

C1.Win.C1FlexGrid.Column

[Visual Basic]

Public Class Column

Inherits RowCol

[C#]

public class Column : RowCol

[Delphi]

type Column = class (RowCol);

Remarks

This class does not have a public constructor. You can add and remove columns using methods in the grid's Cols property, which exposes the column collection.

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column Members

Column Members

Column overview

Public Properties

AllowDragging (inherited from RowCol) | Gets or sets whether the user can drag this row or column with the mouse.
AllowEditing (inherited from RowCol) | Gets or sets whether cells on this row or column can be edited by the user.
AllowMerging (inherited from RowCol) | Specifies whether adjacent cells with similar contents will be merged.
AllowResizing (inherited from RowCol) | Gets or sets whether the user can resize this row or column with the mouse.
AllowSorting | Gets or sets whether this column can be sorted by clicking on the column header.
Caption | Gets or sets the text of the column's header cell.
ComboList (inherited from RowCol) | Gets or sets a list of items to be used by the drop-down editor.
DataIndex | Gets the position of the column in the data source object.
DataMap (inherited from RowCol) | Gets or sets an System.Collections.IDictionary object used to translate data values into display values for this row or column.
DataType (inherited from RowCol) | Gets or sets the type of object stored in a row or column.
EditMask (inherited from RowCol) | Gets or sets the input mask to use when editing cells on this column.
Editor (inherited from RowCol) | Gets or sets the custom editor used to edit cells in this column.
Format (inherited from RowCol) | Gets or sets a string that specifies how to format the data on this column.
ImageAlign (inherited from RowCol) | Gets or sets an ImageAlignEnum value that determines how images are aligned in scrollable cells on this row or column.
ImageAlignFixed (inherited from RowCol) | Gets or sets an ImageAlignEnum value that determines how images are aligned in fixed cells on this row or column.
ImageAndText (inherited from RowCol) | Gets or sets a value that determines whether images found in this row or column's ImageMap should be displayed instead of or in addition to the cell text.
ImageMap (inherited from RowCol) | Gets or sets an System.Collections.IDictionary object used to translate data values into images for this row or column.
Index | Overriden. Gets the index of this column in the Column collection.
Item | Gets or sets the cell value specified by the row index in this column.
Left | Gets the position of the left of this column, in pixels, relative to the grid.
Name | Gets or sets the name of this column.
Right | Gets the position of the right of this column, in pixels, relative to the grid.
SafeIndex | Gets the index of this column in the Column collection.
Selected | Overriden. Gets or sets whether this column is selected.
Sort | Specifies how this column should be sorted when the Sort (SortFlags, Int32) method is called with a SortFlags.UseColSort flag.
Style (inherited from RowCol) | Gets or sets a custom CellStyle associated with this row or column.
StyleDisplay (inherited from RowCol) | Gets the style used to display this row or column.
StyleFixed (inherited from RowCol) | Gets the stock CellStyle used to paint fixed cells.
StyleFixedDisplay (inherited from RowCol) | Gets the style used to display fixed cells on this row or column.
StyleFixedNew (inherited from RowCol) | Gets the custom style associated with fixed cells on this row or column, createing a new one of necessary.
StyleNew (inherited from RowCol) | Gets or sets a custom CellStyle associated with this row or column, creating a new style if necessary.
TextAlign (inherited from RowCol) | Gets or sets a TextAlignEnum value that determines how text is aligned in scrollable cells on this row or column.
TextAlignFixed (inherited from RowCol) | Gets or sets a TextAlignEnum value that determines how text is aligned in fixed cells on this row or column.
UserData (inherited from RowCol) | Gets or sets user data associated with this row or column.
Visible (inherited from RowCol) | Gets or sets whether a Row or Column is visible.
Width | Gets or sets the width of this column, in pixels (the value -1 represents the default column width).
WidthDisplay | Gets or sets the display width for this column, in pixels.

Public Methods

Clear | Overriden. Clears this Column.
Invalidate | Overriden. Invalidates this column, causing it to be repainted.
Move | Overriden. Moves a Column to a new position in the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column Properties

Column Properties

The properties of the Column class are listed here. For a complete list of Column class members, see the Column Members topic.

Public Properties

AllowDragging (inherited from RowCol) | Gets or sets whether the user can drag this row or column with the mouse.
AllowEditing (inherited from RowCol) | Gets or sets whether cells on this row or column can be edited by the user.
AllowMerging (inherited from RowCol) | Specifies whether adjacent cells with similar contents will be merged.
AllowResizing (inherited from RowCol) | Gets or sets whether the user can resize this row or column with the mouse.
AllowSorting | Gets or sets whether this column can be sorted by clicking on the column header.
Caption | Gets or sets the text of the column's header cell.
ComboList (inherited from RowCol) | Gets or sets a list of items to be used by the drop-down editor.
DataIndex | Gets the position of the column in the data source object.
DataMap (inherited from RowCol) | Gets or sets an System.Collections.IDictionary object used to translate data values into display values for this row or column.
DataType (inherited from RowCol) | Gets or sets the type of object stored in a row or column.
EditMask (inherited from RowCol) | Gets or sets the input mask to use when editing cells on this column.
Editor (inherited from RowCol) | Gets or sets the custom editor used to edit cells in this column.
Format (inherited from RowCol) | Gets or sets a string that specifies how to format the data on this column.
ImageAlign (inherited from RowCol) | Gets or sets an ImageAlignEnum value that determines how images are aligned in scrollable cells on this row or column.
ImageAlignFixed (inherited from RowCol) | Gets or sets an ImageAlignEnum value that determines how images are aligned in fixed cells on this row or column.
ImageAndText (inherited from RowCol) | Gets or sets a value that determines whether images found in this row or column's ImageMap should be displayed instead of or in addition to the cell text.
ImageMap (inherited from RowCol) | Gets or sets an System.Collections.IDictionary object used to translate data values into images for this row or column.
Index | Overriden. Gets the index of this column in the Column collection.
Item | Gets or sets the cell value specified by the row index in this column.
Left | Gets the position of the left of this column, in pixels, relative to the grid.
Name | Gets or sets the name of this column.
Right | Gets the position of the right of this column, in pixels, relative to the grid.
SafeIndex | Gets the index of this column in the Column collection.
Selected | Overriden. Gets or sets whether this column is selected.
Sort | Specifies how this column should be sorted when the Sort (SortFlags, Int32) method is called with a SortFlags.UseColSort flag.
Style (inherited from RowCol) | Gets or sets a custom CellStyle associated with this row or column.
StyleDisplay (inherited from RowCol) | Gets the style used to display this row or column.
StyleFixed (inherited from RowCol) | Gets the stock CellStyle used to paint fixed cells.
StyleFixedDisplay (inherited from RowCol) | Gets the style used to display fixed cells on this row or column.
StyleFixedNew (inherited from RowCol) | Gets the custom style associated with fixed cells on this row or column, createing a new one of necessary.
StyleNew (inherited from RowCol) | Gets or sets a custom CellStyle associated with this row or column, creating a new style if necessary.
TextAlign (inherited from RowCol) | Gets or sets a TextAlignEnum value that determines how text is aligned in scrollable cells on this row or column.
TextAlignFixed (inherited from RowCol) | Gets or sets a TextAlignEnum value that determines how text is aligned in fixed cells on this row or column.
UserData (inherited from RowCol) | Gets or sets user data associated with this row or column.
Visible (inherited from RowCol) | Gets or sets whether a Row or Column is visible.
Width | Gets or sets the width of this column, in pixels (the value -1 represents the default column width).
WidthDisplay | Gets or sets the display width for this column, in pixels.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.AllowSorting Property

Column.AllowSorting Property

Gets or sets whether this column can be sorted by clicking on the column header.

[Visual Basic]

Public Property AllowSorting As Boolean

[C#]

public bool AllowSorting {get;set;}

[Delphi]

public property AllowSorting: Boolean read get_AllowSorting write set_AllowSorting;

Remarks

The grid has an AllowSorting property that determines whether columns can be sorted with the mouse. The AllowSorting property of the Column objects can be used to prevent the user from sorting specific columns.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Caption Property

Column.Caption Property

Gets or sets the text of the column's header cell.

[Visual Basic]

Public Property Caption As String

[C#]

public string Caption {get;set;}

[Delphi]

public property Caption: String read get_Caption write set_Caption;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.DataIndex Property

Column.DataIndex Property

Gets the position of the column in the data source object.

[Visual Basic]

Public ReadOnly Property DataIndex As Integer

[C#]

public int DataIndex {get;}

[Delphi]

public property DataIndex: Int32 read get_DataIndex;

Remarks

This property returns -1 for fixed and unbound columns.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Index Property

Column.Index Property

Gets the index of this column in the Column collection.

[Visual Basic]

Overrides Public ReadOnly Property Index As Integer

[C#]

override public int Index {get;}

[Delphi]

public property Index: Int32 read get_Index;

Remarks

Returns -1 if the column is not a member of the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Item Property

Column.Item Property

Gets or sets the cell value specified by the row index in this column.

[Visual Basic]

Public Default Property Item( _

ByVal rowIndex As Integer _

) As Object

[C#]

public object this[

int rowIndex

] {get;set;}

[Delphi]

public property Item[

rowIndex: Int32

]: Object read get_Item write set_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Left Property

Column.Left Property

Gets the position of the left of this column, in pixels, relative to the grid.

[Visual Basic]

Public ReadOnly Property Left As Integer

[C#]

public int Left {get;}

[Delphi]

public property Left: Int32 read get_Left;

Remarks

The value returned is the sum of column widths from the left of the grid until this column, and does not account for the scroll position. To account for the scroll position, this value should be adjusted using the grid's ScrollPosition property.

To retrieve the size and position of a cell, use the GetCellRect (Int32, Int32, Boolean) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Name Property

Column.Name Property

Gets or sets the name of this column.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;

Remarks

The name can be used as an index in the ColumnCollection property indexer.

When the grid is bound to a DataSource, the column names are set automatically to the names of columns in the data source, and are used for binding.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Right Property

Column.Right Property

Gets the position of the right of this column, in pixels, relative to the grid.

[Visual Basic]

Public ReadOnly Property Right As Integer

[C#]

public int Right {get;}

[Delphi]

public property Right: Int32 read get_Right;

Remarks

The value returned corresponds to the sum of the Left and WidthDisplay properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.SafeIndex Property

Column.SafeIndex Property

Gets the index of this column in the Column collection.

[Visual Basic]

Overridable Public ReadOnly Property SafeIndex As Integer

[C#]

virtual public int SafeIndex {get;}

[Delphi]

public property SafeIndex: Int32 read get_SafeIndex;

Remarks

This property is similar to the Index property, except it throws an exception if the Column is not a member of the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Selected Property

Column.Selected Property

Gets or sets whether this column is selected.

[Visual Basic]

Overrides Public Property Selected As Boolean

[C#]

override public bool Selected {get;set;}

[Delphi]

public property Selected: Boolean read get_Selected write set_Selected;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Sort Property

Column.Sort Property

Specifies how this column should be sorted when the Sort (SortFlags, Int32) method is called with a SortFlags.UseColSort flag.

[Visual Basic]

Public Property Sort As SortFlags

[C#]

public SortFlags Sort {get;set;}

[Delphi]

public property Sort: SortFlags read get_Sort write set_Sort;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Width Property

Column.Width Property

Gets or sets the width of this column, in pixels (the value -1 represents the default column width).

[Visual Basic]

Public Property Width As Integer

[C#]

public int Width {get;set;}

[Delphi]

public property Width: Int32 read get_Width write set_Width;

Remarks

Setting this property to -1 causes the grid to use the default column width for this column (see the DefaultSize property).

Width returns the width assigned to the column even if the row is invisible, and returns -1 if the row has the default height. To obtain the actual display width of a column, use the WidthDisplay property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.WidthDisplay Property

Column.WidthDisplay Property

Gets or sets the display width for this column, in pixels.

[Visual Basic]

Public Property WidthDisplay As Integer

[C#]

public int WidthDisplay {get;set;}

[Delphi]

public property WidthDisplay: Int32 read get_WidthDisplay write set_WidthDisplay;

Remarks

WidthDisplay returns zero if the column is invisible, and returns the actual display width even if the Width property is set to -1 (which stands for default column width).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column Methods

Column Methods

The methods of the Column class are listed here. For a complete list of Column class members, see the Column Members topic.

Public Methods

Clear | Overriden. Clears this Column.
Invalidate | Overriden. Invalidates this column, causing it to be repainted.
Move | Overriden. Moves a Column to a new position in the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Clear Method

Column.Clear Method

Clears this Column.

[Visual Basic]

Overrides Public Sub Clear( _

ByVal clearFlags As ClearFlags _

)

[C#]

override public void Clear(

ClearFlags clearFlags

);

[Delphi]

public procedure Clear(

clearFlags: ClearFlags

); override;

Parameters

clearFlags

ClearFlags value specifying which elements of the Column should be cleared.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Invalidate Method

Column.Invalidate Method

Invalidates this column, causing it to be repainted.

[Visual Basic]

Overrides Public Sub Invalidate()

[C#]

override public void Invalidate()

[Delphi]

public procedure Invalidate(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Column.Move Method

Column.Move Method

Moves a Column to a new position in the collection.

[Visual Basic]

Overrides Public Sub Move( _

ByVal indexNew As Integer _

)

[C#]

override public void Move(

int indexNew

);

[Delphi]

public procedure Move(

indexNew: Int32

); override;

Parameters

indexNew

An integer specifying the column's new position.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection Class

ColumnCollection Class

Collection of grid Column objects.

For a list of all members of this type, see ColumnCollection Members.

System.Object

C1.Win.C1FlexGrid.RowColCollection

C1.Win.C1FlexGrid.ColumnCollection

[Visual Basic]

Public Class ColumnCollection

Inherits RowColCollection

[C#]

public class ColumnCollection : RowColCollection

[Delphi]

type ColumnCollection = class (RowColCollection);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection Members

ColumnCollection Members

ColumnCollection overview

Public Properties

Count | Overriden. Gets or sets the number of Column objects in this collection.
DefaultSize (inherited from RowColCollection) | Gets or sets the default size for the rows or columns in the collection.
Fixed | Overriden. Gets or sets the number of fixed columns in this collection.
Frozen (inherited from RowColCollection) | Gets or sets the number of frozen rows or columns in the collection.
Item | Overloaded. Gets the Column at the specified index.
MaxSize (inherited from RowColCollection) | Gets or sets the maximum size for rows and columns in the collection.
MinSize (inherited from RowColCollection) | Gets or sets the minimum size for rows and columns in the collection.
Selected | Gets a collection of Column objects that are currently selected.

Public Methods

Add | Appends a new Column object to this collection.
Contains | Overloaded. Gets a value that determines whether the collection contains a Column with the given name.
IndexOf | Gets the index of the Column with the specified name.
Insert | Adds a new Column object to this collection at a specified position.
InsertRange | Adds a range of Column objects to the collection at a specified position.
Move | Overriden. Moves a Column object to a new position in the collection.
MoveRange | Overriden. Moves a range of Column objects to a new position in the collection.
Remove | Overloaded. Removes a Column object from the collection.
RemoveRange | Removes a range of Column objects from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection Properties

ColumnCollection Properties

The properties of the ColumnCollection class are listed here. For a complete list of ColumnCollection class members, see the ColumnCollection Members topic.

Public Properties

Count | Overriden. Gets or sets the number of Column objects in this collection.
DefaultSize (inherited from RowColCollection) | Gets or sets the default size for the rows or columns in the collection.
Fixed | Overriden. Gets or sets the number of fixed columns in this collection.
Frozen (inherited from RowColCollection) | Gets or sets the number of frozen rows or columns in the collection.
Item | Overloaded. Gets the Column at the specified index.
MaxSize (inherited from RowColCollection) | Gets or sets the maximum size for rows and columns in the collection.
MinSize (inherited from RowColCollection) | Gets or sets the minimum size for rows and columns in the collection.
Selected | Gets a collection of Column objects that are currently selected.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Count Property

ColumnCollection.Count Property

Gets or sets the number of Column objects in this collection.

[Visual Basic]

Overrides Public Property Count As Integer

[C#]

override public int Count {get;set;}

[Delphi]

public property Count: Int32 read get_Count write set_Count;

Remarks

You can add or remove columns by assigning a new value to this property, or you can use the Add, Insert, InsertRange, and Remove (Int32) methods.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Fixed Property

ColumnCollection.Fixed Property

Gets or sets the number of fixed columns in this collection.

[Visual Basic]

Overrides Public Property Fixed As Integer

[C#]

override public int Fixed {get;set;}

[Delphi]

public property Fixed: Int32 read get_Fixed write set_Fixed;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Item Property

ColumnCollection.Item Property

Overload List

Gets the Column at the specified index.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As Column

[C#] public Column this[int]{get;}

[Delphi] public property Item[index: Int32]: Column read get_Item;

Gets the Column that has the specified column name.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As Column

[C#] public Column this[string]{get;}

[Delphi] public property Item[columnName: String]: Column read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Item Property (Int32)

ColumnCollection.Item Property (Int32)

Gets the Column at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As Column

[C#]

public Column this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: Column read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Item Property (String)

ColumnCollection.Item Property (String)

Gets the Column that has the specified column name.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal columnName As String _

) As Column

[C#]

public Column this[

string columnName

] {get;}

[Delphi]

public property Item[

columnName: String

]: Column read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Selected Property

ColumnCollection.Selected Property

Gets a collection of Column objects that are currently selected.

[Visual Basic]

Public ReadOnly Property Selected As ColumnCollection

[C#]

public ColumnCollection Selected {get;}

[Delphi]

public property Selected: ColumnCollection read get_Selected;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection Methods

ColumnCollection Methods

The methods of the ColumnCollection class are listed here. For a complete list of ColumnCollection class members, see the ColumnCollection Members topic.

Public Methods

Add | Appends a new Column object to this collection.
Contains | Overloaded. Gets a value that determines whether the collection contains a Column with the given name.
IndexOf | Gets the index of the Column with the specified name.
Insert | Adds a new Column object to this collection at a specified position.
InsertRange | Adds a range of Column objects to the collection at a specified position.
Move | Overriden. Moves a Column object to a new position in the collection.
MoveRange | Overriden. Moves a range of Column objects to a new position in the collection.
Remove | Overloaded. Removes a Column object from the collection.
RemoveRange | Removes a range of Column objects from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Add Method

ColumnCollection.Add Method

Appends a new Column object to this collection.

[Visual Basic]

Public Function Add() As Column

[C#]

public Column Add()

[Delphi]

public function Add(): Column;

Return Value

A reference to the Column that was added to the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Contains Method

ColumnCollection.Contains Method

Gets a value that determines whether the collection contains a Column with the given name.

[Visual Basic]

Public Function Contains( _

ByVal columnName As String _

) As Boolean

[C#]

public bool Contains(

string columnName

);

[Delphi]

public function Contains(

columnName: String

): Boolean; overload;

Parameters

columnName

Column name to look for (case-insensitive).

Return Value

True if the collection contains a column with the given name, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.IndexOf Method

ColumnCollection.IndexOf Method

Gets the index of the Column with the specified name.

[Visual Basic]

Public Function IndexOf( _

ByVal columnName As String _

) As Integer

[C#]

public int IndexOf(

string columnName

);

[Delphi]

public function IndexOf(

columnName: String

): Int32;

Parameters

columnName

Column name to look for (case-insensitive).

Return Value

Index of the column that has the given name in this collection, or -1 if the collection does not contain a column with the given name.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Insert Method

ColumnCollection.Insert Method

Adds a new Column object to this collection at a specified position.

[Visual Basic]

Public Function Insert( _

ByVal index As Integer _

) As Column

[C#]

public Column Insert(

int index

);

[Delphi]

public function Insert(

index: Int32

): Column;

Parameters

index

The position where the new column will be inserted.

Return Value

A reference to the Column that was inserted to the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.InsertRange Method

ColumnCollection.InsertRange Method

Adds a range of Column objects to the collection at a specified position.

[Visual Basic]

Public Sub InsertRange( _

ByVal index As Integer, _

ByVal count As Integer _

)

[C#]

public void InsertRange(

int index,

int count

);

[Delphi]

public procedure InsertRange(

index: Int32;

count: Int32

);

Parameters

index

The position where the new range will be inserted.

count

The number of columns to add.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Move Method

ColumnCollection.Move Method

Moves a Column object to a new position in the collection.

[Visual Basic]

Overrides Public Sub Move( _

ByVal indexOld As Integer, _

ByVal indexNew As Integer _

)

[C#]

override public void Move(

int indexOld,

int indexNew

);

[Delphi]

public procedure Move(

indexOld: Int32;

indexNew: Int32

); override;

Parameters

indexOld

Index of the column to be moved.

indexNew

New position for the column.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.MoveRange Method

ColumnCollection.MoveRange Method

Moves a range of Column objects to a new position in the collection.

[Visual Basic]

Overrides Public Sub MoveRange( _

ByVal index As Integer, _

ByVal count As Integer, _

ByVal indexNew As Integer _

)

[C#]

override public void MoveRange(

int index,

int count,

int indexNew

);

[Delphi]

public procedure MoveRange(

index: Int32;

count: Int32;

indexNew: Int32

); override;

Parameters

index

The index of the first column in the range that will be moved.

count

The number of columns that will be moved.

indexNew

New position for the first column in the range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Remove Method

ColumnCollection.Remove Method

Overload List

Removes a Column object from the collection.

[Visual Basic] Overloads Public Function Remove(Column) As Column

[C#] public Column Remove(Column);

[Delphi] public function Remove(Column) : Column; overload;

Removes a Column object from the collection.

[Visual Basic] Overloads Public Function Remove(Integer) As Column

[C#] public Column Remove(int);

[Delphi] public function Remove(Int32) : Column; overload;

Removes a Column object from the collection.

[Visual Basic] Overloads Public Function Remove(String) As Column

[C#] public Column Remove(string);

[Delphi] public function Remove(String) : Column; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Remove Method (Column)

ColumnCollection.Remove Method (Column)

Removes a Column object from the collection.

[Visual Basic]

Overloads Public Function Remove( _

ByVal column As Column _

) As Column

[C#]

public Column Remove(

Column column

);

[Delphi]

public function Remove(

column: Column

): Column; overload;

Parameters

column

The column to remove.

Return Value

A reference to the Column that was removed from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Remove Method (Int32)

ColumnCollection.Remove Method (Int32)

Removes a Column object from the collection.

[Visual Basic]

Overloads Public Function Remove( _

ByVal index As Integer _

) As Column

[C#]

public Column Remove(

int index

);

[Delphi]

public function Remove(

index: Int32

): Column; overload;

Parameters

index

The index of the column to remove from the collection.

Return Value

A reference to the Column that was removed from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.Remove Method (String)

ColumnCollection.Remove Method (String)

Removes a Column object from the collection.

[Visual Basic]

Overloads Public Function Remove( _

ByVal columnName As String _

) As Column

[C#]

public Column Remove(

string columnName

);

[Delphi]

public function Remove(

columnName: String

): Column; overload;

Parameters

columnName

Name of the column to remove.

Return Value

A reference to the Column that was removed from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnCollection.RemoveRange Method

ColumnCollection.RemoveRange Method

Removes a range of Column objects from the collection.

[Visual Basic]

Public Sub RemoveRange( _

ByVal index As Integer, _

ByVal count As Integer _

)

[C#]

public void RemoveRange(

int index,

int count

);

[Delphi]

public procedure RemoveRange(

index: Int32;

count: Int32

);

Parameters

index

The index of the first column to remove from the collection.

count

The number of columns to remove from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DisplayEnum Enumeration

DisplayEnum Enumeration

Specifies whether a style should display the cell text, image, both, or none.

[Visual Basic]

Public Enum DisplayEnum

[C#]

public enum DisplayEnum

[Delphi]

type DisplayEnum = (ImageOnly, None, Overlay, Stack, TextOnly);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
ImageOnly | Display image only (no text).
None | Nothing (cell stays blank).
Overlay | Display the text over the image.
Stack | Display the text next to the image.
TextOnly | Display text only (no image).

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragModeEnum Enumeration

DragModeEnum Enumeration

Specifies the behavior of the control as an OLE drag-drop source.

[Visual Basic]

Public Enum DragModeEnum

[C#]

public enum DragModeEnum

[Delphi]

type DragModeEnum = (Automatic, AutomaticCopy, AutomaticMove, Manual);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Automatic | The control provides automatic dragging of data. If the mouse hovers near the edges of the selected range, the cursor will change and allow the user to move or copy data (pressing the CTRL key to copy).
AutomaticCopy | Same as Automatic, except the data is always copied (never moved).
AutomaticMove | Same as Automatic, except the data is always moved (never copied).
Manual | The control does not provide any drag support. The caller can still initiate drag-drop operations using the System.Windows.Forms.Control.DoDragDrop(System.Object,System.Windows.Forms.DragDropEffects) method.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragRowColEventArgs Class

DragRowColEventArgs Class

Provides data for the BeforeDragColumn, BeforeDragRow, AfterDragColumn, and AfterDragRow events.

For a list of all members of this type, see DragRowColEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.DragRowColEventArgs

[Visual Basic]

Public Class DragRowColEventArgs

Inherits EventArgs

[C#]

public class DragRowColEventArgs : EventArgs

[Delphi]

type DragRowColEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragRowColEventArgs Members

DragRowColEventArgs Members

DragRowColEventArgs overview

Public Constructors

DragRowColEventArgs Constructor

Initializes a new instance of the DragRowColEventArgs class.

Public Fields

Cancel | Gets or sets a value indicating whether the drag operation should be canceled.
Col | Gets the original index of the column that was dragged by the user.
Position | Gets the new index of the column or row that was dragged by the user.
Row | Gets the original index of the row that was dragged by the user.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragRowColEventArgs Constructor

DragRowColEventArgs Constructor

Initializes a new instance of the DragRowColEventArgs class.

[Visual Basic]

Public Function New( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal position As Integer _

)

[C#]

public DragRowColEventArgs(

int row,

int col,

int position

);

[Delphi]

public constructor Create(

row: Int32;

col: Int32;

position: Int32

);

Parameters

row

The original index of the row that was dragged by the user.

col

The original index of the column that was dragged by the user.

position

The new index of the column or row.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragRowColEventArgs Fields

DragRowColEventArgs Fields

The fields of the DragRowColEventArgs class are listed here. For a complete list of DragRowColEventArgs class members, see the DragRowColEventArgs Members topic.

Public Fields

Cancel | Gets or sets a value indicating whether the drag operation should be canceled.
Col | Gets the original index of the column that was dragged by the user.
Position | Gets the new index of the column or row that was dragged by the user.
Row | Gets the original index of the row that was dragged by the user.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragRowColEventArgs.Cancel Field

DragRowColEventArgs.Cancel Field

Gets or sets a value indicating whether the drag operation should be canceled.

[Visual Basic]

Public Cancel As Boolean

[C#]

public bool Cancel

[Delphi]

public Cancel: Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragRowColEventArgs.Col Field

DragRowColEventArgs.Col Field

Gets the original index of the column that was dragged by the user.

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragRowColEventArgs.Position Field

DragRowColEventArgs.Position Field

Gets the new index of the column or row that was dragged by the user.

[Visual Basic]

Public Position As Integer

[C#]

public int Position

[Delphi]

public Position: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragRowColEventArgs.Row Field

DragRowColEventArgs.Row Field

Gets the original index of the row that was dragged by the user.

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DragRowColEventHandler Delegate

DragRowColEventHandler Delegate

Represents the method that will handle the BeforeDragColumn, BeforeDragRow, AfterDragColumn and AfterDragRow events.

[Visual Basic]

Public Delegate Sub DragRowColEventHandler( _

ByVal sender As Object, _

ByVal e As DragRowColEventArgs _

)

[C#]

public delegate void DragRowColEventHandler(

object sender,

DragRowColEventArgs e

);

[Delphi]

type DragRowColEventHandler = procedure (

sender: Object;

e: DragRowColEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DrawCellFlags Enumeration

DrawCellFlags Enumeration

Specifies which elements of the cell should be drawn by the grid.

[Visual Basic]

Public Enum DrawCellFlags

[C#]

public enum DrawCellFlags

[Delphi]

type DrawCellFlags = (All, Background, Border, Content);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Remarks

This enumeration is used when rendering owner-drawn cells.

If you set the System.Windows.Forms.DrawMode property to DrawModeEnum.OwnerDraw, the grid will fire the OwnerDrawCell event to allow custom cell drawing.

The OwnerDrawCellEventArgs parameter passed to the event handler has a DrawCell (DrawCellFlags) method that allows you to use the standard drawing routines for rendering parts of the cell. For example, you can paint a custom background and use the standard drawing routines for the cell borders and content.

See the OwnerDrawCell event for an example.

Members

Member name | Description
All | Draw all cell elements (background, border, and contents).
Background | Draw the cell background.
Border | Draw the cell border.
Content | Draw the cell content (text, images, checkboxes, etc).

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DrawModeEnum Enumeration

DrawModeEnum Enumeration

Specifies whether cells should be drawn entirely by the grid or with help from custom drawing code.

[Visual Basic]

Public Enum DrawModeEnum

[C#]

public enum DrawModeEnum

[Delphi]

type DrawModeEnum = (Normal, OwnerDraw);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Normal | Grid cells are drawn by the grid.
OwnerDraw | The grid fires the OwnerDrawCell event to allow custom cell drawing.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DropModeEnum Enumeration

DropModeEnum Enumeration

Specifies the behavior of the control as an OLE drag-drop target.

[Visual Basic]

Public Enum DropModeEnum

[C#]

public enum DropModeEnum

[Delphi]

type DropModeEnum = (Automatic, Manual, None);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Automatic | The control automatically handles dropping of text or filename data.
Manual | The control fires drag-drop events that can be handled to provide drop target functionality.
None | The control cannot be used as a drop target.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


EditFlags Enumeration

EditFlags Enumeration

Specifies options that customize the grid's editing behavior.

[Visual Basic]

Public Enum EditFlags

[C#]

public enum EditFlags

[Delphi]

type EditFlags = (All, AutoSearch, CycleOnDoubleClick, MultiCheck, None);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
All | All of the above.
AutoSearch | Search for entries in lists as the user types.
CycleOnDoubleClick | Cycle to the next item on the list when the user double-clicks a cell.
MultiCheck | Check and uncheck all checkboxes in a selection simultaneously.
None | No special behavior.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FileFlags Enumeration

FileFlags Enumeration

Specifies options for use with the SaveGrid (String, FileFormatEnum, FileFlags, Encoding) and LoadGrid (String, FileFormatEnum, FileFlags, Encoding) methods.

[Visual Basic]

Public Enum FileFlags

[C#]

public enum FileFlags

[Delphi]

type FileFlags = (AsDisplayed, IncludeFixedCells, None, SelectedRowsOnly, VisibleOnly);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
AsDisplayed | Save values as displayed (including formatting and mapping where available). This flag has no effect when saving text files, which always contain values as displayed.
IncludeFixedCells | Include fixed cells when loading or saving the grid.
None | Use default settings.
SelectedRowsOnly | Save only selected rows.
VisibleOnly | Save only visible rows and columns.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FileFormatEnum Enumeration

FileFormatEnum Enumeration

Specifies the type of file to save or load with the SaveGrid (String, FileFormatEnum, FileFlags, Encoding) and LoadGrid (String, FileFormatEnum, FileFlags, Encoding) methods.

[Visual Basic]

Public Enum FileFormatEnum

[C#]

public enum FileFormatEnum

[Delphi]

type FileFormatEnum = (Excel, TextComma, TextCustom, TextTab);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Excel | Microsoft Excel files (xls, biff-8 format).
TextComma | Text file, cells separated with commas.
TextCustom | Text file, cells separated with the character specified by the ClipSeparators property.
TextTab | Text file, cells separated with tabs.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FocusRectEnum Enumeration

FocusRectEnum Enumeration

Specifies the appearance of the focus rectangle.

[Visual Basic]

Public Enum FocusRectEnum

[C#]

public enum FocusRectEnum

[Delphi]

type FocusRectEnum = (Heavy, Inset, Light, None, Raised, Solid);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Heavy | Show a heavy focus rectangle (dotted, 2-pixel wide).
Inset | Show an inset focus rectangle.
Light | Show a light focus rectangle (dotted, 1-pixel wide). This is the default setting.
None | No focus rectangle.
Raised | Show a raised focus rectangle.
Solid | Show a solid focus rectangle. The color of the rectangle is determined by the value of the Highlight property.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GetErrorInfoEventArgs Class

GetErrorInfoEventArgs Class

Provides data for the GetCellErrorInfo and GetRowErrorInfo events.

For a list of all members of this type, see GetErrorInfoEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.GetErrorInfoEventArgs

[Visual Basic]

Public Class GetErrorInfoEventArgs

Inherits EventArgs

[C#]

public class GetErrorInfoEventArgs : EventArgs

[Delphi]

type GetErrorInfoEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GetErrorInfoEventArgs Members

GetErrorInfoEventArgs Members

GetErrorInfoEventArgs overview

Public Constructors

GetErrorInfoEventArgs Constructor

Initializes a new instance of the GetErrorInfoEventArgs class.

Public Fields

Col | Gets the index of the column that may contain errors (or -1 if checking for row errors).
ErrorText | Gets or sets a message that describes the error.
Row | Gets the index of the row that may contain errors.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GetErrorInfoEventArgs Constructor

GetErrorInfoEventArgs Constructor

Initializes a new instance of the GetErrorInfoEventArgs class.

[Visual Basic]

Public Function New( _

ByVal row As Integer, _

ByVal col As Integer _

)

[C#]

public GetErrorInfoEventArgs(

int row,

int col

);

[Delphi]

public constructor Create(

row: Int32;

col: Int32

);

Parameters

row

The row index when error information is needed for a cell or row.

col

The column index when error information is needed for a cell or row.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GetErrorInfoEventArgs Fields

GetErrorInfoEventArgs Fields

The fields of the GetErrorInfoEventArgs class are listed here. For a complete list of GetErrorInfoEventArgs class members, see the GetErrorInfoEventArgs Members topic.

Public Fields

Col | Gets the index of the column that may contain errors (or -1 if checking for row errors).
ErrorText | Gets or sets a message that describes the error.
Row | Gets the index of the row that may contain errors.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GetErrorInfoEventArgs.Col Field

GetErrorInfoEventArgs.Col Field

Gets the index of the column that may contain errors (or -1 if checking for row errors).

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GetErrorInfoEventArgs.ErrorText Field

GetErrorInfoEventArgs.ErrorText Field

Gets or sets a message that describes the error.

[Visual Basic]

Public ErrorText As String

[C#]

public string ErrorText

[Delphi]

public ErrorText: String;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GetErrorInfoEventArgs.Row Field

GetErrorInfoEventArgs.Row Field

Gets the index of the row that may contain errors.

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GetErrorInfoEventHandler Delegate

GetErrorInfoEventHandler Delegate

Represents the method that will handle the GetCellErrorInfo and GetRowErrorInfo events.

[Visual Basic]

Public Delegate Sub GetErrorInfoEventHandler( _

ByVal sender As Object, _

ByVal e As GetErrorInfoEventArgs _

)

[C#]

public delegate void GetErrorInfoEventHandler(

object sender,

GetErrorInfoEventArgs e

);

[Delphi]

type GetErrorInfoEventHandler = procedure (

sender: Object;

e: GetErrorInfoEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GlyphEnum Enumeration

GlyphEnum Enumeration

Specifies a type of glyph (image) used by the grid to convey information about a row, column, or cell.

[Visual Basic]

Public Enum GlyphEnum

[C#]

public enum GlyphEnum

[Delphi]

type GlyphEnum = (Ascending, Checked, Collapsed, DBAdd, DBCursor, Descending, ErrorInfo, Expanded, Grayed, Unchecked);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Ascending | Indicates column sorted in ascending order (default is hollow triangle pointing up).
Checked | Checkbox in checked state.
Collapsed | Collapsed tree node (default is plus sign).
DBAdd | Indicates row being added to data source (default is asterisk).
DBCursor | Indicates current record (default is black triangle pointing right).
Descending | Indicates column sorted in descending order (default is hollow triangle pointing down).
ErrorInfo | Indicates row or cell error (default is red exclamation sign).
Expanded | Expanded tree node (default is minus sign).
Grayed | Checkbox in gray (undefined) state.
Unchecked | Checkbox in unchecked state.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedEventArgs Class

GridChangedEventArgs Class

Provides data for the GridChanged event handler.

For a list of all members of this type, see GridChangedEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.GridChangedEventArgs

[Visual Basic]

Public Class GridChangedEventArgs

Inherits EventArgs

[C#]

public class GridChangedEventArgs : EventArgs

[Delphi]

type GridChangedEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedEventArgs Members

GridChangedEventArgs Members

GridChangedEventArgs overview

Public Fields

c1 | Range of cells affected by the event.
c2 | Range of cells affected by the event.
GridChangedType | The type of action that caused the event to fire.
r1 | Range of cells affected by the event.
r2 | Range of cells affected by the event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedEventArgs Fields

GridChangedEventArgs Fields

The fields of the GridChangedEventArgs class are listed here. For a complete list of GridChangedEventArgs class members, see the GridChangedEventArgs Members topic.

Public Fields

c1 | Range of cells affected by the event.
c2 | Range of cells affected by the event.
GridChangedType | The type of action that caused the event to fire.
r1 | Range of cells affected by the event.
r2 | Range of cells affected by the event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedEventArgs.c1 Field

GridChangedEventArgs.c1 Field

Range of cells affected by the event.

[Visual Basic]

Public ReadOnly c1 As Integer

[C#]

public readonly int c1

[Delphi]

public c1: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedEventArgs.c2 Field

GridChangedEventArgs.c2 Field

Range of cells affected by the event.

[Visual Basic]

Public ReadOnly c2 As Integer

[C#]

public readonly int c2

[Delphi]

public c2: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedEventArgs.GridChangedType Field

GridChangedEventArgs.GridChangedType Field

The type of action that caused the event to fire.

[Visual Basic]

Public ReadOnly GridChangedType As GridChangedTypeEnum

[C#]

public readonly GridChangedTypeEnum GridChangedType

[Delphi]

public GridChangedType: GridChangedTypeEnum;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedEventArgs.r1 Field

GridChangedEventArgs.r1 Field

Range of cells affected by the event.

[Visual Basic]

Public ReadOnly r1 As Integer

[C#]

public readonly int r1

[Delphi]

public r1: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedEventArgs.r2 Field

GridChangedEventArgs.r2 Field

Range of cells affected by the event.

[Visual Basic]

Public ReadOnly r2 As Integer

[C#]

public readonly int r2

[Delphi]

public r2: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedEventHandler Delegate

GridChangedEventHandler Delegate

Represents the method that will handle the GridChanged event.

[Visual Basic]

Public Delegate Sub GridChangedEventHandler( _

ByVal sender As Object, _

ByVal e As GridChangedEventArgs _

)

[C#]

public delegate void GridChangedEventHandler(

object sender,

GridChangedEventArgs e

);

[Delphi]

type GridChangedEventHandler = procedure (

sender: Object;

e: GridChangedEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridChangedTypeEnum Enumeration

GridChangedTypeEnum Enumeration

Specifies the type of change that occurred when the controls fires the GridChanged event.

[Visual Basic]

Public Enum GridChangedTypeEnum

[C#]

public enum GridChangedTypeEnum

[Delphi]

type GridChangedTypeEnum = (AfterCollapse, AfterSelChange, BeforeCollapse, BeforeSelChange, ColAdded, ColMoved, ColRemoved, ColSelected, EnsureVisible, GridChanged, LayoutChanged, None, RepaintCell, RepaintGrid, RepaintRange, RowAdded, RowMoved, RowRemoved, RowSelected, Select, StyleApplied, StyleChanged, Update);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
AfterCollapse | A tree node has just been collapsed or expanded.
AfterSelChange | The selection has just changed.
BeforeCollapse | A tree node is about to be collapsed or expanded.
BeforeSelChange | The selection is about to change.
ColAdded | A column has been added to the grid.
ColMoved | A column has been moved into a new position.
ColRemoved | A column has been removed from the grid.
ColSelected | A column has been selected or de-selected.
EnsureVisible | A tree node will be scrolled into view.
GridChanged | The number of grid rows or columns has changed.
LayoutChanged | The number of fixed grid rows or columns has changed.
None | No action.
RepaintCell | The value in a cell has changed.
RepaintGrid | The grid has been invalidated and will be repainted.
RepaintRange | A range has been invalidated and will be repainted.
RowAdded | A row has been added to the grid.
RowMoved | A row has been moved into a new position.
RowRemoved | A row has been removed from the grid.
RowSelected | A row has been selected or de-selected.
Select | A tree node will be selected.
StyleApplied | A style has been applied to a range.
StyleChanged | A style definition has changed.
Update | The grid will be repainted.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridErrorEventArgs Class

GridErrorEventArgs Class

Provides data for the GridError event.

For a list of all members of this type, see GridErrorEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.GridErrorEventArgs

[Visual Basic]

Public Class GridErrorEventArgs

Inherits EventArgs

[C#]

public class GridErrorEventArgs : EventArgs

[Delphi]

type GridErrorEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridErrorEventArgs Members

GridErrorEventArgs Members

GridErrorEventArgs overview

Public Constructors

GridErrorEventArgs Constructor

Initializes a new instance of the GridErrorEventArgs class.

Public Fields

Col | Gets the column index of the cell where the error was detected.
Exception | Gets the Exception object that contains information about the error.
Handled | Gets or sets a value indicating whether the error situation has been handled by the control.
Row | Gets the row index of the cell where the error was detected.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridErrorEventArgs Constructor

GridErrorEventArgs Constructor

Initializes a new instance of the GridErrorEventArgs class.

[Visual Basic]

Public Function New( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal exception As Exception, _

ByVal handled As Boolean _

)

[C#]

public GridErrorEventArgs(

int row,

int col,

Exception exception,

bool handled

);

[Delphi]

public constructor Create(

row: Int32;

col: Int32;

exception: Exception;

handled: Boolean

);

Parameters

row

The row index of the cell where the error was detected.

col

The column index of the cell where the error was detected.

exception

The Exception object that contains information about the error.

handled

Whether the error was handled internally and no exception should be thrown.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridErrorEventArgs Fields

GridErrorEventArgs Fields

The fields of the GridErrorEventArgs class are listed here. For a complete list of GridErrorEventArgs class members, see the GridErrorEventArgs Members topic.

Public Fields

Col | Gets the column index of the cell where the error was detected.
Exception | Gets the Exception object that contains information about the error.
Handled | Gets or sets a value indicating whether the error situation has been handled by the control.
Row | Gets the row index of the cell where the error was detected.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridErrorEventArgs.Col Field

GridErrorEventArgs.Col Field

Gets the column index of the cell where the error was detected.

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridErrorEventArgs.Exception Field

GridErrorEventArgs.Exception Field

Gets the Exception object that contains information about the error.

[Visual Basic]

Public ReadOnly Exception As Exception

[C#]

public readonly Exception Exception

[Delphi]

public Exception: Exception;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridErrorEventArgs.Handled Field

GridErrorEventArgs.Handled Field

Gets or sets a value indicating whether the error situation has been handled by the control.

[Visual Basic]

Public Handled As Boolean

[C#]

public bool Handled

[Delphi]

public Handled: Boolean;

Remarks

If this value is set to False, the grid will throw the exception.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridErrorEventArgs.Row Field

GridErrorEventArgs.Row Field

Gets the row index of the cell where the error was detected.

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridErrorEventHandler Delegate

GridErrorEventHandler Delegate

Represents the method that will handle the GridError event.

[Visual Basic]

Public Delegate Sub GridErrorEventHandler( _

ByVal sender As Object, _

ByVal e As GridErrorEventArgs _

)

[C#]

public delegate void GridErrorEventHandler(

object sender,

GridErrorEventArgs e

);

[Delphi]

type GridErrorEventHandler = procedure (

sender: Object;

e: GridErrorEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridGlyphs Class

GridGlyphs Class

Represents a collection of glyphs (images) indexed by glyph type ( GlyphEnum type).

For a list of all members of this type, see GridGlyphs Members.

System.Object

C1.Win.C1FlexGrid.GridGlyphs

[Visual Basic]

Public Class GridGlyphs

[C#]

public class GridGlyphs

[Delphi]

type GridGlyphs = class;

Remarks

The GridGlyphs collection contains the images used by the grid to indicate column sorting direction, collapsed and expanded outline groups, checkboxes, cursors, error information, etc.

You can use the Glyphs property get or set these images.

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridGlyphs Members

GridGlyphs Members

GridGlyphs overview

Public Properties

Item

Gets or sets the glyph for a particular GlyphEnum value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridGlyphs Properties

GridGlyphs Properties

The properties of the GridGlyphs class are listed here. For a complete list of GridGlyphs class members, see the GridGlyphs Members topic.

Public Properties

Item

Gets or sets the glyph for a particular GlyphEnum value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridGlyphs.Item Property

GridGlyphs.Item Property

Gets or sets the glyph for a particular GlyphEnum value.

[Visual Basic]

Public Default Property Item( _

ByVal glyph As GlyphEnum _

) As Image

[C#]

public Image this[

GlyphEnum glyph

] {get;set;}

[Delphi]

public property Item[

glyph: GlyphEnum

]: Image read get_Item write set_Item;

Remarks

Setting a glyph to Null causes the grid to use the default image for the glyph. To suppress a glyph, assign it a small transparent image.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter Class

GridPrinter Class

The GridPrinter class encapsulates properties that control printing, such as page and printer settings.

For a list of all members of this type, see GridPrinter Members.

System.Object

C1.Win.C1FlexGrid.GridPrinter

[Visual Basic]

Public Class GridPrinter

[C#]

public class GridPrinter

[Delphi]

type GridPrinter = class;

Remarks

See also the PrintGrid (String, PrintGridFlags) method.

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter Members

GridPrinter Members

GridPrinter overview

Public Properties

Footer | Gets or sets a string that contains the page footers.
FooterFont | Specifies the font to use for rendering page footers.
Header | Gets or sets a string that contains the page headers.
HeaderFont | Specifies the font to use for rendering page headers.
PageCount | Gets the total number of the pages in the print document.
PageNumber | Gets the number of the page being printed (one-based count).
PrintDocument | Gets the System.Drawing.Printing.PrintDocument object that specifies page and printer settings.
PrintGridFlags | Gets or sets the flags that specify printing options to use with the PrintGrid (String, PrintGridFlags) method. See the PrintGridFlags enumeration for details.
PrintPreviewDialog | Gets a reference to the PrintPreviewDialog used to display the grid's print preview.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter Properties

GridPrinter Properties

The properties of the GridPrinter class are listed here. For a complete list of GridPrinter class members, see the GridPrinter Members topic.

Public Properties

Footer | Gets or sets a string that contains the page footers.
FooterFont | Specifies the font to use for rendering page footers.
Header | Gets or sets a string that contains the page headers.
HeaderFont | Specifies the font to use for rendering page headers.
PageCount | Gets the total number of the pages in the print document.
PageNumber | Gets the number of the page being printed (one-based count).
PrintDocument | Gets the System.Drawing.Printing.PrintDocument object that specifies page and printer settings.
PrintGridFlags | Gets or sets the flags that specify printing options to use with the PrintGrid (String, PrintGridFlags) method. See the PrintGridFlags enumeration for details.
PrintPreviewDialog | Gets a reference to the PrintPreviewDialog used to display the grid's print preview.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter.Footer Property

GridPrinter.Footer Property

Gets or sets a string that contains the page footers.

[Visual Basic]

Public Property Footer As String

[C#]

public string Footer {get;set;}

[Delphi]

public property Footer: String read get_Footer write set_Footer;

Remarks

The string may be divided by tab characters into up to three sections. The sections are then left, center, and right-aligned at the top of each page.

The string may contain placeholders "{0}" and "{1}" which are replaced with the current page number and total page count.

Use the FooterFont property to select the font used to render the footer.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter.FooterFont Property

GridPrinter.FooterFont Property

Specifies the font to use for rendering page footers.

[Visual Basic]

Public Property FooterFont As Font

[C#]

public Font FooterFont {get;set;}

[Delphi]

public property FooterFont: Font read get_FooterFont write set_FooterFont;

Remarks

See also the Footer property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter.Header Property

GridPrinter.Header Property

Gets or sets a string that contains the page headers.

[Visual Basic]

Public Property Header As String

[C#]

public string Header {get;set;}

[Delphi]

public property Header: String read get_Header write set_Header;

Remarks

The string may be divided by tab characters into up to three sections. The sections are then left, center, and right-aligned at the top of each page.

The string may contain placeholders "{0}" and "{1}" which are replaced with the current page number and total page count.

Use the HeaderFont property to select the font used to render the header.

Example

The code below specifies a right-aligned header with a "Page n of m" display using a 10-point Tahoma font.

_flex.Header = "\t\tPage {0} of {1}";

_flex.HeaderFont = new Font("Tahoma", 10);

_flex.PrintGrid("Header");

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter.HeaderFont Property

GridPrinter.HeaderFont Property

Specifies the font to use for rendering page headers.

[Visual Basic]

Public Property HeaderFont As Font

[C#]

public Font HeaderFont {get;set;}

[Delphi]

public property HeaderFont: Font read get_HeaderFont write set_HeaderFont;

Remarks

See also the Header property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter.PageCount Property

GridPrinter.PageCount Property

Gets the total number of the pages in the print document.

[Visual Basic]

Public ReadOnly Property PageCount As Integer

[C#]

public int PageCount {get;}

[Delphi]

public property PageCount: Int32 read get_PageCount;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter.PageNumber Property

GridPrinter.PageNumber Property

Gets the number of the page being printed (one-based count).

[Visual Basic]

Public ReadOnly Property PageNumber As Integer

[C#]

public int PageNumber {get;}

[Delphi]

public property PageNumber: Int32 read get_PageNumber;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter.PrintDocument Property

GridPrinter.PrintDocument Property

Gets the System.Drawing.Printing.PrintDocument object that specifies page and printer settings.

[Visual Basic]

Public ReadOnly Property PrintDocument As PrintDocument

[C#]

public PrintDocument PrintDocument {get;}

[Delphi]

public property PrintDocument: PrintDocument read get_PrintDocument;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter.PrintGridFlags Property

GridPrinter.PrintGridFlags Property

Gets or sets the flags that specify printing options to use with the PrintGrid (String, PrintGridFlags) method. See the PrintGridFlags enumeration for details.

[Visual Basic]

Public Property PrintGridFlags As PrintGridFlags

[C#]

public PrintGridFlags PrintGridFlags {get;set;}

[Delphi]

public property PrintGridFlags: PrintGridFlags read get_PrintGridFlags write set_PrintGridFlags;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridPrinter.PrintPreviewDialog Property

GridPrinter.PrintPreviewDialog Property

Gets a reference to the PrintPreviewDialog used to display the grid's print preview.

[Visual Basic]

Public ReadOnly Property PrintPreviewDialog As PrintPreviewDialog

[C#]

public PrintPreviewDialog PrintPreviewDialog {get;}

[Delphi]

public property PrintPreviewDialog: PrintPreviewDialog read get_PrintPreviewDialog;

Remarks

Use this property to customize the size and position of the preview dialog when printing the grid with the PrintGridFlags option.

Example

The code below uses the PrintPreviewDialog property to display the preview dialog with a custom caption and in a maximized state:

Form dlg = _flex.PrintParameters.PrintPreviewDialog as Form;

dlg.Text = "Custom Caption";

dlg.StartPosition = FormStartPosition.Manual;

dlg.WindowState = FormWindowState.Maximized;

_flex.PrintGrid("test", PrintGridFlags.ShowPreviewDialog);

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree Class

GridTree Class

The GridTree class enapsulates properties that specify the appearance, position, and behavior of the outline tree.

For a list of all members of this type, see GridTree Members.

System.Object

C1.Win.C1FlexGrid.GridTree

[Visual Basic]

Public Class GridTree

[C#]

public class GridTree

[Delphi]

type GridTree = class;

Remarks

Each grid has a single GridTree object, which can be obtained using the Tree property.

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree Members

GridTree Members

GridTree overview

Public Properties

Column | Gets or sets the index of the column where the outline tree is displayed.
Indent | Gets or sets the indentation, in pixels, of each tree level.
LineColor | Gets or sets the color of the lines in the outline tree.
LineStyle | Gets or sets the line style used to draw the outline tree.
NodeImageCollapsed | Gets or sets the image displayed next to collapsed nodes.
NodeImageExpanded | Gets or sets the image displayed next to expanded nodes.
Style | Gets or sets the style of the outline tree.

Public Methods

Clear | Resets the Tree object.
Show | Expands all nodes up to the specified level, collapsed others.
Sort | Sorts all nodes a the given level.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree Properties

GridTree Properties

The properties of the GridTree class are listed here. For a complete list of GridTree class members, see the GridTree Members topic.

Public Properties

Column | Gets or sets the index of the column where the outline tree is displayed.
Indent | Gets or sets the indentation, in pixels, of each tree level.
LineColor | Gets or sets the color of the lines in the outline tree.
LineStyle | Gets or sets the line style used to draw the outline tree.
NodeImageCollapsed | Gets or sets the image displayed next to collapsed nodes.
NodeImageExpanded | Gets or sets the image displayed next to expanded nodes.
Style | Gets or sets the style of the outline tree.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.Column Property

GridTree.Column Property

Gets or sets the index of the column where the outline tree is displayed.

[Visual Basic]

Public Property Column As Integer

[C#]

public int Column {get;set;}

[Delphi]

public property Column: Int32 read get_Column write set_Column;

Remarks

By default, this property is set to -1, which causes the tree to be hidden.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.Indent Property

GridTree.Indent Property

Gets or sets the indentation, in pixels, of each tree level.

[Visual Basic]

Public Property Indent As Integer

[C#]

public int Indent {get;set;}

[Delphi]

public property Indent: Int32 read get_Indent write set_Indent;

Remarks

If you set the Indent property to a value that is too narrow to fit the NodeImageCollapsed and NodeImageExpanded images, the grid will adjust it to fit the images.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.LineColor Property

GridTree.LineColor Property

Gets or sets the color of the lines in the outline tree.

[Visual Basic]

Public Property LineColor As Color

[C#]

public Color LineColor {get;set;}

[Delphi]

public property LineColor: Color read get_LineColor write set_LineColor;

Remarks

See also the Style property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.LineStyle Property

GridTree.LineStyle Property

Gets or sets the line style used to draw the outline tree.

[Visual Basic]

Public Property LineStyle As DashStyle

[C#]

public DashStyle LineStyle {get;set;}

[Delphi]

public property LineStyle: DashStyle read get_LineStyle write set_LineStyle;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.NodeImageCollapsed Property

GridTree.NodeImageCollapsed Property

Gets or sets the image displayed next to collapsed nodes.

[Visual Basic]

Public Property NodeImageCollapsed As Image

[C#]

public Image NodeImageCollapsed {get;set;}

[Delphi]

public property NodeImageCollapsed: Image read get_NodeImageCollapsed write set_NodeImageCollapsed;

Remarks

Setting this property to Null resets it and causes the grid to use the default image (a plus sign).

To hide the images, use the Style property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.NodeImageExpanded Property

GridTree.NodeImageExpanded Property

Gets or sets the image displayed next to expanded nodes.

[Visual Basic]

Public Property NodeImageExpanded As Image

[C#]

public Image NodeImageExpanded {get;set;}

[Delphi]

public property NodeImageExpanded: Image read get_NodeImageExpanded write set_NodeImageExpanded;

Remarks

Setting this property to Null resets it and causes the grid to use the default image (a minus sign).

To hide the images, use the Style property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.Style Property

GridTree.Style Property

Gets or sets the style of the outline tree.

[Visual Basic]

Public Property Style As TreeStyleFlags

[C#]

public TreeStyleFlags Style {get;set;}

[Delphi]

public property Style: TreeStyleFlags read get_Style write set_Style;

Remarks

Use the Style property to determine whether the outline tree should include lines connecting the nodes and buttons for collapsing and expanding the nodes. See the TreeStyleFlags enumeration for details.

Use the Column property to determine where the grid will show the outline tree.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree Methods

GridTree Methods

The methods of the GridTree class are listed here. For a complete list of GridTree class members, see the GridTree Members topic.

Public Methods

Clear | Resets the Tree object.
Show | Expands all nodes up to the specified level, collapsed others.
Sort | Sorts all nodes a the given level.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.Clear Method

GridTree.Clear Method

Resets the Tree object.

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.Show Method

GridTree.Show Method

Expands all nodes up to the specified level, collapsed others.

[Visual Basic]

Public Sub Show( _

ByVal level As Integer _

)

[C#]

public void Show(

int level

);

[Delphi]

public procedure Show(

level: Int32

);

Parameters

level

The level to show. Any nodes with Level higher than this will be collapsed, others will be expanded.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GridTree.Sort Method

GridTree.Sort Method

Sorts all nodes a the given level.

[Visual Basic]

Public Sub Sort( _

ByVal level As Integer, _

ByVal order As SortFlags, _

ByVal col1 As Integer, _

ByVal col2 As Integer _

)

[C#]

public void Sort(

int level,

SortFlags order,

int col1,

int col2

);

[Delphi]

public procedure Sort(

level: Int32;

order: SortFlags;

col1: Int32;

col2: Int32

);

Parameters

level

Level of the nodes to sort.

order

SortFlags value that controls sort direction and options.

col1

Start of the range of columns to sort.

col2

End of the range of columns to sort.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HighLightEnum Enumeration

HighLightEnum Enumeration

Specifies whether the grid should highlight the selected range.

[Visual Basic]

Public Enum HighLightEnum

[C#]

public enum HighLightEnum

[Delphi]

type HighLightEnum = (Always, Never, WithFocus);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Always | Always highlight the selected range.
Never | Never highlight the selected range.
WithFocus | Highlight the selected range when the control has focus.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HitTestInfo Structure

HitTestInfo Structure

HitTestInfo contains information about the control at a point on the screen (it returned by the HitTest (Int32, Int32) method).

For a list of all members of this type, see HitTestInfo Members.

System.Object

System.ValueType

C1.Win.C1FlexGrid.HitTestInfo

[Visual Basic]

Public Structure HitTestInfo

[C#]

public struct HitTestInfo

[Delphi]

type HitTestInfo = record;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HitTestInfo Members

HitTestInfo Members

HitTestInfo overview

Public Fields

Column | Get the index of the column at the point being tested (if the point does not correspond to a cell, it returns -1).
Row | Get the index of the row at the point being tested (if the point does not correspond to a cell, it returns -1).
Type | Gets the type of element at the point being tested. Please see HitTestTypeEnum for details.
X | The X coordinate of a point on the control surface, in pixels.
Y | The Y coordinate of a point on the control surface, in pixels.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HitTestInfo Fields

HitTestInfo Fields

The fields of the HitTestInfo structure are listed here. For a complete list of HitTestInfo structure members, see the HitTestInfo Members topic.

Column | Get the index of the column at the point being tested (if the point does not correspond to a cell, it returns -1).
Row | Get the index of the row at the point being tested (if the point does not correspond to a cell, it returns -1).
Type | Gets the type of element at the point being tested. Please see HitTestTypeEnum for details.
X | The X coordinate of a point on the control surface, in pixels.
Y | The Y coordinate of a point on the control surface, in pixels.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HitTestInfo.Column Field

HitTestInfo.Column Field

Get the index of the column at the point being tested (if the point does not correspond to a cell, it returns -1).

[Visual Basic]

Public ReadOnly Column As Integer

[C#]

public readonly int Column

[Delphi]

public Column: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HitTestInfo.Row Field

HitTestInfo.Row Field

Get the index of the row at the point being tested (if the point does not correspond to a cell, it returns -1).

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HitTestInfo.Type Field

HitTestInfo.Type Field

Gets the type of element at the point being tested. Please see HitTestTypeEnum for details.

[Visual Basic]

Public ReadOnly Type As HitTestTypeEnum

[C#]

public readonly HitTestTypeEnum Type

[Delphi]

public Type: HitTestTypeEnum;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HitTestInfo.X Field

HitTestInfo.X Field

The X coordinate of a point on the control surface, in pixels.

[Visual Basic]

Public ReadOnly X As Integer

[C#]

public readonly int X

[Delphi]

public X: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HitTestInfo.Y Field

HitTestInfo.Y Field

The Y coordinate of a point on the control surface, in pixels.

[Visual Basic]

Public ReadOnly Y As Integer

[C#]

public readonly int Y

[Delphi]

public Y: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HitTestTypeEnum Enumeration

HitTestTypeEnum Enumeration

Type of grid element at a specific point on the control.

[Visual Basic]

Public Enum HitTestTypeEnum

[C#]

public enum HitTestTypeEnum

[Delphi]

type HitTestTypeEnum = (Cell, Checkbox, ColumnFreeze, ColumnHeader, ColumnResize, EditButton, None, OutlineBar, OutlineTree, RowFreeze, RowHeader, RowResize);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Cell | The point is on a grid cell. (The cell coordinates are stored in the Row and Column properties).
Checkbox | The point is on a check box.
ColumnFreeze | The point is near the right edge of the last frozen column, in the column freezing area.
ColumnHeader | The point is on a fixed row, over a column.
ColumnResize | The point is near the right edge of a fixed cell, in the column resizing area.
EditButton | The point is on an edit button (drop down, popup editors).
None | The point is in the grid's empty area.
OutlineBar | The point is on the outline bar (visible when the grid's Tree property contains the TreeStyleFlags.ButtonBar flag).
OutlineTree | The point is on the collapse/expand button on an outline tree (visible when the grid's Tree property contains the TreeStyleFlags.Symbols flag).
RowFreeze | The point is near the bottom edge of the last frozen row, in the row freezing area.
RowHeader | The point is on a fixed column, next to a row.
RowResize | The point is near the bottom edge of a fixed cell, in the row resizing area.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1MultiColumnDictionary Interface

IC1MultiColumnDictionary Interface

Interface that extends System.Collections.IDictionary and can be used to implement multi-column data maps.

For a list of all members of this type, see IC1MultiColumnDictionary Members.

[Visual Basic]

Public Interface IC1MultiColumnDictionary

Inherits ICollection, IDictionary, IEnumerable

[C#]

public interface IC1MultiColumnDictionary : ICollection, IDictionary, IEnumerable

[Delphi]

type IC1MultiColumnDictionary = interface (ICollection, IDictionary, IEnumerable);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1MultiColumnDictionary Members

IC1MultiColumnDictionary Members

IC1MultiColumnDictionary overview

Public Methods

GetDisplayValue

Gets the string that should be displayed in the grid while not in edit mode.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1MultiColumnDictionary Methods

IC1MultiColumnDictionary Methods

The methods of the IC1MultiColumnDictionary interface are listed here. For a complete list of IC1MultiColumnDictionary interface members, see the IC1MultiColumnDictionary Members topic.

Public Methods

GetDisplayValue

Gets the string that should be displayed in the grid while not in edit mode.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1MultiColumnDictionary.GetDisplayValue Method

IC1MultiColumnDictionary.GetDisplayValue Method

Gets the string that should be displayed in the grid while not in edit mode.

[Visual Basic]

Function GetDisplayValue( _

ByVal key As Object _

) As String

[C#]

string GetDisplayValue(

object key

);

[Delphi]

function GetDisplayValue(

key: Object

): String;

Parameters

key

Value to look up in the dictionary.

Return Value

The string that should be displayed in the grid while not in edit mode.

Remarks

When the IC1MultiColumnDictionary is used to populate a System.Windows.Forms.ComboBox, all columns are displayed when the combo is dropped down. When the combo is closed, only one column can be displayed. This method returns that value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ImageAlignEnum Enumeration

ImageAlignEnum Enumeration

Specifies how images are aligns in grid cells.

[Visual Basic]

Public Enum ImageAlignEnum

[C#]

public enum ImageAlignEnum

[Delphi]

type ImageAlignEnum = (CenterBottom, CenterCenter, CenterTop, Hide, LeftBottom, LeftCenter, LeftTop, RightBottom, RightCenter, RightTop, Scale, Stretch, Tile);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
CenterBottom | Image is horizontally aligned to the center and vertically aligned to the bottom of the cell.
CenterCenter | Image is horizontally aligned to the center and vertically aligned to the center of the cell.
CenterTop | Image is horizontally aligned to the center and vertically aligned to the top of the cell.
Hide | Image is not displayed.
LeftBottom | Image is horizontally aligned to the left and vertically aligned to the bottom of the cell.
LeftCenter | Image is horizontally aligned to the left and vertically aligned to the center of the cell.
LeftTop | Image is horizontally aligned to the left and vertically aligned to the top of the cell.
RightBottom | Image is horizontally aligned to the right and vertically aligned to the bottom of the cell.
RightCenter | Image is horizontally aligned to the right and vertically aligned to the center of the cell.
RightTop | Image is horizontally aligned to the right and vertically aligned to the top of the cell.
Scale | Image is scaled to fit the maximum area within the cell while preserving the original aspect ratio.
Stretch | Image is stretched to cover the whole cell.
Tile | Image is tiled to cover the whole cell.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyActionEnum Enumeration

KeyActionEnum Enumeration

Specifies the action to perform when the ENTER and TAB keys are pressed.

[Visual Basic]

Public Enum KeyActionEnum

[C#]

public enum KeyActionEnum

[Delphi]

type KeyActionEnum = (MoveAcross, MoveAcrossOut, MoveDown, None);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
MoveAcross | Move to the next column. At the end of the row, wrap to the start of the next row.
MoveAcrossOut | Same as MoveAcross, and move the focus to the next control in the tab order when the last cell in the grid is reached.
MoveDown | Move to the next row.
None | No special action (allow system to handle the key). For example, the TAB key is normally used to cycle through the controls on a form.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs Class

KeyEditEventArgs Class

Provides data for the KeyDownEdit and KeyUpEdit events.

For a list of all members of this type, see KeyEditEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.KeyEditEventArgs

[Visual Basic]

Public Class KeyEditEventArgs

Inherits EventArgs

[C#]

public class KeyEditEventArgs : EventArgs

[Delphi]

type KeyEditEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs Members

KeyEditEventArgs Members

KeyEditEventArgs overview

Public Constructors

KeyEditEventArgs Constructor

Initializes a new instance of the KeyEditEventArgs class.

Public Fields

Alt | Gets a value indicating whether the ALT key was pressed.
Col | Gets the column index of the cell being edited when the key was pressed.
Control | Gets a value indicating whether the CTRL key was pressed.
Handled | Gets or sets a value indicating whether the event was handled and should be ignored by the control.
KeyCode | Gets the key code for the event, which will be one of the System.Windows.Forms.Keys values.
KeyData | Gets the key code for the key that was pressed, combined with modifier flags that indicate which combination of CTRL, SHIFT, and ALT keys were pressed at the same time.
KeyValue | Gets the integer representation of the KeyData property.
Modifiers | Gets the modifier flags, as defined in Keys. This indicates which combination of modifier keys (CTRL, SHIFT, and ALT) were pressed.
Row | Gets the row index of the cell being edited when the key was pressed.
Shift | Gets a value indicating whether the SHIFT key was pressed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs Constructor

KeyEditEventArgs Constructor

Initializes a new instance of the KeyEditEventArgs class.

[Visual Basic]

Public Function New( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal e As KeyEventArgs _

)

[C#]

public KeyEditEventArgs(

int row,

int col,

KeyEventArgs e

);

[Delphi]

public constructor Create(

row: Int32;

col: Int32;

e: KeyEventArgs

);

Parameters

row

The row index of the cell being edited when the key was pressed.

col

The column index of the cell being edited when the key was pressed.

e

A System.Windows.Forms.KeyEventArgs object containing the keyboard data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs Fields

KeyEditEventArgs Fields

The fields of the KeyEditEventArgs class are listed here. For a complete list of KeyEditEventArgs class members, see the KeyEditEventArgs Members topic.

Public Fields

Alt | Gets a value indicating whether the ALT key was pressed.
Col | Gets the column index of the cell being edited when the key was pressed.
Control | Gets a value indicating whether the CTRL key was pressed.
Handled | Gets or sets a value indicating whether the event was handled and should be ignored by the control.
KeyCode | Gets the key code for the event, which will be one of the System.Windows.Forms.Keys values.
KeyData | Gets the key code for the key that was pressed, combined with modifier flags that indicate which combination of CTRL, SHIFT, and ALT keys were pressed at the same time.
KeyValue | Gets the integer representation of the KeyData property.
Modifiers | Gets the modifier flags, as defined in Keys. This indicates which combination of modifier keys (CTRL, SHIFT, and ALT) were pressed.
Row | Gets the row index of the cell being edited when the key was pressed.
Shift | Gets a value indicating whether the SHIFT key was pressed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.Alt Field

KeyEditEventArgs.Alt Field

Gets a value indicating whether the ALT key was pressed.

[Visual Basic]

Public ReadOnly Alt As Boolean

[C#]

public readonly bool Alt

[Delphi]

public Alt: Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.Col Field

KeyEditEventArgs.Col Field

Gets the column index of the cell being edited when the key was pressed.

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.Control Field

KeyEditEventArgs.Control Field

Gets a value indicating whether the CTRL key was pressed.

[Visual Basic]

Public ReadOnly Control As Boolean

[C#]

public readonly bool Control

[Delphi]

public Control: Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.Handled Field

KeyEditEventArgs.Handled Field

Gets or sets a value indicating whether the event was handled and should be ignored by the control.

[Visual Basic]

Public Handled As Boolean

[C#]

public bool Handled

[Delphi]

public Handled: Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.KeyCode Field

KeyEditEventArgs.KeyCode Field

Gets the key code for the event, which will be one of the System.Windows.Forms.Keys values.

[Visual Basic]

Public ReadOnly KeyCode As Keys

[C#]

public readonly Keys KeyCode

[Delphi]

public KeyCode: Keys;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.KeyData Field

KeyEditEventArgs.KeyData Field

Gets the key code for the key that was pressed, combined with modifier flags that indicate which combination of CTRL, SHIFT, and ALT keys were pressed at the same time.

[Visual Basic]

Public ReadOnly KeyData As Keys

[C#]

public readonly Keys KeyData

[Delphi]

public KeyData: Keys;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.KeyValue Field

KeyEditEventArgs.KeyValue Field

Gets the integer representation of the KeyData property.

[Visual Basic]

Public ReadOnly KeyValue As Integer

[C#]

public readonly int KeyValue

[Delphi]

public KeyValue: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.Modifiers Field

KeyEditEventArgs.Modifiers Field

Gets the modifier flags, as defined in Keys. This indicates which combination of modifier keys (CTRL, SHIFT, and ALT) were pressed.

[Visual Basic]

Public ReadOnly Modifiers As Keys

[C#]

public readonly Keys Modifiers

[Delphi]

public Modifiers: Keys;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.Row Field

KeyEditEventArgs.Row Field

Gets the row index of the cell being edited when the key was pressed.

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventArgs.Shift Field

KeyEditEventArgs.Shift Field

Gets a value indicating whether the SHIFT key was pressed.

[Visual Basic]

Public ReadOnly Shift As Boolean

[C#]

public readonly bool Shift

[Delphi]

public Shift: Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyEditEventHandler Delegate

KeyEditEventHandler Delegate

Represents the method that will handle the KeyDownEdit and KeyUpEdit events.

[Visual Basic]

Public Delegate Sub KeyEditEventHandler( _

ByVal sender As Object, _

ByVal e As KeyEditEventArgs _

)

[C#]

public delegate void KeyEditEventHandler(

object sender,

KeyEditEventArgs e

);

[Delphi]

type KeyEditEventHandler = procedure (

sender: Object;

e: KeyEditEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyPressEditEventArgs Class

KeyPressEditEventArgs Class

Provides data for the KeyPressEdit event.

For a list of all members of this type, see KeyPressEditEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.KeyPressEditEventArgs

[Visual Basic]

Public Class KeyPressEditEventArgs

Inherits EventArgs

[C#]

public class KeyPressEditEventArgs : EventArgs

[Delphi]

type KeyPressEditEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyPressEditEventArgs Members

KeyPressEditEventArgs Members

KeyPressEditEventArgs overview

Public Constructors

KeyPressEditEventArgs Constructor

Initializes a new instance of the KeyPressEditEventArgs class.

Public Fields

Col | Gets the column index of the cell being edited when the key was pressed.
Handled | Gets or sets a value indicating whether the event was handled and should be ignored by the control.
KeyChar | Gets the character corresponding to the key pressed.
Row | Gets the row index of the cell being edited when the key was pressed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyPressEditEventArgs Constructor

KeyPressEditEventArgs Constructor

Initializes a new instance of the KeyPressEditEventArgs class.

[Visual Basic]

Public Function New( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal key As Char _

)

[C#]

public KeyPressEditEventArgs(

int row,

int col,

char key

);

[Delphi]

public constructor Create(

row: Int32;

col: Int32;

key: Char

);

Parameters

row

The row index of the cell being edited when the key was pressed.

col

The column index of the cell being edited when the key was pressed.

key

The character corresponding to the key pressed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyPressEditEventArgs Fields

KeyPressEditEventArgs Fields

The fields of the KeyPressEditEventArgs class are listed here. For a complete list of KeyPressEditEventArgs class members, see the KeyPressEditEventArgs Members topic.

Public Fields

Col | Gets the column index of the cell being edited when the key was pressed.
Handled | Gets or sets a value indicating whether the event was handled and should be ignored by the control.
KeyChar | Gets the character corresponding to the key pressed.
Row | Gets the row index of the cell being edited when the key was pressed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyPressEditEventArgs.Col Field

KeyPressEditEventArgs.Col Field

Gets the column index of the cell being edited when the key was pressed.

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyPressEditEventArgs.Handled Field

KeyPressEditEventArgs.Handled Field

Gets or sets a value indicating whether the event was handled and should be ignored by the control.

[Visual Basic]

Public Handled As Boolean

[C#]

public bool Handled

[Delphi]

public Handled: Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyPressEditEventArgs.KeyChar Field

KeyPressEditEventArgs.KeyChar Field

Gets the character corresponding to the key pressed.

[Visual Basic]

Public KeyChar As Char

[C#]

public char KeyChar

[Delphi]

public KeyChar: Char;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyPressEditEventArgs.Row Field

KeyPressEditEventArgs.Row Field

Gets the row index of the cell being edited when the key was pressed.

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeyPressEditEventHandler Delegate

KeyPressEditEventHandler Delegate

Represents the method that will handle the KeyPressEdit event.

[Visual Basic]

Public Delegate Sub KeyPressEditEventHandler( _

ByVal sender As Object, _

ByVal e As KeyPressEditEventArgs _

)

[C#]

public delegate void KeyPressEditEventHandler(

object sender,

KeyPressEditEventArgs e

);

[Delphi]

type KeyPressEditEventHandler = procedure (

sender: Object;

e: KeyPressEditEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MoveCursorEnum Enumeration

MoveCursorEnum Enumeration

This enumeration is for internal use only.

[Visual Basic]

Public Enum MoveCursorEnum

[C#]

public enum MoveCursorEnum

[Delphi]

type MoveCursorEnum = (CellDown, CellLeft, CellNext, CellPrev, CellRight, CellUp, EndDown, EndRight, HomeLeft, HomeUp, None, PageDown, PageLeft, PageRight, PageUp);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
CellDown | One cell down.
CellLeft | One cell left.
CellNext | One cell right, then wrap to next row.
CellPrev | One cell left, then wrap to previous row.
CellRight | One cell right.
CellUp | One cell up.
EndDown | Bottom cell.
EndRight | Rightmost cell.
HomeLeft | Leftmost cell.
HomeUp | Top cell.
None | No movement.
PageDown | Page down.
PageLeft | Page left.
PageRight | Page right.
PageUp | Page up.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Class

MultiColumnDictionary Class

Class that implements the IC1MultiColumnDictionary and can be used as a column DataMap to create multi-column combo editors.

For a list of all members of this type, see MultiColumnDictionary Members.

System.Object

System.Collections.Specialized.ListDictionary

C1.Win.C1FlexGrid.MultiColumnDictionary

[Visual Basic]

Public Class MultiColumnDictionary

Inherits ListDictionary

Implements IC1MultiColumnDictionary, IDictionary

[C#]

public class MultiColumnDictionary : ListDictionary , IC1MultiColumnDictionary, IDictionary

[Delphi]

type MultiColumnDictionary = class (ListDictionary, IC1MultiColumnDictionary, IDictionary);

Remarks

The MultiColumnDictionary class can be used to implement simple string-based data maps or bound data maps that get the data from a data source object.

Example

The code below creates an unbound two-column data map and assigns it to a grid column:

// create string-based MultiColumnDictionary and assign it to column

// note: this will automatically generate keys of type int for each item,

// the key values will be stored in the grid.

string text = "Row1, Col1\tRow1, Col2|Row2, Col1\tRow2, Col3|Row2, Col1\tRow3, Col2";

MultiColumnDictionary map = new MultiColumnDictionary(text, 0, true);

_flex.Cols[1].DataMap = map;

The map consists of three items, each with two columns. Because the autoKeys parameter was set to True in the map's constructor, the map will have unique integer keys for each value,and those integers will be stored in the grid cells. If autoKeys had been set to False, the strings themselves would be used as keys and stored in the grid cells.

The code below creates a bound data map and assigns it to a grid column:

// create data-based MultiColumnDictionary and assign it to column

// notes: the list will automatically be updated is the data source changes.

DataTable dt = GetDataTable("employees");

string[] columnNames = new string[] { "FirstName", "LastName", "Country" };

MultiColumnDictionary map = new MultiColumnDictionary(dt, "EmployeeID", columnNames, 1);

_flex.Cols[2].DataMap = map;

This map is bound to an Employees DataTable. The keyColumn parameter is set to "EmployeeID", causing this field to be used used as a key. When the grid is edited, the values stored in the cells will be the employee's ID. However, this value is never displayed be the grid.

The drop-down list will show the employee's first name, last name, and country, as specified by the columnNames parameter.

When the list is closed, the grid will display the employee's last name, as specified by the displayColumn parameter.

Note that this map is dynamically bound to the data source, so if the employees table is modified, the editor list will reflect the changes automatically.

Note also that the usual combo editing features such as auto-search and double-click cycling still work.

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Members

MultiColumnDictionary Members

MultiColumnDictionary overview

Public Constructors

MultiColumnDictionary Constructor

Initializes a new instance of a bound MultiColumnDictionary class.

Public Methods

Clear

Overriden. Removes all entries from the MultiColumnDictionary.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Constructor

MultiColumnDictionary Constructor

Overload List

Initializes a new instance of a bound MultiColumnDictionary class.

[Visual Basic] Public Function New(DataTable, String)

[C#] public MultiColumnDictionary(DataTable, string);

[Delphi] public constructor Create(DataTable; String); overload;

Initializes a new instance of an unbound MultiColumnDictionary class.

[Visual Basic] Public Function New(String)

[C#] public MultiColumnDictionary(string);

[Delphi] public constructor Create(String); overload;

Initializes a new instance of a bound MultiColumnDictionary class.

[Visual Basic] Public Function New(ITypedList, String)

[C#] public MultiColumnDictionary(ITypedList, string);

[Delphi] public constructor Create(ITypedList; String); overload;

Initializes a new instance of an unbound MultiColumnDictionary class.

[Visual Basic] Public Function New(String, Integer, Boolean)

[C#] public MultiColumnDictionary(string, int, bool);

[Delphi] public constructor Create(String; Int32; Boolean); overload;

Initializes a new instance of a bound MultiColumnDictionary class.

[Visual Basic] Public Function New(DataTable, String, String(), Integer)

[C#] public MultiColumnDictionary(DataTable, string, string[], int);

[Delphi] public constructor Create(DataTable; String; array of String; Int32); overload;

Initializes a new instance of a bound MultiColumnDictionary class.

[Visual Basic] Public Function New(ITypedList, String, String(), Integer)

[C#] public MultiColumnDictionary(ITypedList, string, string[], int);

[Delphi] public constructor Create(ITypedList; String; array of String; Int32); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Constructor (DataTable, String)

MultiColumnDictionary Constructor (DataTable, String)

Initializes a new instance of a bound MultiColumnDictionary class.

[Visual Basic]

Public Function New( _

ByVal table As DataTable, _

ByVal keyColumn As String _

)

[C#]

public MultiColumnDictionary(

DataTable table,

string keyColumn

);

[Delphi]

public constructor Create(

table: DataTable;

keyColumn: String

); overload;

Parameters

table

Data source object.

keyColumn

Name of the data source column that contains unique keys.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Constructor (String)

MultiColumnDictionary Constructor (String)

Initializes a new instance of an unbound MultiColumnDictionary class.

[Visual Basic]

Public Function New( _

ByVal items As String _

)

[C#]

public MultiColumnDictionary(

string items

);

[Delphi]

public constructor Create(

items: String

); overload;

Parameters

items

String that contains the items, delimited by pipe characters ("|"). Each item may contain multiple columns, delimited by tabs (vbTab or '\t').

Remarks

This constructor causes the map to show all columns when the editor is dropped down and only the first column when the editor is closed or inactive.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Constructor (ITypedList, String)

MultiColumnDictionary Constructor (ITypedList, String)

Initializes a new instance of a bound MultiColumnDictionary class.

[Visual Basic]

Public Function New( _

ByVal list As ITypedList, _

ByVal keyColumn As String _

)

[C#]

public MultiColumnDictionary(

ITypedList list,

string keyColumn

);

[Delphi]

public constructor Create(

list: ITypedList;

keyColumn: String

); overload;

Parameters

list

Data source object.

keyColumn

Name of the data source column that contains unique keys.

Remarks

This constructor causes the map to show all columns when the editor is dropped down and only the first column when the editor is closed or inactive.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Constructor (String, Int32, Boolean)

MultiColumnDictionary Constructor (String, Int32, Boolean)

Initializes a new instance of an unbound MultiColumnDictionary class.

[Visual Basic]

Public Function New( _

ByVal items As String, _

ByVal displayColumn As Integer, _

ByVal autoKeys As Boolean _

)

[C#]

public MultiColumnDictionary(

string items,

int displayColumn,

bool autoKeys

);

[Delphi]

public constructor Create(

items: String;

displayColumn: Int32;

autoKeys: Boolean

); overload;

Parameters

items

String that contains the items. Items are delimited by pipe characters ("|"). Each item may contain multiple columns, delimited by tabs (vbTab or '\t').

displayColumn

Index of the column that is displayed in the grid.

autoKeys

True if keys are to be automatically generated, False if the items themselves are to be used as keys. Note that in the latter case, duplicate items are not allowed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Constructor (DataTable, String, String[], Int32)

MultiColumnDictionary Constructor (DataTable, String, String[], Int32)

Initializes a new instance of a bound MultiColumnDictionary class.

[Visual Basic]

Public Function New( _

ByVal table As DataTable, _

ByVal keyColumn As String, _

ByVal columnNames As String(), _

ByVal displayColumn As Integer _

)

[C#]

public MultiColumnDictionary(

DataTable table,

string keyColumn,

string[] columnNames,

int displayColumn

);

[Delphi]

public constructor Create(

table: DataTable;

keyColumn: String;

columnNames: array of String;

displayColumn: Int32

); overload;

Parameters

table

Data source object.

keyColumn

Name of the data source column that contains unique keys.

columnNames

Array with the names of the columns that are included in the map.

displayColumn

Name of the column that is displayed in the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Constructor (ITypedList, String, String[], Int32)

MultiColumnDictionary Constructor (ITypedList, String, String[], Int32)

Initializes a new instance of a bound MultiColumnDictionary class.

[Visual Basic]

Public Function New( _

ByVal list As ITypedList, _

ByVal keyColumn As String, _

ByVal columnNames As String(), _

ByVal displayColumn As Integer _

)

[C#]

public MultiColumnDictionary(

ITypedList list,

string keyColumn,

string[] columnNames,

int displayColumn

);

[Delphi]

public constructor Create(

list: ITypedList;

keyColumn: String;

columnNames: array of String;

displayColumn: Int32

); overload;

Parameters

list

Data source object.

keyColumn

Name of the data source column that contains unique keys.

columnNames

Array with the names of the columns that are included in the map.

displayColumn

Name of the column that is displayed in the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary Methods

MultiColumnDictionary Methods

The methods of the MultiColumnDictionary class are listed here. For a complete list of MultiColumnDictionary class members, see the MultiColumnDictionary Members topic.

Public Methods

Clear

Overriden. Removes all entries from the MultiColumnDictionary.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


MultiColumnDictionary.Clear Method

MultiColumnDictionary.Clear Method

Removes all entries from the MultiColumnDictionary.

[Visual Basic]

Overrides Public Sub Clear() Implements IDictionary.Clear

[C#]

override public void Clear()

[Delphi]

public procedure Clear(); override;

Implements

IDictionary.Clear

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node Class

Node Class

The Node class encapsulates properties and methods used for manipulating node rows (collapsing, expanding, moving, and sorting them).

For a list of all members of this type, see Node Members.

System.Object

C1.Win.C1FlexGrid.Node

[Visual Basic]

Public Class Node

[C#]

public class Node

[Delphi]

type Node = class;

Remarks

You can create node rows using the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method or by setting the Row property to True.

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node Members

Node Members

Node overview

Public Properties

Children | Gets the number of child nodes under this node.
Collapsed | Gets or sets whether this node is collapsed.
Data | Gets or sets the data on this node row at the column that contains the outline tree.
Expanded | Gets or sets whether this node is expanded.
Image | Gets or sets the image on this node row at the column that contains the outline tree.
Key | Gets or sets the Row associated with this node row.
Level | Gets or sets the outline level for this node.
Row | Returns a reference to the Row object that corresponds to this node.

Public Methods

AddNode | Overloaded. Creates a node row at a specified position relative to this node.
EnsureVisible | Ensures that this node is visible, expanding its parent nodes and scrolling it into view if necessary.
GetCellRange | Returns a CellRange object containing this row and all its child rows.
GetNode | Returns a reference to a node located at a given position relative to this node.
Move | Overloaded. Moves a node to a new position.
RemoveNode | Removes this node row and all its child rows (nodes and data) from the grid.
Select | Selects the node.
Sort | Overloaded. Sorts the current node in the specified order.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node Properties

Node Properties

The properties of the Node class are listed here. For a complete list of Node class members, see the Node Members topic.

Public Properties

Children | Gets the number of child nodes under this node.
Collapsed | Gets or sets whether this node is collapsed.
Data | Gets or sets the data on this node row at the column that contains the outline tree.
Expanded | Gets or sets whether this node is expanded.
Image | Gets or sets the image on this node row at the column that contains the outline tree.
Key | Gets or sets the Row associated with this node row.
Level | Gets or sets the outline level for this node.
Row | Returns a reference to the Row object that corresponds to this node.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Children Property

Node.Children Property

Gets the number of child nodes under this node.

[Visual Basic]

Public ReadOnly Property Children As Integer

[C#]

public int Children {get;}

[Delphi]

public property Children: Int32 read get_Children;

Remarks

Only immediate children are included in the count. Grand-children are not included.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Collapsed Property

Node.Collapsed Property

Gets or sets whether this node is collapsed.

[Visual Basic]

Public Property Collapsed As Boolean

[C#]

public bool Collapsed {get;set;}

[Delphi]

public property Collapsed: Boolean read get_Collapsed write set_Collapsed;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Data Property

Node.Data Property

Gets or sets the data on this node row at the column that contains the outline tree.

[Visual Basic]

Public Property Data As Object

[C#]

public object Data {get;set;}

[Delphi]

public property Data: Object read get_Data write set_Data;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Expanded Property

Node.Expanded Property

Gets or sets whether this node is expanded.

[Visual Basic]

Public Property Expanded As Boolean

[C#]

public bool Expanded {get;set;}

[Delphi]

public property Expanded: Boolean read get_Expanded write set_Expanded;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Image Property

Node.Image Property

Gets or sets the image on this node row at the column that contains the outline tree.

[Visual Basic]

Public Property Image As Image

[C#]

public Image Image {get;set;}

[Delphi]

public property Image: Image read get_Image write set_Image;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Key Property

Node.Key Property

Gets or sets the Row associated with this node row.

[Visual Basic]

Public Property Key As Object

[C#]

public object Key {get;set;}

[Delphi]

public property Key: Object read get_Key write set_Key;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Level Property

Node.Level Property

Gets or sets the outline level for this node.

[Visual Basic]

Public Property Level As Integer

[C#]

public int Level {get;set;}

[Delphi]

public property Level: Int32 read get_Level write set_Level;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Row Property

Node.Row Property

Returns a reference to the Row object that corresponds to this node.

[Visual Basic]

Public ReadOnly Property Row As Row

[C#]

public Row Row {get;}

[Delphi]

public property Row: Row read get_Row;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node Methods

Node Methods

The methods of the Node class are listed here. For a complete list of Node class members, see the Node Members topic.

Public Methods

AddNode | Overloaded. Creates a node row at a specified position relative to this node.
EnsureVisible | Ensures that this node is visible, expanding its parent nodes and scrolling it into view if necessary.
GetCellRange | Returns a CellRange object containing this row and all its child rows.
GetNode | Returns a reference to a node located at a given position relative to this node.
Move | Overloaded. Moves a node to a new position.
RemoveNode | Removes this node row and all its child rows (nodes and data) from the grid.
Select | Selects the node.
Sort | Overloaded. Sorts the current node in the specified order.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.AddNode Method

Node.AddNode Method

Overload List

Creates a node row at a specified position relative to this node.

[Visual Basic] Overloads Public Function AddNode(NodeTypeEnum, Object) As Node

[C#] public Node AddNode(NodeTypeEnum, object);

[Delphi] public function AddNode(NodeTypeEnum; Object) : Node; overload;

Creates a node row at a specified position relative to this node.

[Visual Basic] Overloads Public Function AddNode(NodeTypeEnum, Object, Object, Image) As Node

[C#] public Node AddNode(NodeTypeEnum, object, object, Image);

[Delphi] public function AddNode(NodeTypeEnum; Object; Object; Image) : Node; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.AddNode Method (NodeTypeEnum, Object)

Node.AddNode Method (NodeTypeEnum, Object)

Creates a node row at a specified position relative to this node.

[Visual Basic]

Overloads Public Function AddNode( _

ByVal position As NodeTypeEnum, _

ByVal data As Object _

) As Node

[C#]

public Node AddNode(

NodeTypeEnum position,

object data

);

[Delphi]

public function AddNode(

position: NodeTypeEnum;

data: Object

): Node; overload;

Parameters

position

A value from the NodeTypeEnum enumeration that specifies where the new node will be added with respect to this node (e.g. Child, Sibling).

data

Value of the Data property for the new node.

Return Value

A reference to the new Node added to the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.AddNode Method (NodeTypeEnum, Object, Object, Image)

Node.AddNode Method (NodeTypeEnum, Object, Object, Image)

Creates a node row at a specified position relative to this node.

[Visual Basic]

Overloads Public Function AddNode( _

ByVal position As NodeTypeEnum, _

ByVal data As Object, _

ByVal key As Object, _

ByVal img As Image _

) As Node

[C#]

public Node AddNode(

NodeTypeEnum position,

object data,

object key,

Image img

);

[Delphi]

public function AddNode(

position: NodeTypeEnum;

data: Object;

key: Object;

img: Image

): Node; overload;

Parameters

position

A value from the NodeTypeEnum enumeration that specifies where the new node will be added with respect to this node (e.g. Child, Sibling).

data

Value of the Data property for the new node.

key

Value of the Key property for the new node.

img

Value of the Image property for the new node.

Return Value

A reference to the new Node added to the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.EnsureVisible Method

Node.EnsureVisible Method

Ensures that this node is visible, expanding its parent nodes and scrolling it into view if necessary.

[Visual Basic]

Public Sub EnsureVisible()

[C#]

public void EnsureVisible()

[Delphi]

public procedure EnsureVisible();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.GetCellRange Method

Node.GetCellRange Method

Returns a CellRange object containing this row and all its child rows.

[Visual Basic]

Public Function GetCellRange() As CellRange

[C#]

public CellRange GetCellRange()

[Delphi]

public function GetCellRange(): CellRange;

Return Value

A CellRange object containing this row and all its child rows.

Remarks

The CellRange object returned includes all columns.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.GetNode Method

Node.GetNode Method

Returns a reference to a node located at a given position relative to this node.

[Visual Basic]

Public Function GetNode( _

ByVal position As NodeTypeEnum _

) As Node

[C#]

public Node GetNode(

NodeTypeEnum position

);

[Delphi]

public function GetNode(

position: NodeTypeEnum

): Node;

Parameters

position

A value from the NodeTypeEnum enumeration that specifies the position relative to this node.

Return Value

A node object.

Remarks

If the node requested does not exist, GetNode returns null (for example, the root node does not have a previous sibling).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Move Method

Node.Move Method

Overload List

Moves a node to a new position.

[Visual Basic] Overloads Public Function Move(NodeMoveEnum) As Boolean

[C#] public bool Move(NodeMoveEnum);

[Delphi] public function Move(NodeMoveEnum) : Boolean; overload;

Moves a node to a new position.

[Visual Basic] Overloads Public Function Move(NodeMoveEnum, Node) As Boolean

[C#] public bool Move(NodeMoveEnum, Node);

[Delphi] public function Move(NodeMoveEnum; Node) : Boolean; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Move Method (NodeMoveEnum)

Node.Move Method (NodeMoveEnum)

Moves a node to a new position.

[Visual Basic]

Overloads Public Function Move( _

ByVal moveTo As NodeMoveEnum _

) As Boolean

[C#]

public bool Move(

NodeMoveEnum moveTo

);

[Delphi]

public function Move(

moveTo: NodeMoveEnum

): Boolean; overload;

Parameters

moveTo

A value from the NodeMoveEnum enumeration that specifies where the node will be moved with respect to its current position.

Return Value

Returns True if the method was successful, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Move Method (NodeMoveEnum, Node)

Node.Move Method (NodeMoveEnum, Node)

Moves a node to a new position.

[Visual Basic]

Overloads Public Function Move( _

ByVal moveTo As NodeMoveEnum, _

ByVal targetNode As Node _

) As Boolean

[C#]

public bool Move(

NodeMoveEnum moveTo,

Node targetNode

);

[Delphi]

public function Move(

moveTo: NodeMoveEnum;

targetNode: Node

): Boolean; overload;

Parameters

moveTo

A value from the NodeMoveEnum enumeration that specifies where the node will be moved with respect to its current position.

targetNode

Node object to use as a target when the moveTo parameter is set to NodeMoveEnum.ChildOf.

Return Value

Returns True if the method was successful, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.RemoveNode Method

Node.RemoveNode Method

Removes this node row and all its child rows (nodes and data) from the grid.

[Visual Basic]

Public Sub RemoveNode()

[C#]

public void RemoveNode()

[Delphi]

public procedure RemoveNode();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Select Method

Node.Select Method

Selects the node.

[Visual Basic]

Public Sub Select()

[C#]

public void Select()

[Delphi]

public procedure Select();

Remarks

This method sets the control's Row property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Sort Method

Node.Sort Method

Overload List

Sorts the current node in the specified order.

[Visual Basic] Overloads Public Sub Sort(IComparer)

[C#] public Sort(IComparer);

[Delphi] public procedure Sort(IComparer); overload;

Sorts the current node in the specified order.

[Visual Basic] Overloads Public Sub Sort(SortFlags)

[C#] public Sort(SortFlags);

[Delphi] public procedure Sort(SortFlags); overload;

Sorts the current node in the specified order.

[Visual Basic] Overloads Public Sub Sort(SortFlags, Integer, Integer)

[C#] public Sort(SortFlags, int, int);

[Delphi] public procedure Sort(SortFlags; Int32; Int32); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Sort Method (IComparer)

Node.Sort Method (IComparer)

Sorts the current node in the specified order.

[Visual Basic]

Overloads Public Sub Sort( _

ByVal comparer As IComparer _

)

[C#]

public void Sort(

IComparer comparer

);

[Delphi]

public procedure Sort(

comparer: IComparer

); overload;

Parameters

comparer

An object that implements the System.Collections.IComparer interface used to compare Row objects. This can be used to provide custom sorting.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Sort Method (SortFlags)

Node.Sort Method (SortFlags)

Sorts the current node in the specified order.

[Visual Basic]

Overloads Public Sub Sort( _

ByVal order As SortFlags _

)

[C#]

public void Sort(

SortFlags order

);

[Delphi]

public procedure Sort(

order: SortFlags

); overload;

Parameters

order

One or more values from the SortFlags enumeration that specify the type of sorting to be applied (e.g. ascending, descending, case-sensitive, etc).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Node.Sort Method (SortFlags, Int32, Int32)

Node.Sort Method (SortFlags, Int32, Int32)

Sorts the current node in the specified order.

[Visual Basic]

Overloads Public Sub Sort( _

ByVal order As SortFlags, _

ByVal col1 As Integer, _

ByVal col2 As Integer _

)

[C#]

public void Sort(

SortFlags order,

int col1,

int col2

);

[Delphi]

public procedure Sort(

order: SortFlags;

col1: Int32;

col2: Int32

); overload;

Parameters

order

One or more values from the SortFlags enumeration that specify the type of sorting to be applied (e.g. ascending, descending, case-sensitive, etc).

col1

Start of a range of columns to sort.

col2

End of a range of columns to sort.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


NodeMoveEnum Enumeration

NodeMoveEnum Enumeration

Specifies the destination of nodes when they are moved with the Move (NodeMoveEnum, Node) method.

[Visual Basic]

Public Enum NodeMoveEnum

[C#]

public enum NodeMoveEnum

[Delphi]

type NodeMoveEnum = (ChildOf, Down, First, In, Last, Out, Up);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
ChildOf | Make the node a child of the specified node.
Down | Move the node to the position after its next sibling.
First | Move the node to the position before its first sibling.
In | Move the node one level in, deeper into the outline.
Last | Move the node to the position after its last sibling.
Out | Move the node one level out, towards the root.
Up | Move the node to the position before its previous sibling.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


NodeTypeEnum Enumeration

NodeTypeEnum Enumeration

Specifies a node with respect to another given node.

[Visual Basic]

Public Enum NodeTypeEnum

[C#]

public enum NodeTypeEnum

[Delphi]

type NodeTypeEnum = (FirstChild, FirstSibling, LastChild, LastSibling, NextSibling, Parent, PreviousSibling, Root);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Remarks

This enumeration is used with the GetNode method.

Members

Member name | Description
FirstChild | The node's first child.
FirstSibling | The node's first sibling (node with same level and same parent).
LastChild | The node's last child.
LastSibling | The node's last sibling.
NextSibling | The node's next sibling.
Parent | The node's immediate parent.
PreviousSibling | The node's previous sibling.
Root | The node's top-level parent.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs Class

OwnerDrawCellEventArgs Class

Provides data for the OwnerDrawCell event.

For a list of all members of this type, see OwnerDrawCellEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.OwnerDrawCellEventArgs

[Visual Basic]

Public Class OwnerDrawCellEventArgs

Inherits EventArgs

[C#]

public class OwnerDrawCellEventArgs : EventArgs

[Delphi]

type OwnerDrawCellEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs Members

OwnerDrawCellEventArgs Members

OwnerDrawCellEventArgs overview

Public Fields

Bounds | Get the rectangle where the cell will be painted (in client coordinates).
Col | Get the column index of the cell being painted.
Graphics | Gets the Graphics object used to draw the cell. Use this object to draw custom elements in the cell.
Measuring | Gets a value that determines if the event was fired only to measure the cell.
Row | Get the row index of the cell being painted.

Public Properties

Image | Gets or sets the image that will be displayed in the cell.
Style | Sets or sets the CellStyle object used to paint the cell.
Text | Gets or sets the text that will be displayed in the cell.

Public Methods

DrawCell

Overloaded. Causes the grid to paint the whole cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs Fields

OwnerDrawCellEventArgs Fields

The fields of the OwnerDrawCellEventArgs class are listed here. For a complete list of OwnerDrawCellEventArgs class members, see the OwnerDrawCellEventArgs Members topic.

Public Fields

Bounds | Get the rectangle where the cell will be painted (in client coordinates).
Col | Get the column index of the cell being painted.
Graphics | Gets the Graphics object used to draw the cell. Use this object to draw custom elements in the cell.
Measuring | Gets a value that determines if the event was fired only to measure the cell.
Row | Get the row index of the cell being painted.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.Bounds Field

OwnerDrawCellEventArgs.Bounds Field

Get the rectangle where the cell will be painted (in client coordinates).

[Visual Basic]

Public ReadOnly Bounds As Rectangle

[C#]

public readonly Rectangle Bounds

[Delphi]

public Bounds: Rectangle;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.Col Field

OwnerDrawCellEventArgs.Col Field

Get the column index of the cell being painted.

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.Graphics Field

OwnerDrawCellEventArgs.Graphics Field

Gets the Graphics object used to draw the cell. Use this object to draw custom elements in the cell.

[Visual Basic]

Public ReadOnly Graphics As Graphics

[C#]

public readonly Graphics Graphics

[Delphi]

public Graphics: Graphics;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.Measuring Field

OwnerDrawCellEventArgs.Measuring Field

Gets a value that determines if the event was fired only to measure the cell.

[Visual Basic]

Public ReadOnly Measuring As Boolean

[C#]

public readonly bool Measuring

[Delphi]

public Measuring: Boolean;

Remarks

This occurs while autosizing rows and columns, since the event handler may may change the value displayed in the cell while handling this event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.Row Field

OwnerDrawCellEventArgs.Row Field

Get the row index of the cell being painted.

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs Properties

OwnerDrawCellEventArgs Properties

The properties of the OwnerDrawCellEventArgs class are listed here. For a complete list of OwnerDrawCellEventArgs class members, see the OwnerDrawCellEventArgs Members topic.

Public Properties

Image | Gets or sets the image that will be displayed in the cell.
Style | Sets or sets the CellStyle object used to paint the cell.
Text | Gets or sets the text that will be displayed in the cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.Image Property

OwnerDrawCellEventArgs.Image Property

Gets or sets the image that will be displayed in the cell.

[Visual Basic]

Public Property Image As Image

[C#]

public Image Image {get;set;}

[Delphi]

public property Image: Image read get_Image write set_Image;

Remarks

Changing this value is an easy way to modify the image displayed in a cell without any custom drawing code.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.Style Property

OwnerDrawCellEventArgs.Style Property

Sets or sets the CellStyle object used to paint the cell.

[Visual Basic]

Public Property Style As CellStyle

[C#]

public CellStyle Style {get;set;}

[Delphi]

public property Style: CellStyle read get_Style write set_Style;

Remarks

This parameter is often used to provide dynamic formatting based on cell contents. For example, if the cell contains a value outside a given range, the event handler may assign a new style to this parameter.

Although it is legal to modify the members of the CellStyle parameter in this event, this is not recommended, since the change will affect other cells that may be using this style.

Example

The code below uses the OwnerDrawCell event to highlight cells that indicate low stock levels.

// create style used to display low-stock items

CellStyle cs = _flex.Styles.Add("Critical");

cs.BackColor = Color.Red;

private void _flex_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)

{

// ignore fixed cells

if (e.Row < _flex.Rows.Fixed || e.Col < _flex.Cols.Fixed)

return;

// apply custom style if reorder level is critical

if (_flex.Cols[e.Col].Name == "UnitsInStock")

{

// change the style by applying the "Critical" style to the Style parameter

// (do not change the e.Style.BackColor property directly since that would

// affect other cells that use this style)

if ((short)_flex[e.Row, "UnitsInStock"] < (short)_flex[e.Row, "ReorderLevel"])

e.Style = _flex.Styles["Critical"];

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.Text Property

OwnerDrawCellEventArgs.Text Property

Gets or sets the text that will be displayed in the cell.

[Visual Basic]

Public Property Text As String

[C#]

public string Text {get;set;}

[Delphi]

public property Text: String read get_Text write set_Text;

Remarks

Changing this value is an easy way to modify the text displayed in a cell without any custom drawing code.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs Methods

OwnerDrawCellEventArgs Methods

The methods of the OwnerDrawCellEventArgs class are listed here. For a complete list of OwnerDrawCellEventArgs class members, see the OwnerDrawCellEventArgs Members topic.

Public Methods

DrawCell

Overloaded. Causes the grid to paint the whole cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.DrawCell Method

OwnerDrawCellEventArgs.DrawCell Method

Overload List

Causes the grid to paint the whole cell.

[Visual Basic] Overloads Public Sub DrawCell()

[C#] public DrawCell();

[Delphi] public procedure DrawCell(); overload;

Causes the grid to paint parts of the cell (background, foreground, border, etc.)

[Visual Basic] Overloads Public Sub DrawCell(DrawCellFlags)

[C#] public DrawCell(DrawCellFlags);

[Delphi] public procedure DrawCell(DrawCellFlags); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.DrawCell Method ()

OwnerDrawCellEventArgs.DrawCell Method ()

Causes the grid to paint the whole cell.

[Visual Basic]

Overloads Public Sub DrawCell()

[C#]

public void DrawCell()

[Delphi]

public procedure DrawCell(); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventArgs.DrawCell Method (DrawCellFlags)

OwnerDrawCellEventArgs.DrawCell Method (DrawCellFlags)

Causes the grid to paint parts of the cell (background, foreground, border, etc.)

[Visual Basic]

Overloads Public Sub DrawCell( _

ByVal flags As DrawCellFlags _

)

[C#]

public void DrawCell(

DrawCellFlags flags

);

[Delphi]

public procedure DrawCell(

flags: DrawCellFlags

); overload;

Parameters

flags

DrawCellFlags that specifies the parts of the cell.

Remarks

This method is typically called in OwnerDrawCell handlers when the code intends to draw some elements of the cell but not everything.

For example, the code may want to draw a custom border only. In this case, it could call e.DrawCell(DrawCellFlags.Background | DrawCellFlags.Content) to draw the cell background and content, and later draw the custom border. Or the code could want to draw a custom marker in a cell (like a note indicator in Excel). In this case, it should call e.DrawCell() to draw the entire cell, and later add the note marker (little red triangle on the top right corner of the cell).

If the owner-draw code draws the entire cell (including the background), then there's no need to call e.DrawCell at all.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OwnerDrawCellEventHandler Delegate

OwnerDrawCellEventHandler Delegate

Represents the method that will handle the OwnerDrawCell event.

[Visual Basic]

Public Delegate Sub OwnerDrawCellEventHandler( _

ByVal sender As Object, _

ByVal e As OwnerDrawCellEventArgs _

)

[C#]

public delegate void OwnerDrawCellEventHandler(

object sender,

OwnerDrawCellEventArgs e

);

[Delphi]

type OwnerDrawCellEventHandler = procedure (

sender: Object;

e: OwnerDrawCellEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PrintGridFlags Enumeration

PrintGridFlags Enumeration

Contains flags that specify printing options to use with the PrintGrid (String, PrintGridFlags) method.

[Visual Basic]

Public Enum PrintGridFlags

[C#]

public enum PrintGridFlags

[Delphi]

type PrintGridFlags = (ActualSize, ExtendLastCol, FitToPage, FitToPageWidth, ShowHighlight, ShowPageSetupDialog, ShowPreviewDialog, ShowPrintDialog);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
ActualSize | Print the grid in actual (screen size). If the grid is too wide to fit on a page, columns spill onto separate pages. If the grid is too tall to fit on a page, rows spill onto additional pages.
ExtendLastCol | Extend the last column on each printed page.
FitToPage | Scale the grid so it will fit on a single page (rows and columns).
FitToPageWidth | Scale the grid so its width will fit on a single page. If the grid is too tall to fit on a page, rows spill onto additional pages.
ShowHighlight | Show highlighted selection while printing.
ShowPageSetupDialog | Show a page setup dialog before printing so the user can select paper size, orientation, and margins.
ShowPreviewDialog | Show a print preview dialog before printing so the user can inspect the document before printing it.
ShowPrintDialog | Show a print setup dialog before printing so the user can select the printer to use.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RangeEventArgs Class

RangeEventArgs Class

Provides data for the AfterRowColChange, AfterScroll, AfterSelChange, BeforeRowColChange, BeforeScroll, and BeforeSelChange events.

For a list of all members of this type, see RangeEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.RangeEventArgs

[Visual Basic]

Public Class RangeEventArgs

Inherits EventArgs

[C#]

public class RangeEventArgs : EventArgs

[Delphi]

type RangeEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RangeEventArgs Members

RangeEventArgs Members

RangeEventArgs overview

Public Constructors

RangeEventArgs Constructor

Initializes a new instance of the RangeEventArgs class.

Public Fields

Cancel | Gets or sets a value indicating whether the new selection should be canceled.
NewRange | Gets the range that will be selected after the event.
OldRange | Gets the range selected before the event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RangeEventArgs Constructor

RangeEventArgs Constructor

Initializes a new instance of the RangeEventArgs class.

[Visual Basic]

Public Function New( _

ByVal rgOld As CellRange, _

ByVal rgNew As CellRange _

)

[C#]

public RangeEventArgs(

CellRange rgOld,

CellRange rgNew

);

[Delphi]

public constructor Create(

rgOld: CellRange;

rgNew: CellRange

);

Parameters

rgOld

The range selected before the event.

rgNew

The range that will be selected after the event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RangeEventArgs Fields

RangeEventArgs Fields

The fields of the RangeEventArgs class are listed here. For a complete list of RangeEventArgs class members, see the RangeEventArgs Members topic.

Public Fields

Cancel | Gets or sets a value indicating whether the new selection should be canceled.
NewRange | Gets the range that will be selected after the event.
OldRange | Gets the range selected before the event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RangeEventArgs.Cancel Field

RangeEventArgs.Cancel Field

Gets or sets a value indicating whether the new selection should be canceled.

[Visual Basic]

Public Cancel As Boolean

[C#]

public bool Cancel

[Delphi]

public Cancel: Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RangeEventArgs.NewRange Field

RangeEventArgs.NewRange Field

Gets the range that will be selected after the event.

[Visual Basic]

Public ReadOnly NewRange As CellRange

[C#]

public readonly CellRange NewRange

[Delphi]

public NewRange: CellRange;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RangeEventArgs.OldRange Field

RangeEventArgs.OldRange Field

Gets the range selected before the event.

[Visual Basic]

Public ReadOnly OldRange As CellRange

[C#]

public readonly CellRange OldRange

[Delphi]

public OldRange: CellRange;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RangeEventHandler Delegate

RangeEventHandler Delegate

Represents the method that will handle the AfterRowColChange, AfterScroll, AfterSelChange, BeforeRowColChange, BeforeScroll, and BeforeSelChange events.

[Visual Basic]

Public Delegate Sub RangeEventHandler( _

ByVal sender As Object, _

ByVal e As RangeEventArgs _

)

[C#]

public delegate void RangeEventHandler(

object sender,

RangeEventArgs e

);

[Delphi]

type RangeEventHandler = procedure (

sender: Object;

e: RangeEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row Class

Row Class

Class that represents a grid row.

For a list of all members of this type, see Row Members.

System.Object

C1.Win.C1FlexGrid.RowCol

C1.Win.C1FlexGrid.Row

[Visual Basic]

Public Class Row

Inherits RowCol

[C#]

public class Row : RowCol

[Delphi]

type Row = class (RowCol);

Remarks

This class does not have a public constructor. You can add and remove rows using methods in the grid's Rows property, which exposes the row collection.

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row Members

Row Members

Row overview

Public Properties

AllowDragging (inherited from RowCol) | Gets or sets whether the user can drag this row or column with the mouse.
AllowEditing (inherited from RowCol) | Gets or sets whether cells on this row or column can be edited by the user.
AllowMerging (inherited from RowCol) | Specifies whether adjacent cells with similar contents will be merged.
AllowResizing (inherited from RowCol) | Gets or sets whether the user can resize this row or column with the mouse.
Bottom | Gets the position of the bottom of this row, in pixels, relative to the grid.
Caption | Gets or sets the text of the first fixed cell in the row.
ComboList (inherited from RowCol) | Gets or sets a list of items to be used by the drop-down editor.
DataIndex | Gets the index of this row in the RowCollection collection, excluding fixed and node rows.
DataMap (inherited from RowCol) | Gets or sets an System.Collections.IDictionary object used to translate data values into display values for this row or column.
DataSource | Gets the object that provides data for this row.
DataType (inherited from RowCol) | Gets or sets the type of object stored in a row or column.
EditMask (inherited from RowCol) | Gets or sets the input mask to use when editing cells on this column.
Editor (inherited from RowCol) | Gets or sets the custom editor used to edit cells in this column.
Format (inherited from RowCol) | Gets or sets a string that specifies how to format the data on this column.
Height | Gets or sets the height of this row, in pixels (the value -1 represents the default row height).
HeightDisplay | Gets or sets the display height for this row, in pixels.
ImageAlign (inherited from RowCol) | Gets or sets an ImageAlignEnum value that determines how images are aligned in scrollable cells on this row or column.
ImageAlignFixed (inherited from RowCol) | Gets or sets an ImageAlignEnum value that determines how images are aligned in fixed cells on this row or column.
ImageAndText (inherited from RowCol) | Gets or sets a value that determines whether images found in this row or column's ImageMap should be displayed instead of or in addition to the cell text.
ImageMap (inherited from RowCol) | Gets or sets an System.Collections.IDictionary object used to translate data values into images for this row or column.
Index | Overriden. Gets the index of this row in the RowCollection collection.
IsNew | Indicates the row is a placeholder for adding new rows to the grid.
IsNode | Gets or sets whether this row is a node row in an outline.
Item | Overloaded. Gets or sets the cell value specified by the column index in this row.
Node | Gets the Node object associated with this row.
SafeIndex | Gets the index of this row in the RowCollection collection.
Selected | Overriden. Gets or sets whether this row is selected.
Style (inherited from RowCol) | Gets or sets a custom CellStyle associated with this row or column.
StyleDisplay (inherited from RowCol) | Gets the style used to display this row or column.
StyleFixed (inherited from RowCol) | Gets the stock CellStyle used to paint fixed cells.
StyleFixedDisplay (inherited from RowCol) | Gets the style used to display fixed cells on this row or column.
StyleFixedNew (inherited from RowCol) | Gets the custom style associated with fixed cells on this row or column, createing a new one of necessary.
StyleNew (inherited from RowCol) | Gets or sets a custom CellStyle associated with this row or column, creating a new style if necessary.
TextAlign (inherited from RowCol) | Gets or sets a TextAlignEnum value that determines how text is aligned in scrollable cells on this row or column.
TextAlignFixed (inherited from RowCol) | Gets or sets a TextAlignEnum value that determines how text is aligned in fixed cells on this row or column.
Top | Gets the position of the top of this row, in pixels, relative to the grid.
UserData (inherited from RowCol) | Gets or sets user data associated with this row or column.
Visible (inherited from RowCol) | Gets or sets whether a Row or Column is visible.

Public Methods

Clear | Overriden. Clears this row.
Invalidate | Overriden. Invalidates this row, causing it to be repainted.
Move | Overriden. Moves a row to a new position in the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row Properties

Row Properties

The properties of the Row class are listed here. For a complete list of Row class members, see the Row Members topic.

Public Properties

AllowDragging (inherited from RowCol) | Gets or sets whether the user can drag this row or column with the mouse.
AllowEditing (inherited from RowCol) | Gets or sets whether cells on this row or column can be edited by the user.
AllowMerging (inherited from RowCol) | Specifies whether adjacent cells with similar contents will be merged.
AllowResizing (inherited from RowCol) | Gets or sets whether the user can resize this row or column with the mouse.
Bottom | Gets the position of the bottom of this row, in pixels, relative to the grid.
Caption | Gets or sets the text of the first fixed cell in the row.
ComboList (inherited from RowCol) | Gets or sets a list of items to be used by the drop-down editor.
DataIndex | Gets the index of this row in the RowCollection collection, excluding fixed and node rows.
DataMap (inherited from RowCol) | Gets or sets an System.Collections.IDictionary object used to translate data values into display values for this row or column.
DataSource | Gets the object that provides data for this row.
DataType (inherited from RowCol) | Gets or sets the type of object stored in a row or column.
EditMask (inherited from RowCol) | Gets or sets the input mask to use when editing cells on this column.
Editor (inherited from RowCol) | Gets or sets the custom editor used to edit cells in this column.
Format (inherited from RowCol) | Gets or sets a string that specifies how to format the data on this column.
Height | Gets or sets the height of this row, in pixels (the value -1 represents the default row height).
HeightDisplay | Gets or sets the display height for this row, in pixels.
ImageAlign (inherited from RowCol) | Gets or sets an ImageAlignEnum value that determines how images are aligned in scrollable cells on this row or column.
ImageAlignFixed (inherited from RowCol) | Gets or sets an ImageAlignEnum value that determines how images are aligned in fixed cells on this row or column.
ImageAndText (inherited from RowCol) | Gets or sets a value that determines whether images found in this row or column's ImageMap should be displayed instead of or in addition to the cell text.
ImageMap (inherited from RowCol) | Gets or sets an System.Collections.IDictionary object used to translate data values into images for this row or column.
Index | Overriden. Gets the index of this row in the RowCollection collection.
IsNew | Indicates the row is a placeholder for adding new rows to the grid.
IsNode | Gets or sets whether this row is a node row in an outline.
Item | Overloaded. Gets or sets the cell value specified by the column index in this row.
Node | Gets the Node object associated with this row.
SafeIndex | Gets the index of this row in the RowCollection collection.
Selected | Overriden. Gets or sets whether this row is selected.
Style (inherited from RowCol) | Gets or sets a custom CellStyle associated with this row or column.
StyleDisplay (inherited from RowCol) | Gets the style used to display this row or column.
StyleFixed (inherited from RowCol) | Gets the stock CellStyle used to paint fixed cells.
StyleFixedDisplay (inherited from RowCol) | Gets the style used to display fixed cells on this row or column.
StyleFixedNew (inherited from RowCol) | Gets the custom style associated with fixed cells on this row or column, createing a new one of necessary.
StyleNew (inherited from RowCol) | Gets or sets a custom CellStyle associated with this row or column, creating a new style if necessary.
TextAlign (inherited from RowCol) | Gets or sets a TextAlignEnum value that determines how text is aligned in scrollable cells on this row or column.
TextAlignFixed (inherited from RowCol) | Gets or sets a TextAlignEnum value that determines how text is aligned in fixed cells on this row or column.
Top | Gets the position of the top of this row, in pixels, relative to the grid.
UserData (inherited from RowCol) | Gets or sets user data associated with this row or column.
Visible (inherited from RowCol) | Gets or sets whether a Row or Column is visible.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Bottom Property

Row.Bottom Property

Gets the position of the bottom of this row, in pixels, relative to the grid.

[Visual Basic]

Public ReadOnly Property Bottom As Integer

[C#]

public int Bottom {get;}

[Delphi]

public property Bottom: Int32 read get_Bottom;

Remarks

The value returned corresponds to the sum of the Top and HeightDisplay properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Caption Property

Row.Caption Property

Gets or sets the text of the first fixed cell in the row.

[Visual Basic]

Public Property Caption As String

[C#]

public string Caption {get;set;}

[Delphi]

public property Caption: String read get_Caption write set_Caption;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.DataIndex Property

Row.DataIndex Property

Gets the index of this row in the RowCollection collection, excluding fixed and node rows.

[Visual Basic]

Public ReadOnly Property DataIndex As Integer

[C#]

public int DataIndex {get;}

[Delphi]

public property DataIndex: Int32 read get_DataIndex;

Remarks

This property returns -1 if the row is a fixed or node row.

If the grid is bound to a data source, the return value can be used as an indexer into the grid's data source to obtain a reference to the item bound to the row.

You can also obtain the underlying data object directly using the row's DataSource property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.DataSource Property

Row.DataSource Property

Gets the object that provides data for this row.

[Visual Basic]

Public ReadOnly Property DataSource As Object

[C#]

public object DataSource {get;}

[Delphi]

public property DataSource: Object read get_DataSource;

Remarks

The type of object returned depends on the type of DataSource assigned to the grid. For example, if the grid is bound to a System.Data.DataView object, then this property will return the specific System.Data.DataRowView object that is bound to this row.

This property returns null if the grid is unbound, or if the row is a fixed or node row that doesn't correspond to any objects in the grid's data source.

For an example, see the GetUnboundValue event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Height Property

Row.Height Property

Gets or sets the height of this row, in pixels (the value -1 represents the default row height).

[Visual Basic]

Public Property Height As Integer

[C#]

public int Height {get;set;}

[Delphi]

public property Height: Int32 read get_Height write set_Height;

Remarks

Setting this property to -1 causes the grid to use the default row height for this row (see the DefaultSize property).

Height returns the height assigned to the row even if the row is invisible, and returns -1 if the row has the default height. To obtain the actual display height of a row, use the HeightDisplay property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.HeightDisplay Property

Row.HeightDisplay Property

Gets or sets the display height for this row, in pixels.

[Visual Basic]

Public Property HeightDisplay As Integer

[C#]

public int HeightDisplay {get;set;}

[Delphi]

public property HeightDisplay: Int32 read get_HeightDisplay write set_HeightDisplay;

Remarks

HeightDisplay returns zero if the row is invisible, and returns the actual display height even if the Height property is set to -1 (which stands for default row height).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Index Property

Row.Index Property

Gets the index of this row in the RowCollection collection.

[Visual Basic]

Overrides Public ReadOnly Property Index As Integer

[C#]

override public int Index {get;}

[Delphi]

public property Index: Int32 read get_Index;

Remarks

This property returns -1 if the Row is not a member of the collection.

See also the SafeIndex and DataIndex properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.IsNew Property

Row.IsNew Property

Indicates the row is a placeholder for adding new rows to the grid.

[Visual Basic]

Public ReadOnly Property IsNew As Boolean

[C#]

public bool IsNew {get;}

[Delphi]

public property IsNew: Boolean read get_IsNew;

Remarks

This property returns True for the last row on the grid when the AllowAddNew property is set to True. This is the row that has an asterisk glyph on the first fixed column.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.IsNode Property

Row.IsNode Property

Gets or sets whether this row is a node row in an outline.

[Visual Basic]

Public Property IsNode As Boolean

[C#]

public bool IsNode {get;set;}

[Delphi]

public property IsNode: Boolean read get_IsNode write set_IsNode;

Remarks

This property determines whether the row behaves as a node in an outline tree.

You can use IsNode to create custom outline trees, or use the grid's Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method to create outline trees automatically.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Item Property

Row.Item Property

Overload List

Gets or sets the cell value specified by the column index in this row.

[Visual Basic] Overloads Public Default Property Item(Integer) As Object

[C#] public object this[int]{get;set;}

[Delphi] public property Item[columnIndex: Int32]: Object read get_Item write set_Item;

Gets or sets the cell value specified by the column name in this row.

[Visual Basic] Overloads Public Default Property Item(String) As Object

[C#] public object this[string]{get;set;}

[Delphi] public property Item[columnName: String]: Object read get_Item write set_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Item Property (Int32)

Row.Item Property (Int32)

Gets or sets the cell value specified by the column index in this row.

[Visual Basic]

Public Default Property Item( _

ByVal columnIndex As Integer _

) As Object

[C#]

public object this[

int columnIndex

] {get;set;}

[Delphi]

public property Item[

columnIndex: Int32

]: Object read get_Item write set_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Item Property (String)

Row.Item Property (String)

Gets or sets the cell value specified by the column name in this row.

[Visual Basic]

Public Default Property Item( _

ByVal columnName As String _

) As Object

[C#]

public object this[

string columnName

] {get;set;}

[Delphi]

public property Item[

columnName: String

]: Object read get_Item write set_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Node Property

Row.Node Property

Gets the Node object associated with this row.

[Visual Basic]

Public ReadOnly Property Node As Node

[C#]

public Node Node {get;}

[Delphi]

public property Node: Node read get_Node;

Remarks

If the row is a node (see the IsNode property), this property returns a Node object that can be used to collapse or expand the node, set its level within the outline tree, etc.

If the row is not a node, this property gets the row's parent node.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.SafeIndex Property

Row.SafeIndex Property

Gets the index of this row in the RowCollection collection.

[Visual Basic]

Overridable Public ReadOnly Property SafeIndex As Integer

[C#]

virtual public int SafeIndex {get;}

[Delphi]

public property SafeIndex: Int32 read get_SafeIndex;

Remarks

This property is similar to the Index property, except it throws an exception if the Row is not a member of the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Selected Property

Row.Selected Property

Gets or sets whether this row is selected.

[Visual Basic]

Overrides Public Property Selected As Boolean

[C#]

override public bool Selected {get;set;}

[Delphi]

public property Selected: Boolean read get_Selected write set_Selected;

Remarks

Use this property to get or set the selection status for individual rows when the grid's System.Windows.Forms.SelectionMode property is set to SelectionModeEnum.ListBox.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Top Property

Row.Top Property

Gets the position of the top of this row, in pixels, relative to the grid.

[Visual Basic]

Public ReadOnly Property Top As Integer

[C#]

public int Top {get;}

[Delphi]

public property Top: Int32 read get_Top;

Remarks

The value returned is the sum of row heights from the top of the grid until this row, and does not account for the scroll position. To account for the scroll position, this value should be adjusted using the grid's ScrollPosition property.

To retrieve the size and position of a cell, use the GetCellRect (Int32, Int32, Boolean) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row Methods

Row Methods

The methods of the Row class are listed here. For a complete list of Row class members, see the Row Members topic.

Public Methods

Clear | Overriden. Clears this row.
Invalidate | Overriden. Invalidates this row, causing it to be repainted.
Move | Overriden. Moves a row to a new position in the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Clear Method

Row.Clear Method

Clears this row.

[Visual Basic]

Overrides Public Sub Clear( _

ByVal clearFlags As ClearFlags _

)

[C#]

override public void Clear(

ClearFlags clearFlags

);

[Delphi]

public procedure Clear(

clearFlags: ClearFlags

); override;

Parameters

clearFlags

ClearFlags value specifying which elements of the row should be cleared.

Remarks

Use this method to reset row properties to their default values (height, visibility, style, user data, etc.).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Invalidate Method

Row.Invalidate Method

Invalidates this row, causing it to be repainted.

[Visual Basic]

Overrides Public Sub Invalidate()

[C#]

override public void Invalidate()

[Delphi]

public procedure Invalidate(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Row.Move Method

Row.Move Method

Moves a row to a new position in the collection.

[Visual Basic]

Overrides Public Sub Move( _

ByVal indexNew As Integer _

)

[C#]

override public void Move(

int indexNew

);

[Delphi]

public procedure Move(

indexNew: Int32

); override;

Parameters

indexNew

An integer specifying the row's new position.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol Class

RowCol Class

Base class for grid rows and columns ( Row and Column classes).

For a list of all members of this type, see RowCol Members.

System.Object

C1.Win.C1FlexGrid.RowCol

C1.Win.C1FlexGrid.Column

C1.Win.C1FlexGrid.Row

[Visual Basic]

MustInherit Public Class RowCol

[C#]

public abstract class RowCol

[Delphi]

type RowCol = class abstract;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol Members

RowCol Members

RowCol overview

Public Properties

AllowDragging | Gets or sets whether the user can drag this row or column with the mouse.
AllowEditing | Gets or sets whether cells on this row or column can be edited by the user.
AllowMerging | Specifies whether adjacent cells with similar contents will be merged.
AllowResizing | Gets or sets whether the user can resize this row or column with the mouse.
ComboList | Gets or sets a list of items to be used by the drop-down editor.
DataMap | Gets or sets an System.Collections.IDictionary object used to translate data values into display values for this row or column.
DataType | Gets or sets the type of object stored in a row or column.
EditMask | Gets or sets the input mask to use when editing cells on this column.
Editor | Gets or sets the custom editor used to edit cells in this column.
Format | Gets or sets a string that specifies how to format the data on this column.
ImageAlign | Gets or sets an ImageAlignEnum value that determines how images are aligned in scrollable cells on this row or column.
ImageAlignFixed | Gets or sets an ImageAlignEnum value that determines how images are aligned in fixed cells on this row or column.
ImageAndText | Gets or sets a value that determines whether images found in this row or column's ImageMap should be displayed instead of or in addition to the cell text.
ImageMap | Gets or sets an System.Collections.IDictionary object used to translate data values into images for this row or column.
Index | Gets the index of this row or column in its parent collection (or -1 if the element is not a member of the collection).
Selected | Gets or sets whether this row or column is selected.
Style | Gets or sets a custom CellStyle associated with this row or column.
StyleDisplay | Gets the style used to display this row or column.
StyleFixed | Gets the stock CellStyle used to paint fixed cells.
StyleFixedDisplay | Gets the style used to display fixed cells on this row or column.
StyleFixedNew | Gets the custom style associated with fixed cells on this row or column, createing a new one of necessary.
StyleNew | Gets or sets a custom CellStyle associated with this row or column, creating a new style if necessary.
TextAlign | Gets or sets a TextAlignEnum value that determines how text is aligned in scrollable cells on this row or column.
TextAlignFixed | Gets or sets a TextAlignEnum value that determines how text is aligned in fixed cells on this row or column.
UserData | Gets or sets user data associated with this row or column.
Visible | Gets or sets whether a Row or Column is visible.

Public Methods

Clear | Clears the contents of the row or column.
Invalidate | Invalidates an individual row or column, causing it to be repainted.
Move | Moves this row or column to a new position in the collection.

Protected Constructors

RowCol Constructor

Initializes a new instance of the RowCol class.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol Constructor

RowCol Constructor

Initializes a new instance of the RowCol class.

[Visual Basic]

Protected Function New()

[C#]

protected RowCol()

[Delphi]

strict protected constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol Properties

RowCol Properties

The properties of the RowCol class are listed here. For a complete list of RowCol class members, see the RowCol Members topic.

Public Properties

AllowDragging | Gets or sets whether the user can drag this row or column with the mouse.
AllowEditing | Gets or sets whether cells on this row or column can be edited by the user.
AllowMerging | Specifies whether adjacent cells with similar contents will be merged.
AllowResizing | Gets or sets whether the user can resize this row or column with the mouse.
ComboList | Gets or sets a list of items to be used by the drop-down editor.
DataMap | Gets or sets an System.Collections.IDictionary object used to translate data values into display values for this row or column.
DataType | Gets or sets the type of object stored in a row or column.
EditMask | Gets or sets the input mask to use when editing cells on this column.
Editor | Gets or sets the custom editor used to edit cells in this column.
Format | Gets or sets a string that specifies how to format the data on this column.
ImageAlign | Gets or sets an ImageAlignEnum value that determines how images are aligned in scrollable cells on this row or column.
ImageAlignFixed | Gets or sets an ImageAlignEnum value that determines how images are aligned in fixed cells on this row or column.
ImageAndText | Gets or sets a value that determines whether images found in this row or column's ImageMap should be displayed instead of or in addition to the cell text.
ImageMap | Gets or sets an System.Collections.IDictionary object used to translate data values into images for this row or column.
Index | Gets the index of this row or column in its parent collection (or -1 if the element is not a member of the collection).
Selected | Gets or sets whether this row or column is selected.
Style | Gets or sets a custom CellStyle associated with this row or column.
StyleDisplay | Gets the style used to display this row or column.
StyleFixed | Gets the stock CellStyle used to paint fixed cells.
StyleFixedDisplay | Gets the style used to display fixed cells on this row or column.
StyleFixedNew | Gets the custom style associated with fixed cells on this row or column, createing a new one of necessary.
StyleNew | Gets or sets a custom CellStyle associated with this row or column, creating a new style if necessary.
TextAlign | Gets or sets a TextAlignEnum value that determines how text is aligned in scrollable cells on this row or column.
TextAlignFixed | Gets or sets a TextAlignEnum value that determines how text is aligned in fixed cells on this row or column.
UserData | Gets or sets user data associated with this row or column.
Visible | Gets or sets whether a Row or Column is visible.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.AllowDragging Property

RowCol.AllowDragging Property

Gets or sets whether the user can drag this row or column with the mouse.

[Visual Basic]

Overridable Public Property AllowDragging As Boolean

[C#]

virtual public bool AllowDragging {get;set;}

[Delphi]

public property AllowDragging: Boolean read get_AllowDragging write set_AllowDragging;

Remarks

The grid object also has an AllowDragging property. If dragging is disabled at the grid level, the user will not be able to drag any rows or columns.

If dragging is allowed by the grid's AllowDragging property, then dragging of individual rows and columns can still be disabled by setting this property to False.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.AllowEditing Property

RowCol.AllowEditing Property

Gets or sets whether cells on this row or column can be edited by the user.

[Visual Basic]

Overridable Public Property AllowEditing As Boolean

[C#]

virtual public bool AllowEditing {get;set;}

[Delphi]

public property AllowEditing: Boolean read get_AllowEditing write set_AllowEditing;

Remarks

The grid object also has an AllowEditing property. If editing is disabled at the grid level, the user will not be able to edit any cells.

If editing is allowed by the grid's AllowEditing property, then editing of individual rows and columns can still be disabled by setting this property to False.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.AllowMerging Property

RowCol.AllowMerging Property

Specifies whether adjacent cells with similar contents will be merged.

[Visual Basic]

Overridable Public Property AllowMerging As Boolean

[C#]

virtual public bool AllowMerging {get;set;}

[Delphi]

public property AllowMerging: Boolean read get_AllowMerging write set_AllowMerging;

Remarks

Merging cells allows you to display data in a clear, appealing way because it highlights groups of identical information. It also gives you flexibility to build tables similar to the ones you can create in HTML or using Microsoft Word, both of which support merged cells.

To create tables with merged cells, you must set the AllowMerging property to a value other than AllowMergingEnum.None, and then set the AllowMerging property of individual rows and columns True for the rows and columns you wish to merge.

After these properties are set, the grid will automatically merge adjacent cells that have the same contents. Whenever the cell contents change, the grid updates the merging state.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.AllowResizing Property

RowCol.AllowResizing Property

Gets or sets whether the user can resize this row or column with the mouse.

[Visual Basic]

Overridable Public Property AllowResizing As Boolean

[C#]

virtual public bool AllowResizing {get;set;}

[Delphi]

public property AllowResizing: Boolean read get_AllowResizing write set_AllowResizing;

Remarks

To resize rows or columns, the mouse must be over the fixed area of the grid, and close to a border between rows or columns. The mouse pointer will then change into a sizing pointer and the user can drag the row or column to change the row height or column width.

If a group of columns is selected (from first to last row) and the user resizes one of them, all selected columns are resized. The same applies to rows.

If column sizing is allowed, users may double-click the resizing area to resize a column so it will automatically fit the longest entry.

Rows with zero height and columns with zero width cannot be resized by the user. If you want to make them very small but still resizable, set their height or width to one pixel, not to zero.

The BeforeResizeRow and BeforeResizeColumn events fire before resizing starts, and may be used to prevent resizing of specific rows and columns. The AfterResizeRow and AfterResizeColumn fire after resizing, and may be used to validate the user's action and to update the display.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.ComboList Property

RowCol.ComboList Property

Gets or sets a list of items to be used by the drop-down editor.

[Visual Basic]

Public Property ComboList As String

[C#]

public string ComboList {get;set;}

[Delphi]

public property ComboList: String read get_ComboList write set_ComboList;

Remarks

The ComboList property specifies the type of editor to be used when editing a cell. You may use a text box, drop-down list, drop-down combo, or an edit button to pop up custom editor forms.

To use the ComboList property, set the AllowEditing property to True, and set the ComboList property to a string that describes the type of editing you want to use for that cell. The options are described below:

1. To edit the cell using a regular text box, set the ComboList property to an empty string ("").

2. To edit the cell using a drop-down list, set the ComboList property to a string containing the available options, separated by pipe characters (for example "option 1| option 2").

3. To edit the cell using a drop-down combo, set the ComboList property to a string containing the available options, separated by pipe characters and starting with a pipe character (for example "|option 1|option 2").

4. To display an edit button, set the ComboList property to a string containing an ellipsis ("..."). Edit buttons look like regular push buttons, aligned to the right of the cell, with an ellipsis as a caption. When the user clicks on the edit button, the grid fires the CellButtonClick event. In this case, the user cannot edit the cell contents directly.

5. To display an edit button next to an editable cell, set the ComboList property to a string containing a pipe and an ellipsis ("|..."). In this case, you get a regular edit button but the user can also edit the cell contents directly.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.DataMap Property

RowCol.DataMap Property

Gets or sets an System.Collections.IDictionary object used to translate data values into display values for this row or column.

[Visual Basic]

Public Property DataMap As IDictionary

[C#]

public IDictionary DataMap {get;set;}

[Delphi]

public property DataMap: IDictionary read get_DataMap write set_DataMap;

Remarks

The DataMap property allows you to implement "translated" rows or columns. In translated rows or columns, the grid does not display the values stored in the cells. Instead, it looks up those values in the column's DataMap and displays the mapped value.

The grid also uses the DataMap value to populate drop-down lists when the column is editable.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.DataType Property

RowCol.DataType Property

Gets or sets the type of object stored in a row or column.

[Visual Basic]

Overridable Public Property DataType As Type

[C#]

virtual public Type DataType {get;set;}

[Delphi]

public property DataType: Type read get_DataType write set_DataType;

Remarks

By default, the column's DataType property is set to System.Object, which allows you to store any data values in the column.

If you set a row or column's DataType to a specific type, the grid will try to convert any values assigned to cells in that column to the specified data type. If the conversion fails, the grid will fire a GridError event and the cell value will not be changed.

The DataType property affects how values are stored internally in the grid, how they are sorted, and the type of control that is used to edit the values in the column. For example, a System.Windows.Forms.DateTimePicker control is used to edit values in System.DateTime columns, and check boxes are used to display and edit values in boolean columns.

If you want to store times (not dates) in a column, you can still use the DateTime type, but you should use a Format that displays only the time, not the date.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.EditMask Property

RowCol.EditMask Property

Gets or sets the input mask to use when editing cells on this column.

[Visual Basic]

Public Property EditMask As String

[C#]

public string EditMask {get;set;}

[Delphi]

public property EditMask: String read get_EditMask write set_EditMask;

Remarks

The grid also has an EditMask property that applies to the entire grid. For details and mask syntax, refer to that property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.Editor Property

RowCol.Editor Property

Gets or sets the custom editor used to edit cells in this column.

[Visual Basic]

Overridable Public Property Editor As Control

[C#]

virtual public Control Editor {get;set;}

[Delphi]

public property Editor: Control read get_Editor write set_Editor;

Remarks

The grid provides several built-in editors that are automatically selected based on the properties of the cell being edited.

This property allows you to use external editors when editing values in a given column. Any control can be used as an external editor, but to achieve complete integration with the grid, the external editor should implement the IC1EmbeddedEditor interface.

You can associate external editors with columns at design time (using the grid's Column Editor) or at run time, by setting this property.

Example

The code below creates a C1DateEdit control and assigns it to the Editor property of a grid column. The control will be used to edit cells on this column instead of the default System.Windows.Forms.DateTimePicker control.

All controls in the C1Input library implement the IC1EmbeddedEditor interface and can be used as grid editors without any extra code.

// create C1DateEdit control (included with C1Input)

C1DateEdit dateEdit = new C1DateEdit();

// use the new control as an editor for a grid column

_flex.Cols[1].DataType = typeof(DateTime);

_flex.Cols[1].Editor = c1DateEdit;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.Format Property

RowCol.Format Property

Gets or sets a string that specifies how to format the data on this column.

[Visual Basic]

Public Property Format As String

[C#]

public string Format {get;set;}

[Delphi]

public property Format: String read get_Format write set_Format;

Remarks

The Format property affects how values are formatted for display, not the values stored internally. To retrieve the formatted value of a cell, use the GetDataDisplay (Int32, Int32) property.

The Format string has the same semantics as the format argument in the .NET System.String.Format(System.String,System.Object) method. For details and a complete set of examples, see the .NET documentation.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.ImageAlign Property

RowCol.ImageAlign Property

Gets or sets an ImageAlignEnum value that determines how images are aligned in scrollable cells on this row or column.

[Visual Basic]

Public Property ImageAlign As ImageAlignEnum

[C#]

public ImageAlignEnum ImageAlign {get;set;}

[Delphi]

public property ImageAlign: ImageAlignEnum read get_ImageAlign write set_ImageAlign;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.ImageAlignFixed Property

RowCol.ImageAlignFixed Property

Gets or sets an ImageAlignEnum value that determines how images are aligned in fixed cells on this row or column.

[Visual Basic]

Public Property ImageAlignFixed As ImageAlignEnum

[C#]

public ImageAlignEnum ImageAlignFixed {get;set;}

[Delphi]

public property ImageAlignFixed: ImageAlignEnum read get_ImageAlignFixed write set_ImageAlignFixed;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.ImageAndText Property

RowCol.ImageAndText Property

Gets or sets a value that determines whether images found in this row or column's ImageMap should be displayed instead of or in addition to the cell text.

[Visual Basic]

Public Property ImageAndText As Boolean

[C#]

public bool ImageAndText {get;set;}

[Delphi]

public property ImageAndText: Boolean read get_ImageAndText write set_ImageAndText;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.ImageMap Property

RowCol.ImageMap Property

Gets or sets an System.Collections.IDictionary object used to translate data values into images for this row or column.

[Visual Basic]

Public Property ImageMap As IDictionary

[C#]

public IDictionary ImageMap {get;set;}

[Delphi]

public property ImageMap: IDictionary read get_ImageMap write set_ImageMap;

Remarks

Use this property to associate data values in a row or column with images. For example, if a column contains country names, you can use this property to display the corresponding flags.

Use the ImageAndText property to determine whether the image is displayed instead of or in addition to the cell text.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.Index Property

RowCol.Index Property

Gets the index of this row or column in its parent collection (or -1 if the element is not a member of the collection).

[Visual Basic]

Overridable Public ReadOnly Property Index As Integer

[C#]

virtual public int Index {get;}

[Delphi]

public property Index: Int32 read get_Index;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.Selected Property

RowCol.Selected Property

Gets or sets whether this row or column is selected.

[Visual Basic]

Overridable Public Property Selected As Boolean

[C#]

virtual public bool Selected {get;set;}

[Delphi]

public property Selected: Boolean read get_Selected write set_Selected;

Remarks

Use this property to get or set the selection state for individual rows when the grid's System.Windows.Forms.SelectionMode property is set to SelectionModeEnum.ListBox.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.Style Property

RowCol.Style Property

Gets or sets a custom CellStyle associated with this row or column.

[Visual Basic]

Overridable Public Property Style As CellStyle

[C#]

virtual public CellStyle Style {get;set;}

[Delphi]

public property Style: CellStyle read get_Style write set_Style;

Remarks

If this element does not have a custom style, this property returns null.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.StyleDisplay Property

RowCol.StyleDisplay Property

Gets the style used to display this row or column.

[Visual Basic]

Overridable Public ReadOnly Property StyleDisplay As CellStyle

[C#]

virtual public CellStyle StyleDisplay {get;}

[Delphi]

public property StyleDisplay: CellStyle read get_StyleDisplay;

Remarks

This property never returns null. If the row or column has a custom style, this property returns that style. Otherwise, it returns the stock style used to display the row (e.g., Normal, Alternate, Fixed).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.StyleFixed Property

RowCol.StyleFixed Property

Gets the stock CellStyle used to paint fixed cells.

[Visual Basic]

Overridable Public Property StyleFixed As CellStyle

[C#]

virtual public CellStyle StyleFixed {get;set;}

[Delphi]

public property StyleFixed: CellStyle read get_StyleFixed write set_StyleFixed;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.StyleFixedDisplay Property

RowCol.StyleFixedDisplay Property

Gets the style used to display fixed cells on this row or column.

[Visual Basic]

Overridable Public ReadOnly Property StyleFixedDisplay As CellStyle

[C#]

virtual public CellStyle StyleFixedDisplay {get;}

[Delphi]

public property StyleFixedDisplay: CellStyle read get_StyleFixedDisplay;

Remarks

If the row or column has a custom style associated with its fixed cells, this property returns that style. Otherwise, it returns the stock style used to display the column (e.g., Normal, Fixed).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.StyleFixedNew Property

RowCol.StyleFixedNew Property

Gets the custom style associated with fixed cells on this row or column, createing a new one of necessary.

[Visual Basic]

Overridable Public ReadOnly Property StyleFixedNew As CellStyle

[C#]

virtual public CellStyle StyleFixedNew {get;}

[Delphi]

public property StyleFixedNew: CellStyle read get_StyleFixedNew;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.StyleNew Property

RowCol.StyleNew Property

Gets or sets a custom CellStyle associated with this row or column, creating a new style if necessary.

[Visual Basic]

Overridable Public ReadOnly Property StyleNew As CellStyle

[C#]

virtual public CellStyle StyleNew {get;}

[Delphi]

public property StyleNew: CellStyle read get_StyleNew;

Remarks

This property never returns null. If this element does not have a custom style, a new one will be created automatically and returned.

Example

The code below sets a column's background color to red.

// get the style associated with column 1 (create a new one if necessary)

CellStyle cs = _flex.Cols[1].StyleNew.BackColor;

// set the new style's back color to red

cs.BackColor = Color.Red;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.TextAlign Property

RowCol.TextAlign Property

Gets or sets a TextAlignEnum value that determines how text is aligned in scrollable cells on this row or column.

[Visual Basic]

Public Property TextAlign As TextAlignEnum

[C#]

public TextAlignEnum TextAlign {get;set;}

[Delphi]

public property TextAlign: TextAlignEnum read get_TextAlign write set_TextAlign;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.TextAlignFixed Property

RowCol.TextAlignFixed Property

Gets or sets a TextAlignEnum value that determines how text is aligned in fixed cells on this row or column.

[Visual Basic]

Public Property TextAlignFixed As TextAlignEnum

[C#]

public TextAlignEnum TextAlignFixed {get;set;}

[Delphi]

public property TextAlignFixed: TextAlignEnum read get_TextAlignFixed write set_TextAlignFixed;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.UserData Property

RowCol.UserData Property

Gets or sets user data associated with this row or column.

[Visual Basic]

Overridable Public Property UserData As Object

[C#]

virtual public object UserData {get;set;}

[Delphi]

public property UserData: Object read get_UserData write set_UserData;

Remarks

The UserData value is not used internally by the grid. It is reserved for additional data that the application may associate with rows or columns.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.Visible Property

RowCol.Visible Property

Gets or sets whether a Row or Column is visible.

[Visual Basic]

Overridable Public Property Visible As Boolean

[C#]

virtual public bool Visible {get;set;}

[Delphi]

public property Visible: Boolean read get_Visible write set_Visible;

Remarks

This property returns True even if the row or column has been scrolled out of view.

To determine whether a row is currently within view, check the TopRow and BottomRow properties.

To determine whether a column is currently within view, check the LeftCol and RightCol properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol Methods

RowCol Methods

The methods of the RowCol class are listed here. For a complete list of RowCol class members, see the RowCol Members topic.

Public Methods

Clear | Clears the contents of the row or column.
Invalidate | Invalidates an individual row or column, causing it to be repainted.
Move | Moves this row or column to a new position in the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.Clear Method

RowCol.Clear Method

Clears the contents of the row or column.

[Visual Basic]

Overridable Public Sub Clear( _

ByVal clearFlags As ClearFlags _

)

[C#]

virtual public void Clear(

ClearFlags clearFlags

);

[Delphi]

public procedure Clear(

clearFlags: ClearFlags

); virtual;

Parameters

clearFlags

ClearFlags value specifying which elements of the row or column should be cleared.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.Invalidate Method

RowCol.Invalidate Method

Invalidates an individual row or column, causing it to be repainted.

[Visual Basic]

Overridable MustOverride Public Sub Invalidate()

[C#]

virtual abstract public void Invalidate()

[Delphi]

public procedure Invalidate(); virtual; abstract;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCol.Move Method

RowCol.Move Method

Moves this row or column to a new position in the collection.

[Visual Basic]

Overridable Public Sub Move( _

ByVal indexNew As Integer _

)

[C#]

virtual public void Move(

int indexNew

);

[Delphi]

public procedure Move(

indexNew: Int32

); virtual;

Parameters

indexNew

An integer specifying the new position.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection Class

RowColCollection Class

Base class for grid row and column collections ( RowCollection and ColumnCollection classes).

For a list of all members of this type, see RowColCollection Members.

System.Object

C1.Win.C1FlexGrid.RowColCollection

C1.Win.C1FlexGrid.ColumnCollection

C1.Win.C1FlexGrid.RowCollection

[Visual Basic]

MustInherit Public Class RowColCollection

Implements IEnumerable

[C#]

public abstract class RowColCollection : IEnumerable

[Delphi]

type RowColCollection = class abstract (TObject, IEnumerable);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection Members

RowColCollection Members

RowColCollection overview

Public Properties

Count | Gets or sets the number of rows or columns in the collection.
DefaultSize | Gets or sets the default size for the rows or columns in the collection.
Fixed | Gets or sets the number of fixed rows or columns in the collection.
Frozen | Gets or sets the number of frozen rows or columns in the collection.
MaxSize | Gets or sets the maximum size for rows and columns in the collection.
MinSize | Gets or sets the minimum size for rows and columns in the collection.

Public Methods

Contains | Determines whether the collection contains a given row or column.
Move | Moves a row or column to a new position in the collection.
MoveRange | Moves a range of rows or columns to a new position in the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection Properties

RowColCollection Properties

The properties of the RowColCollection class are listed here. For a complete list of RowColCollection class members, see the RowColCollection Members topic.

Public Properties

Count | Gets or sets the number of rows or columns in the collection.
DefaultSize | Gets or sets the default size for the rows or columns in the collection.
Fixed | Gets or sets the number of fixed rows or columns in the collection.
Frozen | Gets or sets the number of frozen rows or columns in the collection.
MaxSize | Gets or sets the maximum size for rows and columns in the collection.
MinSize | Gets or sets the minimum size for rows and columns in the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection.Count Property

RowColCollection.Count Property

Gets or sets the number of rows or columns in the collection.

[Visual Basic]

Overridable Public Property Count As Integer

[C#]

virtual public int Count {get;set;}

[Delphi]

public property Count: Int32 read get_Count write set_Count;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection.DefaultSize Property

RowColCollection.DefaultSize Property

Gets or sets the default size for the rows or columns in the collection.

[Visual Basic]

Public Property DefaultSize As Integer

[C#]

public int DefaultSize {get;set;}

[Delphi]

public property DefaultSize: Int32 read get_DefaultSize write set_DefaultSize;

Remarks

This value is set automatically when the grid's System.Windows.Forms.Control.Font property changes.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection.Fixed Property

RowColCollection.Fixed Property

Gets or sets the number of fixed rows or columns in the collection.

[Visual Basic]

Overridable Public Property Fixed As Integer

[C#]

virtual public int Fixed {get;set;}

[Delphi]

public property Fixed: Int32 read get_Fixed write set_Fixed;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection.Frozen Property

RowColCollection.Frozen Property

Gets or sets the number of frozen rows or columns in the collection.

[Visual Basic]

Overridable Public Property Frozen As Integer

[C#]

virtual public int Frozen {get;set;}

[Delphi]

public property Frozen: Int32 read get_Frozen write set_Frozen;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection.MaxSize Property

RowColCollection.MaxSize Property

Gets or sets the maximum size for rows and columns in the collection.

[Visual Basic]

Public Property MaxSize As Integer

[C#]

public int MaxSize {get;set;}

[Delphi]

public property MaxSize: Int32 read get_MaxSize write set_MaxSize;

Remarks

The MaxSize property limits the maximum size of rows or columns when they are resized by the user or adjusted to fit the contents with the AutoSizeRows (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags) or AutoSizeCols (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags) method.

Setting this property to zero disables it.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection.MinSize Property

RowColCollection.MinSize Property

Gets or sets the minimum size for rows and columns in the collection.

[Visual Basic]

Public Property MinSize As Integer

[C#]

public int MinSize {get;set;}

[Delphi]

public property MinSize: Int32 read get_MinSize write set_MinSize;

Remarks

The MinSize property limits the minimum size of rows or columns when they are resized by the user or adjusted to fit the contents with the AutoSizeRows (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags) or AutoSizeCols (Int32, Int32, Int32, Int32, Int32, AutoSizeFlags) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection Methods

RowColCollection Methods

The methods of the RowColCollection class are listed here. For a complete list of RowColCollection class members, see the RowColCollection Members topic.

Public Methods

Contains | Determines whether the collection contains a given row or column.
Move | Moves a row or column to a new position in the collection.
MoveRange | Moves a range of rows or columns to a new position in the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection.Contains Method

RowColCollection.Contains Method

Determines whether the collection contains a given row or column.

[Visual Basic]

Public Function Contains( _

ByVal item As RowCol _

) As Boolean

[C#]

public bool Contains(

RowCol item

);

[Delphi]

public function Contains(

item: RowCol

): Boolean;

Parameters

item

Row or column items to be detected.

Return Value

True if the row or column is a member of the collection, False otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection.Move Method

RowColCollection.Move Method

Moves a row or column to a new position in the collection.

[Visual Basic]

Overridable Public Sub Move( _

ByVal indexOld As Integer, _

ByVal indexNew As Integer _

)

[C#]

virtual public void Move(

int indexOld,

int indexNew

);

[Delphi]

public procedure Move(

indexOld: Int32;

indexNew: Int32

); virtual;

Parameters

indexOld

Index of row or column to be moved.

indexNew

New position.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColCollection.MoveRange Method

RowColCollection.MoveRange Method

Moves a range of rows or columns to a new position in the collection.

[Visual Basic]

Overridable Public Sub MoveRange( _

ByVal index As Integer, _

ByVal count As Integer, _

ByVal indexNew As Integer _

)

[C#]

virtual public void MoveRange(

int index,

int count,

int indexNew

);

[Delphi]

public procedure MoveRange(

index: Int32;

count: Int32;

indexNew: Int32

); virtual;

Parameters

index

The index of the first row or column in the range to be moved.

count

The number of rows or columns that will be moved.

indexNew

New position.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColEventArgs Class

RowColEventArgs Class

Provides data for the AfterEdit, AfterResizeColumn, AfterResizeRow, BeforeEdit, BeforePageBreak, BeforeResizeColumn, BeforeResizeRow, BeforeScrollTip, CellButtonClick, ComboCloseUp, ComboDropDown, SetupEditor, and StartEdit events.

For a list of all members of this type, see RowColEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.RowColEventArgs

[Visual Basic]

Public Class RowColEventArgs

Inherits EventArgs

[C#]

public class RowColEventArgs : EventArgs

[Delphi]

type RowColEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColEventArgs Members

RowColEventArgs Members

RowColEventArgs overview

Public Constructors

RowColEventArgs Constructor

Initializes a new instance of the RowColEventArgs class.

Public Fields

Cancel | Gets or sets a value indicating whether the operation should be canceled.
Col | Gets the index of the column that caused the event.
Row | Gets the index of the row that caused the event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColEventArgs Constructor

RowColEventArgs Constructor

Initializes a new instance of the RowColEventArgs class.

[Visual Basic]

Public Function New( _

ByVal row As Integer, _

ByVal col As Integer _

)

[C#]

public RowColEventArgs(

int row,

int col

);

[Delphi]

public constructor Create(

row: Int32;

col: Int32

);

Parameters

row

The index of the row that caused the event.

col

The index of the column that caused the event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColEventArgs Fields

RowColEventArgs Fields

The fields of the RowColEventArgs class are listed here. For a complete list of RowColEventArgs class members, see the RowColEventArgs Members topic.

Public Fields

Cancel | Gets or sets a value indicating whether the operation should be canceled.
Col | Gets the index of the column that caused the event.
Row | Gets the index of the row that caused the event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColEventArgs.Cancel Field

RowColEventArgs.Cancel Field

Gets or sets a value indicating whether the operation should be canceled.

[Visual Basic]

Public Cancel As Boolean

[C#]

public bool Cancel

[Delphi]

public Cancel: Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColEventArgs.Col Field

RowColEventArgs.Col Field

Gets the index of the column that caused the event.

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

Remarks

This value may be set to -1 if the event was caused by a row.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColEventArgs.Row Field

RowColEventArgs.Row Field

Gets the index of the row that caused the event.

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

Remarks

This value may be set to -1 if the event was caused by a column.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowColEventHandler Delegate

RowColEventHandler Delegate

Represents the method that will handle the AfterEdit, AfterResizeColumn, AfterResizeRow, BeforeEdit, BeforePageBreak, BeforeResizeColumn, BeforeResizeRow, BeforeScrollTip, CellButtonClick, ComboCloseUp, ComboDropDown, SetupEditor, and StartEdit events.

[Visual Basic]

Public Delegate Sub RowColEventHandler( _

ByVal sender As Object, _

ByVal e As RowColEventArgs _

)

[C#]

public delegate void RowColEventHandler(

object sender,

RowColEventArgs e

);

[Delphi]

type RowColEventHandler = procedure (

sender: Object;

e: RowColEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection Class

RowCollection Class

Collection of grid Row objects.

For a list of all members of this type, see RowCollection Members.

System.Object

C1.Win.C1FlexGrid.RowColCollection

C1.Win.C1FlexGrid.RowCollection

[Visual Basic]

Public Class RowCollection

Inherits RowColCollection

[C#]

public class RowCollection : RowColCollection

[Delphi]

type RowCollection = class (RowColCollection);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection Members

RowCollection Members

RowCollection overview

Public Properties

Count | Overriden. Gets or sets the number of rows in the collection.
DefaultSize (inherited from RowColCollection) | Gets or sets the default size for the rows or columns in the collection.
Fixed | Overriden. Gets or sets the number of fixed rows in the collection.
Frozen (inherited from RowColCollection) | Gets or sets the number of frozen rows or columns in the collection.
Item | Gets the Row at the specified index.
MaxSize (inherited from RowColCollection) | Gets or sets the maximum size for rows and columns in the collection.
MinSize (inherited from RowColCollection) | Gets or sets the minimum size for rows and columns in the collection.
Selected | Gets a collection of Row objects that are currently selected.

Public Methods

Add | Appends a new Row object to the collection.
Insert | Adds a new Row object to the collection at a specified position.
InsertNode | Adds a new Node row to the row collection at a specified position.
InsertRange | Adds a range of rows to the collection at a specified position.
Move | Overriden. Move a Row object to a new position in the collection.
MoveRange | Overriden. Moves a range of rows to a new position in the collection.
Remove | Overloaded. Removes a Row object from the collection.
RemoveRange | Removes a range of rows from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection Properties

RowCollection Properties

The properties of the RowCollection class are listed here. For a complete list of RowCollection class members, see the RowCollection Members topic.

Public Properties

Count | Overriden. Gets or sets the number of rows in the collection.
DefaultSize (inherited from RowColCollection) | Gets or sets the default size for the rows or columns in the collection.
Fixed | Overriden. Gets or sets the number of fixed rows in the collection.
Frozen (inherited from RowColCollection) | Gets or sets the number of frozen rows or columns in the collection.
Item | Gets the Row at the specified index.
MaxSize (inherited from RowColCollection) | Gets or sets the maximum size for rows and columns in the collection.
MinSize (inherited from RowColCollection) | Gets or sets the minimum size for rows and columns in the collection.
Selected | Gets a collection of Row objects that are currently selected.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Count Property

RowCollection.Count Property

Gets or sets the number of rows in the collection.

[Visual Basic]

Overrides Public Property Count As Integer

[C#]

override public int Count {get;set;}

[Delphi]

public property Count: Int32 read get_Count write set_Count;

Remarks

You can add or remove rows by assigning a new value to this property, or you can use the Add, Insert, InsertRange, and Remove (Int32) methods.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Fixed Property

RowCollection.Fixed Property

Gets or sets the number of fixed rows in the collection.

[Visual Basic]

Overrides Public Property Fixed As Integer

[C#]

override public int Fixed {get;set;}

[Delphi]

public property Fixed: Int32 read get_Fixed write set_Fixed;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Item Property

RowCollection.Item Property

Gets the Row at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As Row

[C#]

public Row this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: Row read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Selected Property

RowCollection.Selected Property

Gets a collection of Row objects that are currently selected.

[Visual Basic]

Public ReadOnly Property Selected As RowCollection

[C#]

public RowCollection Selected {get;}

[Delphi]

public property Selected: RowCollection read get_Selected;

Remarks

This property is especially useful when the grid's SelectionMode property is set to SelectionModeEnum.ListBox.

Example

The code below removes all selected rows from the grid.

Note that foreach loops cannot be used to modify the collections being iterated over. This example works because the Selected collection is being enumerated while the Rows collection is being modified.

// delete all selected rows

foreach (Row r in _flex.Rows.Selected)

{

_flex.Rows.Remove(r);

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection Methods

RowCollection Methods

The methods of the RowCollection class are listed here. For a complete list of RowCollection class members, see the RowCollection Members topic.

Public Methods

Add | Appends a new Row object to the collection.
Insert | Adds a new Row object to the collection at a specified position.
InsertNode | Adds a new Node row to the row collection at a specified position.
InsertRange | Adds a range of rows to the collection at a specified position.
Move | Overriden. Move a Row object to a new position in the collection.
MoveRange | Overriden. Moves a range of rows to a new position in the collection.
Remove | Overloaded. Removes a Row object from the collection.
RemoveRange | Removes a range of rows from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Add Method

RowCollection.Add Method

Appends a new Row object to the collection.

[Visual Basic]

Public Function Add() As Row

[C#]

public Row Add()

[Delphi]

public function Add(): Row;

Return Value

A reference to the Row that was added to the collection.

Remarks

The Add method appends a new row to the collection. To insert a row at a specific position, use the Insert method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Insert Method

RowCollection.Insert Method

Adds a new Row object to the collection at a specified position.

[Visual Basic]

Public Function Insert( _

ByVal index As Integer _

) As Row

[C#]

public Row Insert(

int index

);

[Delphi]

public function Insert(

index: Int32

): Row;

Parameters

index

The position where the new row will be inserted.

Return Value

A reference to the Row that was added to the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.InsertNode Method

RowCollection.InsertNode Method

Adds a new Node row to the row collection at a specified position.

[Visual Basic]

Public Function InsertNode( _

ByVal index As Integer, _

ByVal level As Integer _

) As Node

[C#]

public Node InsertNode(

int index,

int level

);

[Delphi]

public function InsertNode(

index: Int32;

level: Int32

): Node;

Parameters

index

The position where the new node row will be inserted.

level

Outline level for the new node row.

Return Value

A reference to the Node that was added to the collection.

Remarks

This method is especially useful when the grid is bound to a data source, because in this case you cannot change the value of the IsNode property. When the grid is unbound, you can add rows and turn them into nodes later using the IsNode property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.InsertRange Method

RowCollection.InsertRange Method

Adds a range of rows to the collection at a specified position.

[Visual Basic]

Public Sub InsertRange( _

ByVal index As Integer, _

ByVal count As Integer _

)

[C#]

public void InsertRange(

int index,

int count

);

[Delphi]

public procedure InsertRange(

index: Int32;

count: Int32

);

Parameters

index

The position where the new range will be inserted.

count

The number of rows to add.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Move Method

RowCollection.Move Method

Move a Row object to a new position in the collection.

[Visual Basic]

Overrides Public Sub Move( _

ByVal indexOld As Integer, _

ByVal indexNew As Integer _

)

[C#]

override public void Move(

int indexOld,

int indexNew

);

[Delphi]

public procedure Move(

indexOld: Int32;

indexNew: Int32

); override;

Parameters

indexOld

Index of row to be moved.

indexNew

New position for the row.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.MoveRange Method

RowCollection.MoveRange Method

Moves a range of rows to a new position in the collection.

[Visual Basic]

Overrides Public Sub MoveRange( _

ByVal index As Integer, _

ByVal count As Integer, _

ByVal indexNew As Integer _

)

[C#]

override public void MoveRange(

int index,

int count,

int indexNew

);

[Delphi]

public procedure MoveRange(

index: Int32;

count: Int32;

indexNew: Int32

); override;

Parameters

index

The index of the first row in the range that will be moved.

count

The number of rows that will be moved.

indexNew

New position for the first row in the range.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Remove Method

RowCollection.Remove Method

Overload List

Removes a Row object from the collection.

[Visual Basic] Overloads Public Function Remove(Integer) As Row

[C#] public Row Remove(int);

[Delphi] public function Remove(Int32) : Row; overload;

Removes a Row object from the collection.

[Visual Basic] Overloads Public Function Remove(Row) As Row

[C#] public Row Remove(Row);

[Delphi] public function Remove(Row) : Row; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Remove Method (Int32)

RowCollection.Remove Method (Int32)

Removes a Row object from the collection.

[Visual Basic]

Overloads Public Function Remove( _

ByVal index As Integer _

) As Row

[C#]

public Row Remove(

int index

);

[Delphi]

public function Remove(

index: Int32

): Row; overload;

Parameters

index

The index of the row to remove from the collection.

Return Value

A reference to the Row that was removed from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.Remove Method (Row)

RowCollection.Remove Method (Row)

Removes a Row object from the collection.

[Visual Basic]

Overloads Public Function Remove( _

ByVal row As Row _

) As Row

[C#]

public Row Remove(

Row row

);

[Delphi]

public function Remove(

row: Row

): Row; overload;

Parameters

row

The row to be removed.

Return Value

A reference to the Row that was removed from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RowCollection.RemoveRange Method

RowCollection.RemoveRange Method

Removes a range of rows from the collection.

[Visual Basic]

Public Sub RemoveRange( _

ByVal index As Integer, _

ByVal count As Integer _

)

[C#]

public void RemoveRange(

int index,

int count

);

[Delphi]

public procedure RemoveRange(

index: Int32;

count: Int32

);

Parameters

index

The index of the first row to remove from the collection.

count

The number of rows to remove from the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SelectionModeEnum Enumeration

SelectionModeEnum Enumeration

Specifies the type of selection provided by the grid.

[Visual Basic]

Public Enum SelectionModeEnum

[C#]

public enum SelectionModeEnum

[Delphi]

type SelectionModeEnum = (Cell, CellRange, Column, ColumnRange, Default, ListBox, Row, RowRange);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Cell | The user can select only a single cell at a time.
CellRange | The user can select continuous blocks of cells using the keyboard and the mouse. Clicking on header cells does not affect the selection.
Column | The user can select a single column at a time.
ColumnRange | The user can select a range of contiguous columns at a time.
Default | The user can select continuous blocks of cells using the keyboard and the mouse. Clicking on header cells selects entire rows and columns.
ListBox | The user can select non-contiguous rows using control-click.
Row | The user can select a single row at a time.
RowRange | The user can select a range of contiguous rows at a time.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ShowButtonsEnum Enumeration

ShowButtonsEnum Enumeration

Specifies when the grid should display combo buttons in cells.

[Visual Basic]

Public Enum ShowButtonsEnum

[C#]

public enum ShowButtonsEnum

[Delphi]

type ShowButtonsEnum = (Always, WhenEditing, WithFocus);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Always | Always show buttons.
WhenEditing | Show buttons only while editing the cell.
WithFocus | Show buttons when the cell has the focus. This is the default setting.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortColEventArgs Class

SortColEventArgs Class

Provides data for the BeforeSort and AfterSort events.

For a list of all members of this type, see SortColEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.SortColEventArgs

[Visual Basic]

Public Class SortColEventArgs

Inherits EventArgs

[C#]

public class SortColEventArgs : EventArgs

[Delphi]

type SortColEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortColEventArgs Members

SortColEventArgs Members

SortColEventArgs overview

Public Constructors

SortColEventArgs Constructor

Initializes a new instance of the SortColEventArgs class.

Public Fields

Cancel | Gets or sets a value indicating whether the drag operation should be canceled.
Col | Gets the column that is being sorted.
Handled | Gets or sets a value indicating whether the drag operation has been handled by the event handler.
Order | Sets or sets a SortFlags value that determines the sorting order.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortColEventArgs Constructor

SortColEventArgs Constructor

Initializes a new instance of the SortColEventArgs class.

[Visual Basic]

Public Function New( _

ByVal col As Integer, _

ByVal order As SortFlags _

)

[C#]

public SortColEventArgs(

int col,

SortFlags order

);

[Delphi]

public constructor Create(

col: Int32;

order: SortFlags

);

Parameters

col

The column that is being sorted.

order

SortFlags value that determines the sorting order.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortColEventArgs Fields

SortColEventArgs Fields

The fields of the SortColEventArgs class are listed here. For a complete list of SortColEventArgs class members, see the SortColEventArgs Members topic.

Public Fields

Cancel | Gets or sets a value indicating whether the drag operation should be canceled.
Col | Gets the column that is being sorted.
Handled | Gets or sets a value indicating whether the drag operation has been handled by the event handler.
Order | Sets or sets a SortFlags value that determines the sorting order.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortColEventArgs.Cancel Field

SortColEventArgs.Cancel Field

Gets or sets a value indicating whether the drag operation should be canceled.

[Visual Basic]

Public Cancel As Boolean

[C#]

public bool Cancel

[Delphi]

public Cancel: Boolean;

Remarks

Setting this parameter to True cancels the built-in sort operation and leaves the sorting glyph unchanged.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortColEventArgs.Col Field

SortColEventArgs.Col Field

Gets the column that is being sorted.

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortColEventArgs.Handled Field

SortColEventArgs.Handled Field

Gets or sets a value indicating whether the drag operation has been handled by the event handler.

[Visual Basic]

Public Handled As Boolean

[C#]

public bool Handled

[Delphi]

public Handled: Boolean;

Remarks

Setting this parameter to True cancels the built-in sort but updates the sorting glyph as if the sort had been performed. This is useful when the event handler performs custom sorting.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortColEventArgs.Order Field

SortColEventArgs.Order Field

Sets or sets a SortFlags value that determines the sorting order.

[Visual Basic]

Public Order As SortFlags

[C#]

public SortFlags Order

[Delphi]

public Order: SortFlags;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortColEventHandler Delegate

SortColEventHandler Delegate

Represents the method that will handle the BeforeSort and AfterSort events.

[Visual Basic]

Public Delegate Sub SortColEventHandler( _

ByVal sender As Object, _

ByVal e As SortColEventArgs _

)

[C#]

public delegate void SortColEventHandler(

object sender,

SortColEventArgs e

);

[Delphi]

type SortColEventHandler = procedure (

sender: Object;

e: SortColEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortFlags Enumeration

SortFlags Enumeration

Specifies how grid columns should be sorted.

[Visual Basic]

Public Enum SortFlags

[C#]

public enum SortFlags

[Delphi]

type SortFlags = (Ascending, AsDisplayed, Descending, IgnoreCase, None, UseColSort);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Remarks

This enumeration contains flags that can be combined to customize the sorting process.

Example

For example, the code below sorts two grid columns ignoring case.

// C#

SortFlags order = SortFlags.Ascending | SortFlags.IgnoreCase;

_flex.Sort(order, col1, col2);

' VB

Dim order As SortFlags = SortFlags.Ascending Or SortFlags.IgnoreCase

_flex.Sort(order, col1, col2)

Members

Member name | Description
Ascending | Sort in ascending order.
AsDisplayed | Sort using the string representation of the data. In this mode, "100" appears before "2".
Descending | Sort in ascending order.
IgnoreCase | Ignore case when sorting strings.
None | Do not sort. This setting is useful for skipping certain columns when sorting column ranges.
UseColSort | Use the flags stored in the Sort property of individual Column objects.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


StyleElementFlags Enumeration

StyleElementFlags Enumeration

Contains flags that specify which style elements are defined in a CellStyle object.

[Visual Basic]

Public Enum StyleElementFlags

[C#]

public enum StyleElementFlags

[Delphi]

type StyleElementFlags = (All, BackColor, Border, ComboList, DataMap, DataType, Display, EditMask, Editor, Font, ForeColor, Format, ImageAlign, ImageMap, ImageSpacing, Margins, None, TextAlign, TextDirection, TextEffect, Trimming, UserData, WordWrap);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Remarks

This enumeration can be used to inspect styles and determine which elements it defines, and it can also be used to clear specific elements from the style.

Any elements not defined in the style are inherited from the parent style.

Members

Member name | Description
All | All style elements.
BackColor | The style defines a background color.
Border | The style defines borders.
ComboList | The style defines a list of choices used to populate drop down editors.
DataMap | The style defines an System.Collections.IDictionary used to associate cell data with display values.
DataType | The style defines the System.Type of values contained in the cells.
Display | The style defines whether to display text and/or images, in the cells.
EditMask | The style defines an edit mask used to constrain values entered in the cells.
Editor | The style defines an external control to be used as an editor for the cells.
Font | The style defines a font.
ForeColor | The style defines a foreground color.
Format | The style defines a format string used to convert data into strings.
ImageAlign | The style defines the image alignment.
ImageMap | The style defines an System.Collections.IDictionary used to associate cell data with images.
ImageSpacing | The style defines the spacing between images and text.
Margins | The style defines margins.
None | No elements are defined.
TextAlign | The style defines the text alignment.
TextDirection | The style defines whether text should be rendered horizontally or vertically.
TextEffect | The style defines a 3D effect for the text.
Trimming | The style defines how long strings are trimmed to fit within cells.
UserData | The style contains arbitrary user data (not used by the control).
WordWrap | The style defines whether long strings are allowed to wrap within cells.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubtotalPositionEnum Enumeration

SubtotalPositionEnum Enumeration

Specifies whether subtotals rows created with the Subtotal (AggregateEnum, Int32, Int32, Int32, Int32, String) method should be inserted above or below the data they refer to.

[Visual Basic]

Public Enum SubtotalPositionEnum

[C#]

public enum SubtotalPositionEnum

[Delphi]

type SubtotalPositionEnum = (AboveData, BelowData);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
AboveData | Subtotal rows are inserted above the data (tree-style).
BelowData | Subtotal rows are inserted below the data (spreadsheet-style).

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextAlignEnum Enumeration

TextAlignEnum Enumeration

Specifies how text is aligned in a grid cell.

[Visual Basic]

Public Enum TextAlignEnum

[C#]

public enum TextAlignEnum

[Delphi]

type TextAlignEnum = (CenterBottom, CenterCenter, CenterTop, GeneralBottom, GeneralCenter, GeneralTop, LeftBottom, LeftCenter, LeftTop, RightBottom, RightCenter, RightTop);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
CenterBottom | Text is horizontally aligned to the center and vertically aligned to the bottom of the cell.
CenterCenter | Text is horizontally aligned to the center and vertically aligned to the center of the cell.
CenterTop | Text is horizontally aligned to the center and vertically aligned to the top of the cell.
GeneralBottom | Numbers are aligned to the right, other values to the left, and vertically aligned to the bottom.
GeneralCenter | Numbers are aligned to the right, other values to the left, and vertically aligned to the center.
GeneralTop | Numbers are aligned to the right, other values to the left, and vertically aligned to the top.
LeftBottom | Text is horizontally aligned to the left and vertically aligned to the bottom of the cell.
LeftCenter | Text is horizontally aligned to the left and vertically aligned to the center of the cell.
LeftTop | Text is horizontally aligned to the left and vertically aligned to the top of the cell.
RightBottom | Text is horizontally aligned to the right and vertically aligned to the bottom of the cell.
RightCenter | Text is horizontally aligned to the right and vertically aligned to the center of the cell.
RightTop | Text is horizontally aligned to the right and vertically aligned to the top of the cell.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextDirectionEnum Enumeration

TextDirectionEnum Enumeration

Specifies the direction to use when rendering text in a grid cell.

[Visual Basic]

Public Enum TextDirectionEnum

[C#]

public enum TextDirectionEnum

[Delphi]

type TextDirectionEnum = (Down, Normal, Up);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Down | Text is rendered from the top of the cell to the bottom.
Normal | Text is rendered in the horizontal direction.
Up | Text is rendered from the bottom of the cell to the top.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextEffectEnum Enumeration

TextEffectEnum Enumeration

Specifies a 3D effect to use when rendering cell text.

[Visual Basic]

Public Enum TextEffectEnum

[C#]

public enum TextEffectEnum

[Delphi]

type TextEffectEnum = (Flat, Inset, Raised);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Flat | No 3D effect.
Inset | Text is drawn with a shadow offset by one pixel to the left and above the text.
Raised | Text is drawn with a shadow offset by one pixel to the right and below the text.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TreeStyleFlags Enumeration

TreeStyleFlags Enumeration

Specifies the appearance of the outline tree.

[Visual Basic]

Public Enum TreeStyleFlags

[C#]

public enum TreeStyleFlags

[Delphi]

type TreeStyleFlags = (ButtonBar, Complete, CompleteLeaf, Leaf, Lines, None, Simple, SimpleLeaf, Symbols);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
ButtonBar | Show outline buttons across the top fixed row.
Complete | Combination of TreeStyleFlags.Lines, TreeStyleFlags.Symbols, and TreeStyleFlags.ButtonBar.
CompleteLeaf | Combination of TreeStyleFlags.Lines, TreeStyleFlags.Symbols, TreeStyleFlags.ButtonBar and TreeStyleFlags.Leaf.
Leaf | Show tree lines next to all rows (nodes and data).
Lines | Show tree lines next to node rows.
None | Do not show the outline tree.
Simple | Combination of TreeStyleFlags.Lines and TreeStyleFlags.Symbols.
SimpleLeaf | Combination of TreeStyleFlags.Lines, TreeStyleFlags.Symbols, and TreeStyleFlags.Leaf.
Symbols | Show expand/collapse symbols on node rows.

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


UnboundValueEventArgs Class

UnboundValueEventArgs Class

Provides data for the GetUnboundValue and SetUnboundValue events.

For a list of all members of this type, see UnboundValueEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.UnboundValueEventArgs

[Visual Basic]

Public Class UnboundValueEventArgs

Inherits EventArgs

[C#]

public class UnboundValueEventArgs : EventArgs

[Delphi]

type UnboundValueEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


UnboundValueEventArgs Members

UnboundValueEventArgs Members

UnboundValueEventArgs overview

Public Constructors

UnboundValueEventArgs Constructor

Initializes a new instance of the UnboundValueEventArgs class.

Public Fields

Col | Gets the column index for the cell that has an unbound value.
Row | Gets the row index for the cell that has an unbound value.
Value | Gets or sets the unbound value that should be displayed in the cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


UnboundValueEventArgs Constructor

UnboundValueEventArgs Constructor

Initializes a new instance of the UnboundValueEventArgs class.

[Visual Basic]

Public Function New( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal value As Object _

)

[C#]

public UnboundValueEventArgs(

int row,

int col,

object value

);

[Delphi]

public constructor Create(

row: Int32;

col: Int32;

value: Object

);

Parameters

row

Row index for the cell that has an unbound value.

col

Column index for the cell that has an unbound value.

value

Unbound value that should be displayed in the cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


UnboundValueEventArgs Fields

UnboundValueEventArgs Fields

The fields of the UnboundValueEventArgs class are listed here. For a complete list of UnboundValueEventArgs class members, see the UnboundValueEventArgs Members topic.

Public Fields

Col | Gets the column index for the cell that has an unbound value.
Row | Gets the row index for the cell that has an unbound value.
Value | Gets or sets the unbound value that should be displayed in the cell.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


UnboundValueEventArgs.Col Field

UnboundValueEventArgs.Col Field

Gets the column index for the cell that has an unbound value.

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


UnboundValueEventArgs.Row Field

UnboundValueEventArgs.Row Field

Gets the row index for the cell that has an unbound value.

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


UnboundValueEventArgs.Value Field

UnboundValueEventArgs.Value Field

Gets or sets the unbound value that should be displayed in the cell.

[Visual Basic]

Public Value As Object

[C#]

public object Value

[Delphi]

public Value: Object;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


UnboundValueEventHandler Delegate

UnboundValueEventHandler Delegate

Represents the method that will handle the GetUnboundValue and SetUnboundValue events.

[Visual Basic]

Public Delegate Sub UnboundValueEventHandler( _

ByVal sender As Object, _

ByVal e As UnboundValueEventArgs _

)

[C#]

public delegate void UnboundValueEventHandler(

object sender,

UnboundValueEventArgs e

);

[Delphi]

type UnboundValueEventHandler = procedure (

sender: Object;

e: UnboundValueEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ValidateEditEventArgs Class

ValidateEditEventArgs Class

Provides data for the ValidateEdit event.

For a list of all members of this type, see ValidateEditEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1FlexGrid.ValidateEditEventArgs

[Visual Basic]

Public Class ValidateEditEventArgs

Inherits EventArgs

[C#]

public class ValidateEditEventArgs : EventArgs

[Delphi]

type ValidateEditEventArgs = class (EventArgs);

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ValidateEditEventArgs Members

ValidateEditEventArgs Members

ValidateEditEventArgs overview

Public Constructors

ValidateEditEventArgs Constructor

Initializes a new instance of the ValidateEditEventArgs class.

Public Fields

Cancel | Gets or sets a value indicating whether the edit operation should be canceled.
Checkbox | If the cell contains a checkbox, the new checkbox state about to be applied to the cell.
Col | Gets the column index of the cell being edited.
Row | Gets the row index of the cell being edited.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ValidateEditEventArgs Constructor

ValidateEditEventArgs Constructor

Initializes a new instance of the ValidateEditEventArgs class.

[Visual Basic]

Public Function New( _

ByVal row As Integer, _

ByVal col As Integer, _

ByVal check As CheckEnum _

)

[C#]

public ValidateEditEventArgs(

int row,

int col,

CheckEnum check

);

[Delphi]

public constructor Create(

row: Int32;

col: Int32;

check: CheckEnum

);

Parameters

row

The row index of the cell being edited.

col

The column index of the cell being edited.

check

The new checkbox state about to be applied to the cell, if any.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ValidateEditEventArgs Fields

ValidateEditEventArgs Fields

The fields of the ValidateEditEventArgs class are listed here. For a complete list of ValidateEditEventArgs class members, see the ValidateEditEventArgs Members topic.

Public Fields

Cancel | Gets or sets a value indicating whether the edit operation should be canceled.
Checkbox | If the cell contains a checkbox, the new checkbox state about to be applied to the cell.
Col | Gets the column index of the cell being edited.
Row | Gets the row index of the cell being edited.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ValidateEditEventArgs.Cancel Field

ValidateEditEventArgs.Cancel Field

Gets or sets a value indicating whether the edit operation should be canceled.

[Visual Basic]

Public Cancel As Boolean

[C#]

public bool Cancel

[Delphi]

public Cancel: Boolean;

Remarks

If this parameter is set to True, the edits are considered invalid. The editor will remain open and the current cell selected until the user provides a valid entry or cancels the edit operation by pressing the ESC key.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ValidateEditEventArgs.Checkbox Field

ValidateEditEventArgs.Checkbox Field

If the cell contains a checkbox, the new checkbox state about to be applied to the cell.

[Visual Basic]

Public ReadOnly Checkbox As CheckEnum

[C#]

public readonly CheckEnum Checkbox

[Delphi]

public Checkbox: CheckEnum;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ValidateEditEventArgs.Col Field

ValidateEditEventArgs.Col Field

Gets the column index of the cell being edited.

[Visual Basic]

Public ReadOnly Col As Integer

[C#]

public readonly int Col

[Delphi]

public Col: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ValidateEditEventArgs.Row Field

ValidateEditEventArgs.Row Field

Gets the row index of the cell being edited.

[Visual Basic]

Public ReadOnly Row As Integer

[C#]

public readonly int Row

[Delphi]

public Row: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ValidateEditEventHandler Delegate

ValidateEditEventHandler Delegate

Represents the method that will handle the ValidateEdit event.

[Visual Basic]

Public Delegate Sub ValidateEditEventHandler( _

ByVal sender As Object, _

ByVal e As ValidateEditEventArgs _

)

[C#]

public delegate void ValidateEditEventHandler(

object sender,

ValidateEditEventArgs e

);

[Delphi]

type ValidateEditEventHandler = procedure (

sender: Object;

e: ValidateEditEventArgs

) of object;

Namespace: C1.Win.C1FlexGrid

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid.Util.BaseControls Namespace

C1.Win.C1FlexGrid.Util.BaseControls Namespace

C1.Win.C1FlexGrid.Util.BaseControls Hierarchy

Classes

Class | Description
ScrollableControl | Base class for controls that support auto-scrolling behavior.

Enumerations

Enumeration | Description
BorderStyleEnum | Specifies the type of border to be drawn around the control.

See Also

C1.Win.C1FlexGrid Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum Enumeration

C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum Enumeration

Specifies the type of border to be drawn around the control.

[Visual Basic]

Public Enum C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum

[C#]

public enum C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum

[Delphi]

type C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum = (Fixed3D, FixedSingle, Light3D, None, XpThemes);

Namespace: C1.Win.C1FlexGrid.Util.BaseControls

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

Members

Member name | Description
Fixed3D | A three-dimensional border.
FixedSingle | A single-line border.
Light3D | A light sunken border.
None | No border.
XpThemes | A border drawn using XP themes.

See Also

C1.Win.C1FlexGrid.Util.BaseControls Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl Class

ScrollableControl Class

Base class for controls that support auto-scrolling behavior.

For a list of all members of this type, see ScrollableControl Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

System.Windows.Forms.Control

C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl

C1.Win.C1FlexGrid.C1FlexGridBase

[Visual Basic]

MustInherit Public Class ScrollableControl

Inherits Control

[C#]

public abstract class ScrollableControl : Control

[Delphi]

type ScrollableControl = class abstract (Control);

Remarks

This class is similar to System.Windows.Forms.ScrollableControl, but provides extra customization, better scroll notification, and support for scroll tracking and Windows XP themes.

Namespace: C1.Win.C1FlexGrid.Util.BaseControls

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl Members

ScrollableControl Members

ScrollableControl overview

Public Properties

AccessibilityObject (inherited from Control) | The accessibility object for this control.
AccessibleDefaultActionDescription (inherited from Control) | The default action description of the control.
AccessibleDescription (inherited from Control) | The description that will be reported to accessibility clients.
AccessibleName (inherited from Control) | The name that will be reported to accessibility clients.
AccessibleRole (inherited from Control) | The role that will be reported to accessibility clients.
AllowDrop (inherited from Control) | Determines if the control will receive drag-drop notifications.
Anchor (inherited from Control) | The anchor of the control. Anchors define to which edges of the container a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant.
BackColor (inherited from Control) | The background color used to display text and graphics in the control.
BackgroundImage (inherited from Control) | The background image used for the control.
BindingContext (inherited from Control) | The binding manager for this container.
BorderStyle | Gets or sets the type of border around the control.
Bottom (inherited from Control) | The bottom of the control, in container coordinates.
Bounds (inherited from Control) | The bounds of the control, in container coordinates.
CanFocus (inherited from Control) | Checks if this control can receive the focus.
CanSelect (inherited from Control) | Checks if this control can be selected.
Capture (inherited from Control) | Determines if this control is currently capturing all mouse input.
CausesValidation (inherited from Control) | Indicates whether this control causes and raises validation events.
ClientRectangle (inherited from Control) | Retrieves the rectangle of the inner area of this control.
ClientSize (inherited from Control) | Determines the size of the inner area of this control.
CompanyName (inherited from Control) | ControlCompanyNameDescr
ContainsFocus (inherited from Control) | Determines if this control or one if its children currently has the focus.
ContextMenu (inherited from Control) | The shortcut menu to display when the user right-clicks the control.
Controls (inherited from Control) | The collection of child controls within this control.
Created (inherited from Control) | Determines if the control has been fully created.
Cursor | Overriden. Gets or sets the cursor that appears when the mouse moves over the control.
DataBindings (inherited from Control) | This collection holds all the bindings of properties of this control to data sources.
DisplayRectangle (inherited from Control) | Retrieves the display rectangle of this control.
Disposing (inherited from Control) | Determines if this control is in the process of being disposed.
Dock (inherited from Control) | The docking location of the control, indicating which borders are docked to the container.
Enabled (inherited from Control) | Indicates whether the control is enabled.
Focused (inherited from Control) | Determines if this control has focus.
Font (inherited from Control) | The font used to display text in the control.
ForeColor (inherited from Control) | The foreground color used to display text and graphics in the control.
Handle (inherited from Control) | The native handle for this control.
HasChildren (inherited from Control) | True if this control has child controls in its collection.
Height (inherited from Control) | The height of the control, in container coordinates.
ImeMode (inherited from Control) | Determines the IME (Input Method Editor) status of the object when selected.
InvokeRequired (inherited from Control) | Determines if Invoke or InvokeAsync should be used to access this control cross-thread.
IsAccessible (inherited from Control) | Determines if this control supports Accessibility.
IsDisposed (inherited from Control) | Determines if this control has been disposed.
IsHandleCreated (inherited from Control) | Determines if the native handle has been created for this control.
Left (inherited from Control) | The upper left of the control, in container coordinates.
Location (inherited from Control) | The position of the top-left corner of the control with respect to its container.
Parent (inherited from Control) | The parent of this control.
ProductName (inherited from Control) | Retrieves the name of the product associated with this component.
ProductVersion (inherited from Control) | Retrieves the version of the product associated with this component.
RecreatingHandle (inherited from Control) | Determines if this control is in the process of recreating its handle.
Region (inherited from Control) | The region, or shape, of this control.
Right (inherited from Control) | The upper right of the control, in container coordinates.
RightToLeft (inherited from Control) | Indicates whether the control should draw right-to-left for RTL languages.
ScrollableRectangle | Gets a rectangle that defines the scrollable portion of the control.
ScrollBars | Gets or sets which scroll bars should appear on the control.
ScrollPosition | Gets or sets the location of the auto-scroll position.
ScrollTips | Gets or sets whether the control should display tooltips as the user scrolls vertically.
ScrollTipText | Gets or sets the tooltip text displayed as the user scrolls vertically.
ScrollTrack | Gets or sets whether the control should scroll as the user drags the scrollbar thumb.
Size (inherited from Control) | The size of the control in pixels.
TabIndex (inherited from Control) | Determines the index in the TAB order that this control will occupy.
TabStop (inherited from Control) | Indicates whether the user can use the TAB key to give focus to the control.
Tag (inherited from Control) | User defined data associated with the control.
Text (inherited from Control) | The text contained in the control.
Top (inherited from Control) | The top of the control, in container coordinates.
TopLevelControl (inherited from Control) | Retrieves the top level control that contains this control.
Visible (inherited from Control) | Determines whether the control is visible or hidden.
Width (inherited from Control) | The width of the control, in container coordinates.

Public Events

BackColorChanged (inherited from Control) | Event fired when the value of BackColor property is changed on Control
BackgroundImageChanged (inherited from Control) | Event fired when the value of BackgroundImage property is changed on Control
BindingContextChanged (inherited from Control) | Event fired when the value of BindingContext property is changed on Control
CausesValidationChanged (inherited from Control) | Event fired when the value of CausesValidation property is changed on Control
ChangeUICues (inherited from Control) | Occurs when focus rectangles and keyboard cue underlines are being shown or hidden.
Click (inherited from Control) | Occurs when the control is clicked.
ContextMenuChanged (inherited from Control) | Event fired when the value of ContextMenu property is changed on Control
ControlAdded (inherited from Control) | Occurs when a control is added to this control.
ControlRemoved (inherited from Control) | Occurs when a control is removed from this control.
CursorChanged (inherited from Control) | Event fired when the value of Cursor property is changed on Control
DockChanged (inherited from Control) | Event fired when the value of Dock property is changed on Control
DoubleClick (inherited from Control) | Occurs when the control is double-clicked.
DragDrop (inherited from Control) | Occurs when the mouse drags an item and the user releases the mouse indicating that the item should be 'dropped' into this Control.
DragEnter (inherited from Control) | Occurs when the mouse drags an item into the client area for this Control.
DragLeave (inherited from Control) | Occurs when the mouse drags an item and is no longer over the client area for this Control.
DragOver (inherited from Control) | Occurs when the mouse drags an item and is moving over the client area of this Control.
EnabledChanged (inherited from Control) | Occurs when the control's enabled state changes.
Enter (inherited from Control) | Occurs when the control becomes the active control of the form.
FontChanged (inherited from Control) | Event fired when the value of Font property is changed on Control
ForeColorChanged (inherited from Control) | Event fired when the value of ForeColor property is changed on Control
GiveFeedback (inherited from Control) | Occurs when the mouse drags an item. The system requests that the Control provide feedback to that effect.
GotFocus (inherited from Control) | Occurs when the control gets focus.
HandleCreated (inherited from Control) | Occurs when the control's native handle is created.
HandleDestroyed (inherited from Control) | Occurs when the control's native handle is destroyed.
HelpRequested (inherited from Control) | Occurs when the user invokes help for the control.
ImeModeChanged (inherited from Control) | Occurs when the control's IME mode changes
Invalidated (inherited from Control) | Occurs when one of the invalidate methods is called.
KeyDown (inherited from Control) | Occurs when a key is first pressed.
KeyPress (inherited from Control) | Occurs after the user is finished pressing a key.
KeyUp (inherited from Control) | Occurs when a key is released.
Layout (inherited from Control) | Occurs when the control is about to lay out its contents.
Leave (inherited from Control) | Occurs when the control is no longer the active control of the form.
LocationChanged (inherited from Control) | Event fired when the value of Location property is changed on Control
LostFocus (inherited from Control) | Occurs when the control gets focus.
MouseDown (inherited from Control) | Occurs when a mouse button is pressed.
MouseEnter (inherited from Control) | Occurs when the mouse enters the visible part of the control.
MouseHover (inherited from Control) | Occurs when the mouse remains stationary inside of the control for an amount of time.
MouseLeave (inherited from Control) | Occurs when the mouse leaves the visible part of the control.
MouseMove (inherited from Control) | Occurs when the mouse is moved.
MouseUp (inherited from Control) | Occurs when a mouse button is released.
MouseWheel (inherited from Control) | Occurs when the mouse wheel is rolled.
Move (inherited from Control) | Occurs when a control is moved.
Paint (inherited from Control) | Occurs when a control needs repainting.
ParentChanged (inherited from Control) | Event fired when the value of Parent property is changed on Control
QueryAccessibilityHelp (inherited from Control) | Occurs when an Accessibility client invokes help for the control.
QueryContinueDrag (inherited from Control) | Occurs when the mouse drags an item. The system requests whether the drag and drop operation should be allowed to continue.
Resize (inherited from Control) | Occurs when a control is resized.
RightToLeftChanged (inherited from Control) | Event fired when the value of RightToLeft property is changed on Control
SizeChanged (inherited from Control) | Event fired when the value of Size property is changed on Control
StyleChanged (inherited from Control) | Event fired when the window style of a Control is changed
SystemColorsChanged (inherited from Control) | Event fired when the system colors change
TabIndexChanged (inherited from Control) | Event fired when the value of TabIndex property is changed on Control
TabStopChanged (inherited from Control) | Event fired when the value of TabStop property is changed on Control
TextChanged (inherited from Control) | Event fired when the value of Text property is changed on Control
Validated (inherited from Control) | Occurs after a control has been successfully validated.
Validating (inherited from Control) | Occurs when a control is being validated. Set to True the Cancel property on the event parameter to cancel the validation.
VisibleChanged (inherited from Control) | Occurs when the control's visibility changes.

Protected Constructors

ScrollableControl Constructor

Creates a new instance of a ScrollableControl class.

Protected Properties

ResizeRedraw (inherited from Control)

Indicates whether the control should redraw itself when resized.

Protected Methods

BuildScrollableRectangle | Builds a rectangle that defines the scrollable portion of the control for a given pair of scroll offsets.
Dispose | Overloaded. Overriden. Releases all resources used by the Control.
OnImeStartComposition | Called when the control receives a WM_IME_STARTCOMPOSITION message.
OnMouseWheel | Overriden. Raises the System.Windows.Forms.Control.MouseWheel event.
OnPaint | Overriden. Raises the System.Windows.Forms.Control.Paint event.
OnScroll | Called after the control scrolls (see the ScrollPosition property).
OnScrollTip | Called before the controls displays a scroll tip (see the ScrollTips property).
OnSizeChanged | Overriden. Raises the System.Windows.Forms.Control.SizeChanged event.
OnThemeChanged | Called when the control receives a WM_THEMECHANGED message.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl Constructor

ScrollableControl Constructor

Creates a new instance of a ScrollableControl class.

[Visual Basic]

Protected Function New()

[C#]

protected ScrollableControl()

[Delphi]

strict protected constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl Properties

ScrollableControl Properties

The properties of the ScrollableControl class are listed here. For a complete list of ScrollableControl class members, see the ScrollableControl Members topic.

Public Properties

AccessibilityObject (inherited from Control) | The accessibility object for this control.
AccessibleDefaultActionDescription (inherited from Control) | The default action description of the control.
AccessibleDescription (inherited from Control) | The description that will be reported to accessibility clients.
AccessibleName (inherited from Control) | The name that will be reported to accessibility clients.
AccessibleRole (inherited from Control) | The role that will be reported to accessibility clients.
AllowDrop (inherited from Control) | Determines if the control will receive drag-drop notifications.
Anchor (inherited from Control) | The anchor of the control. Anchors define to which edges of the container a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant.
BackColor (inherited from Control) | The background color used to display text and graphics in the control.
BackgroundImage (inherited from Control) | The background image used for the control.
BindingContext (inherited from Control) | The binding manager for this container.
BorderStyle | Gets or sets the type of border around the control.
Bottom (inherited from Control) | The bottom of the control, in container coordinates.
Bounds (inherited from Control) | The bounds of the control, in container coordinates.
CanFocus (inherited from Control) | Checks if this control can receive the focus.
CanSelect (inherited from Control) | Checks if this control can be selected.
Capture (inherited from Control) | Determines if this control is currently capturing all mouse input.
CausesValidation (inherited from Control) | Indicates whether this control causes and raises validation events.
ClientRectangle (inherited from Control) | Retrieves the rectangle of the inner area of this control.
ClientSize (inherited from Control) | Determines the size of the inner area of this control.
CompanyName (inherited from Control) | ControlCompanyNameDescr
ContainsFocus (inherited from Control) | Determines if this control or one if its children currently has the focus.
ContextMenu (inherited from Control) | The shortcut menu to display when the user right-clicks the control.
Controls (inherited from Control) | The collection of child controls within this control.
Created (inherited from Control) | Determines if the control has been fully created.
Cursor | Overriden. Gets or sets the cursor that appears when the mouse moves over the control.
DataBindings (inherited from Control) | This collection holds all the bindings of properties of this control to data sources.
DisplayRectangle (inherited from Control) | Retrieves the display rectangle of this control.
Disposing (inherited from Control) | Determines if this control is in the process of being disposed.
Dock (inherited from Control) | The docking location of the control, indicating which borders are docked to the container.
Enabled (inherited from Control) | Indicates whether the control is enabled.
Focused (inherited from Control) | Determines if this control has focus.
Font (inherited from Control) | The font used to display text in the control.
ForeColor (inherited from Control) | The foreground color used to display text and graphics in the control.
Handle (inherited from Control) | The native handle for this control.
HasChildren (inherited from Control) | True if this control has child controls in its collection.
Height (inherited from Control) | The height of the control, in container coordinates.
ImeMode (inherited from Control) | Determines the IME (Input Method Editor) status of the object when selected.
InvokeRequired (inherited from Control) | Determines if Invoke or InvokeAsync should be used to access this control cross-thread.
IsAccessible (inherited from Control) | Determines if this control supports Accessibility.
IsDisposed (inherited from Control) | Determines if this control has been disposed.
IsHandleCreated (inherited from Control) | Determines if the native handle has been created for this control.
Left (inherited from Control) | The upper left of the control, in container coordinates.
Location (inherited from Control) | The position of the top-left corner of the control with respect to its container.
Parent (inherited from Control) | The parent of this control.
ProductName (inherited from Control) | Retrieves the name of the product associated with this component.
ProductVersion (inherited from Control) | Retrieves the version of the product associated with this component.
RecreatingHandle (inherited from Control) | Determines if this control is in the process of recreating its handle.
Region (inherited from Control) | The region, or shape, of this control.
Right (inherited from Control) | The upper right of the control, in container coordinates.
RightToLeft (inherited from Control) | Indicates whether the control should draw right-to-left for RTL languages.
ScrollableRectangle | Gets a rectangle that defines the scrollable portion of the control.
ScrollBars | Gets or sets which scroll bars should appear on the control.
ScrollPosition | Gets or sets the location of the auto-scroll position.
ScrollTips | Gets or sets whether the control should display tooltips as the user scrolls vertically.
ScrollTipText | Gets or sets the tooltip text displayed as the user scrolls vertically.
ScrollTrack | Gets or sets whether the control should scroll as the user drags the scrollbar thumb.
Size (inherited from Control) | The size of the control in pixels.
TabIndex (inherited from Control) | Determines the index in the TAB order that this control will occupy.
TabStop (inherited from Control) | Indicates whether the user can use the TAB key to give focus to the control.
Tag (inherited from Control) | User defined data associated with the control.
Text (inherited from Control) | The text contained in the control.
Top (inherited from Control) | The top of the control, in container coordinates.
TopLevelControl (inherited from Control) | Retrieves the top level control that contains this control.
Visible (inherited from Control) | Determines whether the control is visible or hidden.
Width (inherited from Control) | The width of the control, in container coordinates.

Protected Properties

ResizeRedraw (inherited from Control)

Indicates whether the control should redraw itself when resized.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.BorderStyle Property

ScrollableControl.BorderStyle Property

Gets or sets the type of border around the control.

[Visual Basic]

Public Property BorderStyle As BorderStyleEnum

[C#]

public BorderStyleEnum BorderStyle {get;set;}

[Delphi]

public property BorderStyle: BorderStyleEnum read get_BorderStyle write set_BorderStyle;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.Cursor Property

ScrollableControl.Cursor Property

Gets or sets the cursor that appears when the mouse moves over the control.

[Visual Basic]

Overrides Public Property Cursor As Cursor

[C#]

override public Cursor Cursor {get;set;}

[Delphi]

public property Cursor: Cursor read get_Cursor write set_Cursor;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.ScrollableRectangle Property

ScrollableControl.ScrollableRectangle Property

Gets a rectangle that defines the scrollable portion of the control.

[Visual Basic]

Overridable Public ReadOnly Property ScrollableRectangle As Rectangle

[C#]

virtual public Rectangle ScrollableRectangle {get;}

[Delphi]

public property ScrollableRectangle: Rectangle read get_ScrollableRectangle;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.ScrollBars Property

ScrollableControl.ScrollBars Property

Gets or sets which scroll bars should appear on the control.

[Visual Basic]

Public Property ScrollBars As ScrollBars

[C#]

public ScrollBars ScrollBars {get;set;}

[Delphi]

public property ScrollBars: ScrollBars read get_ScrollBars write set_ScrollBars;

Remarks

Scroll bars are displayed only if the contents of the control extend beyond its client area. For example, if ScrollBars is set to ScrollBars, a horizontal scroll bar is displayed only if the control is not wide enough to display all columns at once.

Even when it has no scrollbars, the control will still scroll to keep the selection visible. If you want to prevent scrolling, handle the BeforeScroll event and set its Cancel parameter to True.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.ScrollPosition Property

ScrollableControl.ScrollPosition Property

Gets or sets the location of the auto-scroll position.

[Visual Basic]

Public Property ScrollPosition As Point

[C#]

public Point ScrollPosition {get;set;}

[Delphi]

public property ScrollPosition: Point read get_ScrollPosition write set_ScrollPosition;

Remarks

Use the ScrollPosition property to get or set the scroll position using pixel coordinates.

Use the TopRow and LeftCol properties to get or set the scroll position using cell coordinates.

Example

This code binds two grids (_flexLeft and _flexRight) together and synchronizes their scrolling in the vertical direction (the user can scroll the grids independently in the horizontal direction).

// bind grids together

_flexRight.DataSource = _flexLeft;

_flexLeft.ScrollBars = ScrollBars.Horizontal;

// syncronize vertical scrolling

// (this handles the AfterScroll event for both grids)

private void flex_AfterScroll(object sender, C1.Win.C1FlexGrid.RangeEventArgs e)

{

// update sender grid (could be _flexLeft or _flexRight)

C1FlexGrid.C1FlexGrid src = ((C1FlexGrid)sender);

src.Update();

// get new vertical position from sender grid

int y = src.ScrollPosition.Y;

// apply new vertical position to the other grid

if (src.Equals == _flexLeft)

{

_flexRight.ScrollPosition = new Point(_flexRight.ScrollPosition.X, y);

}

else

{

_flexLeft.ScrollPosition = new Point(_flexLeft.ScrollPosition.X, y);

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.ScrollTips Property

ScrollableControl.ScrollTips Property

Gets or sets whether the control should display tooltips as the user scrolls vertically.

[Visual Basic]

Public Property ScrollTips As Boolean

[C#]

public bool ScrollTips {get;set;}

[Delphi]

public property ScrollTips: Boolean read get_ScrollTips write set_ScrollTips;

Remarks

Use the ScrollTips property to display a tooltip over the vertical scrollbar as the user moves the scroll thumb. This allows the user to see which row will become visible when he releases the scroll thumb. This feature makes it easy for users to browse and find specific rows on large data sets. This is especially useful if the ScrollTrack property is set to False, because then the control will not scroll until the thumb track is released.

To implement this feature in your programs, you must do two things:

1) Set the ScrollTips property to True.

2) Respond to the BeforeScrollTip event by setting the ScrollTipText property to text that describes the given row.

Example

The code below causes the grid to display scroll tip containing the index and data on the row that will become the topmost visible row when the user releases the scrollbar thumb.

_flex.ScrollTips = true;

_flex.ScrollTrack = false;

private void _flex_BeforeScrollTip(object sender, RowColEventArgs e)

{

string tip = string.Format("Row {0}\n{1}", e.Row, flex[e.Row,1]);

_flex.ScrollTipText = tip;

}

Scrolltips are a special type of tooltip that is attached to the vertical scrollbar. To display general tooltips (associated with grid cells, for example) use a System.Windows.Forms.ToolTip control. For example:

private ToolTip ttip = new ToolTip(this.components);

private void _flex_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)

{

string str = string.Format("This is cell {0}, {1}",

flex.MouseRow, flex.MouseCol);

if (str != ttip.GetToolTip(flex))

ttip.SetToolTip(flex, str);

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.ScrollTipText Property

ScrollableControl.ScrollTipText Property

Gets or sets the tooltip text displayed as the user scrolls vertically.

[Visual Basic]

Public Property ScrollTipText As String

[C#]

public string ScrollTipText {get;set;}

[Delphi]

public property ScrollTipText: String read get_ScrollTipText write set_ScrollTipText;

Remarks

Set this property in response to the BeforeScrollTip event to display information describing a given row as the user scrolls the contents of the control.

For more details and examples, see the ScrollTips property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.ScrollTrack Property

ScrollableControl.ScrollTrack Property

Gets or sets whether the control should scroll as the user drags the scrollbar thumb.

[Visual Basic]

Public Property ScrollTrack As Boolean

[C#]

public bool ScrollTrack {get;set;}

[Delphi]

public property ScrollTrack: Boolean read get_ScrollTrack write set_ScrollTrack;

Remarks

If ScrollTrack is set to True (the default value), the grid scrolls while the user drags the scrollbar thumb.

If ScrollTrack is set to False, the grid does not update the display until the user releases the scrollbar thumb.

If the grid is very large and contains a lot of data, you may want to make scrolling faster by setting ScrollTrack to False. In this case, consider using the ScrollTips property to provide feed-back while the user scrolls the grid.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl Methods

ScrollableControl Methods

The methods of the ScrollableControl class are listed here. For a complete list of ScrollableControl class members, see the ScrollableControl Members topic.

Protected Methods

BuildScrollableRectangle | Builds a rectangle that defines the scrollable portion of the control for a given pair of scroll offsets.
Dispose | Overloaded. Overriden. Releases all resources used by the Control.
OnImeStartComposition | Called when the control receives a WM_IME_STARTCOMPOSITION message.
OnMouseWheel | Overriden. Raises the System.Windows.Forms.Control.MouseWheel event.
OnPaint | Overriden. Raises the System.Windows.Forms.Control.Paint event.
OnScroll | Called after the control scrolls (see the ScrollPosition property).
OnScrollTip | Called before the controls displays a scroll tip (see the ScrollTips property).
OnSizeChanged | Overriden. Raises the System.Windows.Forms.Control.SizeChanged event.
OnThemeChanged | Called when the control receives a WM_THEMECHANGED message.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.BuildScrollableRectangle Method

ScrollableControl.BuildScrollableRectangle Method

Builds a rectangle that defines the scrollable portion of the control for a given pair of scroll offsets.

[Visual Basic]

Overridable Protected Function BuildScrollableRectangle( _

ByVal dx As Integer, _

ByVal dy As Integer _

) As Rectangle

[C#]

virtual protected Rectangle BuildScrollableRectangle(

int dx,

int dy

);

[Delphi]

strict protected function BuildScrollableRectangle(

dx: Int32;

dy: Int32

): Rectangle; virtual;

Parameters

dx

Horizontal scroll offset.

dy

Vertical scroll offset.

Return Value

A System.Drawing.Rectangle that defines the scrollable portion of the control.

Remarks

This method is for internal use. It allows derived classes to customize the control scrolling behavior.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.Dispose Method

ScrollableControl.Dispose Method

Releases all resources used by the Control.

[Visual Basic]

Overrides Protected Sub Dispose( _

ByVal disposing As Boolean _

)

[C#]

override protected void Dispose(

bool disposing

);

[Delphi]

strict protected procedure Dispose(

disposing: Boolean

); overload; override;

Parameters

disposing

True to release both managed and unmanaged resources, False to release only unmanaged resources.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.OnImeStartComposition Method

ScrollableControl.OnImeStartComposition Method

Called when the control receives a WM_IME_STARTCOMPOSITION message.

[Visual Basic]

Overridable Protected Sub OnImeStartComposition()

[C#]

virtual protected void OnImeStartComposition()

[Delphi]

strict protected procedure OnImeStartComposition(); virtual;

Remarks

The WM_IME_STARTCOMPOSITION message is sent immediately before the IME generates the composition string as a result of a keystroke. The message is a notification to an IME window to open its composition window. An application should process this message if it displays composition characters itself.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.OnMouseWheel Method

ScrollableControl.OnMouseWheel Method

Raises the System.Windows.Forms.Control.MouseWheel event.

[Visual Basic]

Overrides Protected Sub OnMouseWheel( _

ByVal e As MouseEventArgs _

)

[C#]

override protected void OnMouseWheel(

MouseEventArgs e

);

[Delphi]

strict protected procedure OnMouseWheel(

e: MouseEventArgs

); override;

Parameters

e

A System.Windows.Forms.MouseEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.OnPaint Method

ScrollableControl.OnPaint Method

Raises the System.Windows.Forms.Control.Paint event.

[Visual Basic]

Overrides Protected Sub OnPaint( _

ByVal e As PaintEventArgs _

)

[C#]

override protected void OnPaint(

PaintEventArgs e

);

[Delphi]

strict protected procedure OnPaint(

e: PaintEventArgs

); override;

Parameters

e

A System.Windows.Forms.PaintEventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.OnScroll Method

ScrollableControl.OnScroll Method

Called after the control scrolls (see the ScrollPosition property).

[Visual Basic]

Overridable Protected Sub OnScroll( _

ByVal sb As ScrollBars _

)

[C#]

virtual protected void OnScroll(

ScrollBars sb

);

[Delphi]

strict protected procedure OnScroll(

sb: ScrollBars

); virtual;

Parameters

sb

ScrollBars value that indicates the scroll direction.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.OnScrollTip Method

ScrollableControl.OnScrollTip Method

Called before the controls displays a scroll tip (see the ScrollTips property).

[Visual Basic]

Overridable Protected Sub OnScrollTip( _

ByVal newValue As Integer _

)

[C#]

virtual protected void OnScrollTip(

int newValue

);

[Delphi]

strict protected procedure OnScrollTip(

newValue: Int32

); virtual;

Parameters

newValue

New value for the vertical scrollbar.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.OnSizeChanged Method

ScrollableControl.OnSizeChanged Method

Raises the System.Windows.Forms.Control.SizeChanged event.

[Visual Basic]

Overrides Protected Sub OnSizeChanged( _

ByVal e As EventArgs _

)

[C#]

override protected void OnSizeChanged(

EventArgs e

);

[Delphi]

strict protected procedure OnSizeChanged(

e: EventArgs

); override;

Parameters

e

An System.EventArgs that contains the event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl.OnThemeChanged Method

ScrollableControl.OnThemeChanged Method

Called when the control receives a WM_THEMECHANGED message.

[Visual Basic]

Overridable Protected Sub OnThemeChanged()

[C#]

virtual protected void OnThemeChanged()

[Delphi]

strict protected procedure OnThemeChanged(); virtual;

Remarks

The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ScrollableControl Events

ScrollableControl Events

The events of the ScrollableControl class are listed here. For a complete list of ScrollableControl class members, see the ScrollableControl Members topic.

Public Events

BackColorChanged (inherited from Control) | Event fired when the value of BackColor property is changed on Control
BackgroundImageChanged (inherited from Control) | Event fired when the value of BackgroundImage property is changed on Control
BindingContextChanged (inherited from Control) | Event fired when the value of BindingContext property is changed on Control
CausesValidationChanged (inherited from Control) | Event fired when the value of CausesValidation property is changed on Control
ChangeUICues (inherited from Control) | Occurs when focus rectangles and keyboard cue underlines are being shown or hidden.
Click (inherited from Control) | Occurs when the control is clicked.
ContextMenuChanged (inherited from Control) | Event fired when the value of ContextMenu property is changed on Control
ControlAdded (inherited from Control) | Occurs when a control is added to this control.
ControlRemoved (inherited from Control) | Occurs when a control is removed from this control.
CursorChanged (inherited from Control) | Event fired when the value of Cursor property is changed on Control
DockChanged (inherited from Control) | Event fired when the value of Dock property is changed on Control
DoubleClick (inherited from Control) | Occurs when the control is double-clicked.
DragDrop (inherited from Control) | Occurs when the mouse drags an item and the user releases the mouse indicating that the item should be 'dropped' into this Control.
DragEnter (inherited from Control) | Occurs when the mouse drags an item into the client area for this Control.
DragLeave (inherited from Control) | Occurs when the mouse drags an item and is no longer over the client area for this Control.
DragOver (inherited from Control) | Occurs when the mouse drags an item and is moving over the client area of this Control.
EnabledChanged (inherited from Control) | Occurs when the control's enabled state changes.
Enter (inherited from Control) | Occurs when the control becomes the active control of the form.
FontChanged (inherited from Control) | Event fired when the value of Font property is changed on Control
ForeColorChanged (inherited from Control) | Event fired when the value of ForeColor property is changed on Control
GiveFeedback (inherited from Control) | Occurs when the mouse drags an item. The system requests that the Control provide feedback to that effect.
GotFocus (inherited from Control) | Occurs when the control gets focus.
HandleCreated (inherited from Control) | Occurs when the control's native handle is created.
HandleDestroyed (inherited from Control) | Occurs when the control's native handle is destroyed.
HelpRequested (inherited from Control) | Occurs when the user invokes help for the control.
ImeModeChanged (inherited from Control) | Occurs when the control's IME mode changes
Invalidated (inherited from Control) | Occurs when one of the invalidate methods is called.
KeyDown (inherited from Control) | Occurs when a key is first pressed.
KeyPress (inherited from Control) | Occurs after the user is finished pressing a key.
KeyUp (inherited from Control) | Occurs when a key is released.
Layout (inherited from Control) | Occurs when the control is about to lay out its contents.
Leave (inherited from Control) | Occurs when the control is no longer the active control of the form.
LocationChanged (inherited from Control) | Event fired when the value of Location property is changed on Control
LostFocus (inherited from Control) | Occurs when the control gets focus.
MouseDown (inherited from Control) | Occurs when a mouse button is pressed.
MouseEnter (inherited from Control) | Occurs when the mouse enters the visible part of the control.
MouseHover (inherited from Control) | Occurs when the mouse remains stationary inside of the control for an amount of time.
MouseLeave (inherited from Control) | Occurs when the mouse leaves the visible part of the control.
MouseMove (inherited from Control) | Occurs when the mouse is moved.
MouseUp (inherited from Control) | Occurs when a mouse button is released.
MouseWheel (inherited from Control) | Occurs when the mouse wheel is rolled.
Move (inherited from Control) | Occurs when a control is moved.
Paint (inherited from Control) | Occurs when a control needs repainting.
ParentChanged (inherited from Control) | Event fired when the value of Parent property is changed on Control
QueryAccessibilityHelp (inherited from Control) | Occurs when an Accessibility client invokes help for the control.
QueryContinueDrag (inherited from Control) | Occurs when the mouse drags an item. The system requests whether the drag and drop operation should be allowed to continue.
Resize (inherited from Control) | Occurs when a control is resized.
RightToLeftChanged (inherited from Control) | Event fired when the value of RightToLeft property is changed on Control
SizeChanged (inherited from Control) | Event fired when the value of Size property is changed on Control
StyleChanged (inherited from Control) | Event fired when the window style of a Control is changed
SystemColorsChanged (inherited from Control) | Event fired when the system colors change
TabIndexChanged (inherited from Control) | Event fired when the value of TabIndex property is changed on Control
TabStopChanged (inherited from Control) | Event fired when the value of TabStop property is changed on Control
TextChanged (inherited from Control) | Event fired when the value of Text property is changed on Control
Validated (inherited from Control) | Occurs after a control has been successfully validated.
Validating (inherited from Control) | Occurs when a control is being validated. Set to True the Cancel property on the event parameter to cancel the validation.
VisibleChanged (inherited from Control) | Occurs when the control's visibility changes.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid.Util.Styles Namespace

C1.Win.C1FlexGrid.Util.Styles Namespace

C1.Win.C1FlexGrid.Util.Styles Hierarchy

Classes

Class | Description
Style | Style contains a collection of arbitrary attributes, represented by a name/object entry, a reference to a parent Style, and a reference to the containing StyleContext.

See Also

C1.Win.C1FlexGrid Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Style Class

Style Class

Style contains a collection of arbitrary attributes, represented by a name/object entry, a reference to a parent Style, and a reference to the containing StyleContext.

For a list of all members of this type, see Style Members.

System.Object

C1.Win.C1FlexGrid.Util.Styles.Style

[Visual Basic]

Public Class Style

[C#]

public class Style

[Delphi]

type Style = class;

Namespace: C1.Win.C1FlexGrid.Util.Styles

Assembly: C1.Win.C1FlexGrid (in c1.win.c1flexgrid.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Style Members

Style Members

Style overview

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AddItem Method - C#

C#

// add row at the bottom, using tabs as separators

flex.ClipSeparators = "\t\n"; // << default value

flex.AddItem("col 0\tcol1\tcol2");

// add row at the top, using pipes as separators

flex.ClipSeparators = "|;";

flex.AddItem("col 0|col1|col2", 0);

// add row at the bottom, using an object array

object[] items = { "col0", "col1", 12 };

flex.AddItem(items, flex.Rows.Count, 0);


AddItem Method - Delphi

Delphi

var

items: array of System.Object;

begin

flex.ClipSeparators := #9#10;

flex.AddItem('col 0'#9'col1'#9'col2');

flex.ClipSeparators := '|;';

flex.AddItem('col 0|col1|col2', 0);

SetLength(items, 3);

items[0] := 'col0';

items[1] := 'col1';

items[2] := System.Object(12);

flex.AddItem(items, flex.Rows.Count, 0);

end;


AddItem Method - Visual Basic

Visual Basic

' add row at the bottom, using tabs as separators

flex.ClipSeparators = vbTab + vbLf ' << default value

flex.AddItem("col 0" + vbTab + "col1" + vbTab + "col2")

' add row at the top, using pipes as separators

flex.ClipSeparators = "|;"

flex.AddItem("col 0|col1|col2", 0)

' add row at the bottom, using an object array

Dim items As Object() = {"col0", "col1", 12}

flex.AddItem(items, flex.Rows.Count, 0)


AfterScroll Event - C#

C#

// bind grids together

fgRight.DataSource = fgLeft;

fgLeft.ScrollBars = ScrollBars.Horizontal;

// synchronize vertical scrolling

private void flex_AfterScroll(object sender, C1.Win.C1FlexGrid.RangeEventArgs e)

{

C1FlexGrid.C1FlexGrid fg = ((C1FlexGrid)sender);

fg.Update();

int y = fg.ScrollPosition.Y;

if (fg == fgLeft)

fgRight.ScrollPosition = new Point(fgRight.ScrollPosition.X, y);

else

fgLeft.ScrollPosition = new Point(fgLeft.ScrollPosition.X, y);

}

}


AfterScroll Event - Delphi

Delphi

fgRight.DataSource := fgLeft;

fgLeft.ScrollBars := ScrollBars.Horizontal;

procedure Class1.flex_AfterScroll(sender: System.Object; e: C1.Win.C1FlexGrid.RangeEventArgs);

var

y: Integer;

fg: C1FlexGrid.C1FlexGrid;

begin

fg := C1FlexGrid(sender);

fg.Update;

y := fg.ScrollPosition.Y;

if fg = fgLeft then

fgRight.ScrollPosition := Point.Create(fgRight.ScrollPosition.X, y)

else

fgLeft.ScrollPosition := Point.Create(fgLeft.ScrollPosition.X, y);

end;


AfterScroll Event - Visual Basic

Visual Basic

' bind grids together

fgRight.DataSource = fgLeft

fgLeft.ScrollBars = ScrollBars.Horizontal

' synchronize vertical scrolling

Private Sub flex_AfterScroll(sender As Object, _
e As C1.Win.C1FlexGrid.RangeEventArgs)

Dim fg As C1FlexGrid.C1FlexGrid = CType(sender, C1FlexGrid)

fg.Update()

Dim y As Integer = fg.ScrollPosition.Y

If fg = fgLeft Then

fgRight.ScrollPosition = New Point(fgRight.ScrollPosition.X, y)

Else

fgLeft.ScrollPosition = New Point(fgLeft.ScrollPosition.X, y)

End If

End Sub


Aggregate Method - C#

C#

private void flex_SelChange(object sender, System.EventArgs e)

{

string fmt = "Count {0:0}, Sum {1:#,##0.00}, " +

"Avg {2:#,##0.00}, Stdev {3:#,##0.00}";

string agg = string.Format(fmt,

flex.Aggregate(AggregateEnum.Count),

flex.Aggregate(AggregateEnum.Sum),

flex.Aggregate(AggregateEnum.Average),

flex.Aggregate(AggregateEnum.Std));

Console.WriteLine(agg);

}


Aggregate Method - Delphi

Delphi

procedure Class1.flex_SelChange(sender: System.Object; e: System.EventArgs);

var

agg: string;

fmt: string;

begin

fmt := ('Count {0:0}, Sum {1:#,##0.00}, ' + 'Avg {2:#,##0.00}, Stdev {3:#,##0.00}');

  agg := System.String.Format(fmt,
flex.Aggregate(AggregateEnum.Count), flex.Aggregate(AggregateEnum.Sum),
flex.Aggregate(AggregateEnum.Average), flex.Aggregate(AggregateEnum.Std));

Console.WriteLine(agg);

end;


Aggregate Method - Visual Basic

Visual Basic

Private Sub flex_SelChange(sender As Object, e As System.EventArgs)

Dim fmt As String = "Count {0:0}, Sum {1:#,##0.00}, " & _

"Avg {2:#,##0.00}, Stdev {3:#,##0.00}"

Dim agg As String = String.Format(fmt, _

flex.Aggregate(AggregateEnum.Count), _

flex.Aggregate(AggregateEnum.Sum), _

flex.Aggregate(AggregateEnum.Average), _

flex.Aggregate(AggregateEnum.Std))

Console.WriteLine(agg)

End Sub


AllowAddNew Property - C#

C#

flex.AllowAddNew = true;

flex.Rows.Count = 10;

Console.WriteLine(_flex.Rows.Count);


AllowAddNew Property - Delphi

Delphi

begin

flex.AllowAddNew := True;

flex.Rows.Count := 10;

Console.WriteLine(_flex.Rows.Count);

end;


AllowAddNew Property - Visual Basic

Visual Basic

flex.AllowAddNew = True

flex.Rows.Count = 10

Console.WriteLine(_flex.Rows.Count)


AllowDragging Property - C#

C#

flex.AllowDragging = AllowDraggingEnum.Columns;

flex.Cols[2].AllowDragging = false;


AllowDragging Property - Delphi

Delphi

flex.AllowDragging := AllowDraggingEnum.Columns;

flex.Cols[2].AllowDragging := false;


AllowDragging Property - Visual Basic

Visual Basic

flex.AllowDragging = AllowDraggingEnum.Columns

flex.Cols(2).AllowDragging = False


AllowEditing Property (C1FlexGrid) - C#

C#

flex.AllowEditing = true;

flex.Cols[2].AllowEditing = false; // prevent editing column 2


AllowEditing Property (C1FlexGrid) - Delphi

Delphi

flex.AllowEditing := true;

flex.Cols[2].AllowEditing := false; // prevent editing column 2


AllowEditing Property (C1FlexGrid) - Visual Basic

Visual Basic

flex.AllowEditing = True

flex.Cols(2).AllowEditing = False ' prevent editing column 2


AllowMerging Property - C#

C#

flex.AllowMerging = AllowMergingEnum.Free;

flex.Cols[1].AllowMerging = true; // merge values in column 1


AllowMerging Property - Delphi

Delphi

flex.AllowMerging := AllowMergingEnum.Free;

flex.Cols[1].AllowMerging := true; // merge values in column 1


AllowMerging Property - Visual Basic

Visual Basic

flex.AllowMerging = AllowMergingEnum.Free

flex.Cols(1).AllowMerging = True ' merge values in column 1


AllowUserResizing Property - C#

C#

fg.set_ColWidth(5,1);


AllowUserResizing Property - Delphi

Delphi

fg.set_ColWidth(5, 1);


AllowUserResizing Property - Visual Basic

Visual Basic

fg.set_ColWidth(5,1)


BeforeCollapse Event - C#

C#

private bool m_ExpandingNode = false;

private void flex_BeforeCollapse(object sender, RowColEventArgs e)

{

// if we're working, ignore this

if (m_ExpandingNode)

return;

// don't allow collapsing/expanding groups of rows (with shift-click)

if (e.Row < 0)

{

e.Cancel = true;

return;

}

// if we're already collapsed, populate node

// before expanding

if (flex.Rows[e.Row].Node.Collapsed)

{

m_ExpandingNode = true;

ExpandRow(e.Row);

m_ExpandingNode = false;

}

}


BeforeCollapse Event - C#2

C#

BeforeCollapse (e.Row = -1); // ** batch started

BeforeCollapse (e.Row = 1); // individual rows being collapsed/expanded

AfterCollapse (e.Row = 1);

BeforeCollapse (e.Row = 5);

AfterCollapse (e.Row = 5);

BeforeCollapse (e.Row = 15);

AfterCollapse (e.Row = 15);

AfterCollapse (e.Row = -1); // ** batch ended


BeforeCollapse Event - Delphi

Delphi

procedure Class1.flex_BeforeCollapse(sender: System.Object; e: RowColEventArgs);

begin

// if we're working, ignore this

if Self.m_ExpandingNode then

Exit;

// don't allow collapsing/expanding groups of rows (with shift-click)

if (e.Row < 0) then

begin

e.Cancel := True;

Exit;

end;

// if we're already collapsed, populate node

// before expanding

if flex.Rows[e.Row].Node.Collapsed then

begin

Self.m_ExpandingNode := True;

ExpandRow(e.Row);

Self.m_ExpandingNode := False;

end;

end;


BeforeCollapse Event - Delphi2

Delphi

BeforeCollapse(e.Row = -1); // ** batch started

BeforeCollapse(e.Row = 1); // individual rows being collapsed/expanded

AfterCollapse(e.Row = 1);

BeforeCollapse(e.Row = 5);

AfterCollapse(e.Row = 5);

BeforeCollapse(e.Row = 15);

AfterCollapse(e.Row = 15);

AfterCollapse(e.Row = -1); // ** batch ended


BeforeCollapse Event - Visual Basic

Visual Basic

Private m_ExpandingNode As Boolean = False

Private Sub flex_BeforeCollapse(sender As Object, e As RowColEventArgs)

' if we're working, ignore this

If m_ExpandingNode Then

Return

End If

' don't allow collapsing/expanding groups of rows (with shift-click)

If e.Row < 0 Then

e.Cancel = True

Return

End If

' if we're already collapsed, populate node

' before expanding

If flex.Rows(e.Row).Node.Collapsed Then

m_ExpandingNode = True

ExpandRow(e.Row)

m_ExpandingNode = False

End If

End Sub


BeforeCollapse Event - Visual Basic2

Visual Basic

BeforeCollapse(e.Row = - 1) ' ** batch started

BeforeCollapse(e.Row = 1) ' individual rows being collapsed/expanded

AfterCollapse(e.Row = 1)

BeforeCollapse(e.Row = 5)

AfterCollapse(e.Row = 5)

BeforeCollapse(e.Row = 15)

AfterCollapse(e.Row = 15)

AfterCollapse(e.Row = - 1) ' ** batch ended


BeforeEdit Event - C#

C#

private void c1FlexGrid1_BeforeEdit(object sender, RowColEventArgs e)

{

object value = _flex[e.Row, e.Col];

if (value is int && (int)value < 0)

e.Cancel = true;

}


BeforeEdit Event - Delphi

Delphi

var

value: System.Object;

begin

value := _flex[e.Row];

if ((value is System.Int32) and (Integer(value) < 0)) then

e.Cancel := True;

end;


BeforeEdit Event - Visual Basic

Visual Basic

Private Sub c1FlexGrid1_BeforeEdit(sender As Object, e As RowColEventArgs)

Dim value As Object = _flex(e.Row, e.Col)

If TypeOf value Is Integer And CInt(value) < 0 Then

e.Cancel = True

End If

End Sub


BeforeMouseDown Event - C#

C#

private void flex_BeforeMouseDown(object sender, BeforeMouseDownEventArgs e)

{
if (flex.Editor != null)
e.Cancel = true;
}


BeforeMouseDown Event - Delphi

Delphi

procedure Class1.flex_BeforeMouseDown(sender: System.Object; e: BeforeMouseDownEventArgs);

begin

if (flex.Editor <> nil) then

e.Cancel := True;

end;


BeforeMouseDown Event - Visual Basic

Visual Basic

Private Sub flex_BeforeMouseDown(sender As Object, e As BeforeMouseDownEventArgs)

If Not (flex.Editor Is Nothing) Then

e.Cancel = True

End If

End Sub


BeforePageBreak Event - C#

C#

private void flex_BeforePageBreak(object sender, RowColEventArgs e)

{

// get content before and after the proposed page break

string s1 = (string) flex[e.Row,1];

string s2 = (string) flex[e.Row-1,1];

// if contents are the same, set Cancel to true to

// keep rows together on a page

if (s1 == s2)

e.Cancel = true;

}


BeforePageBreak Event - Delphi

Delphi

procedure Class1.flex_BeforePageBreak(sender: System.Object; e: RowColEventArgs);

var

s2: string;

s1: string;

begin

s1 := string(flex[e.Row]);

s2 := string(flex[(e.Row - 1)]);

if (s1 = s2) then

e.Cancel := True;

end;


BeforePageBreak Event - Visual Basic

Visual Basic

Private Sub flex_BeforePageBreak(sender As Object, e As RowColEventArgs)

' get content before and after the proposed page break

Dim s1 As String = CStr(flex(e.Row, 1))

Dim s2 As String = CStr(flex(e.Row - 1, 1))

' if contents are the same, set Cancel to true to

' keep rows together on a page

If s1 = s2 Then

e.Cancel = True

End If

End Sub 'flex_BeforePageBreak


BeforeScrollTip Event - C#

C#

flex.ScrollTips = true;

flex.ScrollTrack = false;

private void flex_BeforeScrollTip(object sender, RowColEventArgs e)

{

string tip = string.Format("Row {0}\n{1}", e.Row, flex[e.Row,1]);

flex.ScrollTipText = tip;

}


BeforeScrollTip Event - Delphi

Delphi

flex.ScrollTips := True;

flex.ScrollTrack := False;

procedure Class1.flex_BeforeScrollTip(sender: System.Object; e: RowColEventArgs);

var

tip: string;

begin

tip := System.String.Format('Row {0}'#10'{1}', e.Row, flex[e.Row]);

flex.ScrollTipText := tip;

end;


BeforeScrollTip Event - Visual Basic

Visual Basic

flex.ScrollTips = True

flex.ScrollTrack = False

Private Sub flex_BeforeScrollTip(sender As Object, e As RowColEventArgs)

Dim tip As String

tip = String.Format("Row {0}" + ControlChars.Lf + "{1}", _

e.Row, flex(e.Row, 1))

flex.ScrollTipText = tip

End Sub


C1FlexGridClassic Class

C1FlexGridClassic Class

For a list of all members of this type, see C1FlexGridClassic Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

System.Windows.Forms.Control

C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl

C1.Win.C1FlexGrid.C1FlexGridBase

C1.Win.C1FlexGrid.C1FlexGrid

C1.Win.C1FlexGrid.Classic.C1FlexGridClassic

[Visual Basic]

Public Class C1FlexGridClassic

Inherits C1FlexGrid

[C#]

public class C1FlexGridClassic : C1FlexGrid

[Delphi]

type C1FlexGridClassic = class (C1FlexGrid);

Namespace: C1.Win.C1FlexGrid.Classic

Assembly: C1.Win.C1FlexGrid.Classic (in c1.win.c1flexgrid.classic.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridClassic Events

C1FlexGridClassic Events

The events of the C1FlexGridClassic class are listed here. For a complete list of C1FlexGridClassic class members, see the C1FlexGridClassic Members topic.

Public Events

AfterAddRow (inherited from C1FlexGridBase) | Fires after a new row is added by the user.
AfterCollapse (inherited from C1FlexGridBase) | Fires after a node row is collapsed or expanded.
AfterDataRefresh (inherited from C1FlexGridBase) | Fires after any data source change notifications.
AfterDeleteRow (inherited from C1FlexGridBase) | Fires after one or more rows are deleted by the user.
AfterDragColumn (inherited from C1FlexGridBase) | Fires after the user finishes dragging a column.
AfterDragRow (inherited from C1FlexGridBase) | Fires after the user finishes dragging a row.
AfterEdit (inherited from C1FlexGridBase) | Fires after a cell has been edited.
AfterFreezeColumn (inherited from C1FlexGridBase) | Fires after columns are frozen by dragging the frozen column divider.
AfterFreezeRow (inherited from C1FlexGridBase) | Fires after rows are frozen by dragging the frozen row divider.
AfterResizeColumn (inherited from C1FlexGridBase) | Fires after a column is resized by dragging the column header.
AfterResizeRow (inherited from C1FlexGridBase) | Fires after a row is resized by dragging the row header.
AfterRowColChange (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
AfterScroll (inherited from C1FlexGridBase) | Fires after the grid scrolls.
AfterSelChange (inherited from C1FlexGridBase) | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
AfterSort (inherited from C1FlexGridBase) | Fires after a column is sorted by a click on a column header.
BackColorChanged (inherited from Control) | Event fired when the value of BackColor property is changed on Control
BackgroundImageChanged (inherited from Control) | Event fired when the value of BackgroundImage property is changed on Control
BeforeAddRow (inherited from C1FlexGridBase) | Fires before a new row is added by the user.
BeforeAutosizeColumn (inherited from C1FlexGridBase) | Fires before a column is automatically resized by a double-click on a column header.
BeforeAutosizeRow (inherited from C1FlexGridBase) | Fires before a row is automatically resized by a double-click on a row header.
BeforeCollapse (inherited from C1FlexGridBase) | Fires before a node row is collapsed or expanded.
BeforeDeleteRow (inherited from C1FlexGridBase) | Fires before a row is deleted by the user.
BeforeDoubleClick (inherited from C1FlexGridBase) | Fires before the DoubleClick event is handled by the grid.
BeforeDragColumn (inherited from C1FlexGridBase) | Fires before the user starts dragging a column.
BeforeDragRow (inherited from C1FlexGridBase) | Fires before the user starts dragging a row.
BeforeEdit (inherited from C1FlexGridBase) | Fires before the grid enters edit mode, and also when the cell that has the focus needs to be painted.
BeforeFreezeColumn (inherited from C1FlexGridBase) | Fires before columns are frozen by dragging the frozen column divider.
BeforeFreezeRow (inherited from C1FlexGridBase) | Fires before rows are frozen by dragging the frozen row divider.
BeforeMouseDown (inherited from C1FlexGridBase) | Fires before the System.Windows.Forms.Control.MouseDown event is handled by the grid.
BeforePageBreak (inherited from C1FlexGridBase) | Fires while the control is being printed to provide control over page breaks.
BeforeResizeColumn (inherited from C1FlexGridBase) | Fires before a column is resized by dragging the column header.
BeforeResizeRow (inherited from C1FlexGridBase) | Fires before a row is resized by dragging the row header.
BeforeRowColChange (inherited from C1FlexGridBase) | Fires before the current cell changes ( Row and Col properties).
BeforeScroll (inherited from C1FlexGridBase) | Fires before the grid scrolls.
BeforeScrollTip (inherited from C1FlexGridBase) | Fires before the vertical scrolltip is displayed.
BeforeSelChange (inherited from C1FlexGridBase) | Fires before the selection changes ( Row, Col, RowSel, ColSel properties).
BeforeSort (inherited from C1FlexGridBase) | Fires before a column is sorted by a click on a column header.
BeginPrint (inherited from C1FlexGridBase) | Fires before the grid starts printing.
BindingContextChanged (inherited from Control) | Event fired when the value of BindingContext property is changed on Control
CancelAddRow (inherited from C1FlexGridBase) | Fires when the cursor leaves the new row without making any changes to it.
CausesValidationChanged (inherited from Control) | Event fired when the value of CausesValidation property is changed on Control
CellButtonClick (inherited from C1FlexGridBase) | Fires after the user clicks a cell button.
CellChanged (inherited from C1FlexGridBase) | Fires after the contents of a cell have changed.
ChangeEdit (inherited from C1FlexGridBase) | Fires in edit mode, after the contents of the editor change.
ChangeUICues (inherited from Control) | Occurs when focus rectangles and keyboard cue underlines are being shown or hidden.
Click (inherited from Control) | Occurs when the control is clicked.
ComboCloseUp (inherited from C1FlexGridBase) | Fires in edit mode, when the dropdown portion of an editor closes.
ComboDropDown (inherited from C1FlexGridBase) | Fires in edit mode, when the dropdown portion of an editor opens.
ContextMenuChanged (inherited from Control) | Event fired when the value of ContextMenu property is changed on Control
ControlAdded (inherited from Control) | Occurs when a control is added to this control.
ControlRemoved (inherited from Control) | Occurs when a control is removed from this control.
CursorChanged (inherited from Control) | Event fired when the value of Cursor property is changed on Control
DockChanged (inherited from Control) | Event fired when the value of Dock property is changed on Control
DoubleClick (inherited from Control) | Occurs when the control is double-clicked.
DragDrop (inherited from Control) | Occurs when the mouse drags an item and the user releases the mouse indicating that the item should be 'dropped' into this Control.
DragEnter (inherited from Control) | Occurs when the mouse drags an item into the client area for this Control.
DragLeave (inherited from Control) | Occurs when the mouse drags an item and is no longer over the client area for this Control.
DragOver (inherited from Control) | Occurs when the mouse drags an item and is moving over the client area of this Control.
EnabledChanged (inherited from Control) | Occurs when the control's enabled state changes.
EndPrint (inherited from C1FlexGridBase) | Fires after the grid finishes printing.
Enter (inherited from Control) | Occurs when the control becomes the active control of the form.
EnterCell (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
FontChanged (inherited from Control) | Event fired when the value of Font property is changed on Control
ForeColorChanged (inherited from Control) | Event fired when the value of ForeColor property is changed on Control
GetCellErrorInfo (inherited from C1FlexGridBase) | Fires when ShowErrors is set to True and the control needs error information for a cell.
GetRowErrorInfo (inherited from C1FlexGridBase) | Fires when ShowErrors is set to True and the control needs error information for a row.
GetUnboundValue (inherited from C1FlexGridBase) | Fires when the grid needs to retrieve data for an unbound cell.
GiveFeedback (inherited from Control) | Occurs when the mouse drags an item. The system requests that the Control provide feedback to that effect.
GotFocus (inherited from Control) | Occurs when the control gets focus.
GridChanged (inherited from C1FlexGridBase) | Fires when the grid or its contents change.
GridError (inherited from C1FlexGridBase) | Fires after the data source reports an error condition.
HandleCreated (inherited from Control) | Occurs when the control's native handle is created.
HandleDestroyed (inherited from Control) | Occurs when the control's native handle is destroyed.
HelpRequested (inherited from Control) | Occurs when the user invokes help for the control.
ImeModeChanged (inherited from Control) | Occurs when the control's IME mode changes
Invalidated (inherited from Control) | Occurs when one of the invalidate methods is called.
KeyDown (inherited from Control) | Occurs when a key is first pressed.
KeyDownEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user presses a key.
KeyPress (inherited from Control) | Occurs after the user is finished pressing a key.
KeyPressEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user presses a character key.
KeyUp (inherited from Control) | Occurs when a key is released.
KeyUpEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user releases a key.
Layout (inherited from Control) | Occurs when the control is about to lay out its contents.
Leave (inherited from Control) | Occurs when the control is no longer the active control of the form.
LeaveCell (inherited from C1FlexGridBase) | Fires before the current cell changes ( Row and Col properties).
LeaveEdit (inherited from C1FlexGridBase) | Fires after the control leaves edit mode.
LocationChanged (inherited from Control) | Event fired when the value of Location property is changed on Control
LostFocus (inherited from Control) | Occurs when the control gets focus.
MouseDown (inherited from Control) | Occurs when a mouse button is pressed.
MouseEnter (inherited from Control) | Occurs when the mouse enters the visible part of the control.
MouseHover (inherited from Control) | Occurs when the mouse remains stationary inside of the control for an amount of time.
MouseHoverCell (inherited from C1FlexGridBase) | Fires when the mouse enters or leaves a cell.
MouseLeave (inherited from Control) | Occurs when the mouse leaves the visible part of the control.
MouseMove (inherited from Control) | Occurs when the mouse is moved.
MouseUp (inherited from Control) | Occurs when a mouse button is released.
MouseWheel (inherited from Control) | Occurs when the mouse wheel is rolled.
Move (inherited from Control) | Occurs when a control is moved.
OwnerDrawCell (inherited from C1FlexGridBase) | Fires before the grid draws a cell, when the DrawMode property is set to .
Paint (inherited from Control) | Occurs when a control needs repainting.
ParentChanged (inherited from Control) | Event fired when the value of Parent property is changed on Control
PrintPage (inherited from C1FlexGridBase) | Fires after the grid finishes printing a page.
QueryAccessibilityHelp (inherited from Control) | Occurs when an Accessibility client invokes help for the control.
QueryContinueDrag (inherited from Control) | Occurs when the mouse drags an item. The system requests whether the drag and drop operation should be allowed to continue.
Resize (inherited from Control) | Occurs when a control is resized.
RightToLeftChanged (inherited from Control) | Event fired when the value of RightToLeft property is changed on Control
RowColChange (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
SelChange (inherited from C1FlexGridBase) | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
SetUnboundValue (inherited from C1FlexGridBase) | Fires when the grid needs to store data in an unbound cell.
SetupEditor (inherited from C1FlexGridBase) | Fires after a cell editor has been initialized by the grid, to allow additional custom initialization.
SizeChanged (inherited from Control) | Event fired when the value of Size property is changed on Control
StartDrag (inherited from C1FlexGridBase) | Fires before the grid starts an automatic OLE drag operation.
StartEdit (inherited from C1FlexGridBase) | Fires before the control enters edit mode.
StyleChanged (inherited from Control) | Event fired when the window style of a Control is changed
SystemColorsChanged (inherited from Control) | Event fired when the system colors change
TabIndexChanged (inherited from Control) | Event fired when the value of TabIndex property is changed on Control
TabStopChanged (inherited from Control) | Event fired when the value of TabStop property is changed on Control
TextChanged (inherited from Control) | Event fired when the value of Text property is changed on Control
Validated (inherited from Control) | Occurs after a control has been successfully validated.
ValidateEdit (inherited from C1FlexGridBase) | Fires before the control exits cell edit mode, while the editor is still active.
Validating (inherited from Control) | Occurs when a control is being validated. Set to True the Cancel property on the event parameter to cancel the validation.
VisibleChanged (inherited from Control) | Occurs when the control's visibility changes.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridClassic Members

C1FlexGridClassic Members

C1FlexGridClassic overview

Public Properties

AccessibilityObject (inherited from Control) | The accessibility object for this control.
AccessibleDefaultActionDescription (inherited from Control) | The default action description of the control.
AccessibleDescription (inherited from Control) | The description that will be reported to accessibility clients.
AccessibleName (inherited from Control) | The name that will be reported to accessibility clients.
AccessibleRole (inherited from Control) | The role that will be reported to accessibility clients.
AllowAddNew (inherited from C1FlexGridBase) | Gets or sets whether the grid should display a new row template after the last data row.
AllowDelete (inherited from C1FlexGridBase) | Gets or sets whether the grid should monitor the keyboard and handle the DEL key.
AllowFreezing (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to freeze rows and columns with the mouse.
Anchor (inherited from Control) | The anchor of the control. Anchors define to which edges of the container a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant.
AutoClipboard (inherited from C1FlexGridBase) | Gets or sets whether the grid should handle the clipboard keys and automatically perform cut, copy, paste, and delete operations.
AutoGenerateColumns (inherited from C1FlexGridBase) | Gets or sets whether columns are automatically created when the grid is bound to a data source.
AutoResize (inherited from C1FlexGridBase) | Gets or sets whether column widths are automatically adjusted when data is loaded.
AutoSearch (inherited from C1FlexGridBase) | Gets or sets whether the grid should move the cursor searching for entries as the user types.
AutoSearchDelay (inherited from C1FlexGridBase) | Gets or sets the delay (in seconds) before the AutoSearch buffer is reset.
BackColor (inherited from C1FlexGridBase) | Gets or sets the background color for the control.
BindingContext (inherited from Control) | The binding manager for this container.
BorderStyle (inherited from ScrollableControl) | Gets or sets the type of border around the control.
Bottom (inherited from Control) | The bottom of the control, in container coordinates.
BottomRow (inherited from C1FlexGridBase) | Gets the last visible row in the scrollable area.
Bounds (inherited from Control) | The bounds of the control, in container coordinates.
CanFocus (inherited from Control) | Checks if this control can receive the focus.
CanSelect (inherited from Control) | Checks if this control can be selected.
Capture (inherited from Control) | Determines if this control is currently capturing all mouse input.
CausesValidation (inherited from Control) | Indicates whether this control causes and raises validation events.
ClientRectangle (inherited from Control) | Retrieves the rectangle of the inner area of this control.
ClientSize (inherited from Control) | Determines the size of the inner area of this control.
Clip (inherited from C1FlexGridBase) | Gets or sets the contents of the selected range.
ClipSeparators (inherited from C1FlexGridBase) | Gets or sets the characters used as row and column separators in clip strings.
Col (inherited from C1FlexGridBase) | Gets or sets the column that contains the cursor.
ColSel (inherited from C1FlexGridBase) | Gets or sets the last column in the current selection.
ComboList (inherited from C1FlexGridBase) | Gets or sets the list of items to be used by the drop-down editor.
CompanyName (inherited from Control) | ControlCompanyNameDescr
ContainsFocus (inherited from Control) | Determines if this control or one if its children currently has the focus.
ContextMenu (inherited from Control) | The shortcut menu to display when the user right-clicks the control.
Controls (inherited from Control) | The collection of child controls within this control.
Created (inherited from Control) | Determines if the control has been fully created.
Cursor (inherited from ScrollableControl) | Gets or sets the cursor that appears when the mouse moves over the control.
CursorCell (inherited from C1FlexGridBase) | Gets a CellRange object that contains the cell at coordinates Row, Col.
CustomComparer (inherited from C1FlexGridBase) | Gets or sets a custom comparer object used by the grid to perform grouping, merging, and searching operations.
DataBindings (inherited from Control) | This collection holds all the bindings of properties of this control to data sources.
DataMember (inherited from C1FlexGridBase) | Gets or sets the specific list in a DataSource object that the grid should display.
DataSource (inherited from C1FlexGridBase) | Gets or sets the data source for the grid.
DisplayRectangle (inherited from Control) | Retrieves the display rectangle of this control.
Disposing (inherited from Control) | Determines if this control is in the process of being disposed.
Dock (inherited from Control) | The docking location of the control, indicating which borders are docked to the container.
DoubleBuffer (inherited from C1FlexGridBase) | Gets or sets whether the control should use an off-screen buffer when painting to reduce flicker.
DragMode (inherited from C1FlexGridBase) | Gets or sets a value that determines if the user can drag data from the control.
DrawMode (inherited from C1FlexGridBase) | Gets or sets whether the control should fire the OwnerDrawCell event.
DropMode (inherited from C1FlexGridBase) | Gets or sets a value that determines if the control can accept data that the user drags onto it.
EditMask (inherited from C1FlexGridBase) | Gets or sets the input mask to use when editing cells.
EditOptions (inherited from C1FlexGridBase) | Gets or sets flags that customize the grid's editing behavior.
Editor (inherited from C1FlexGridBase) | Gets or sets a reference to the cell editor that is currently active.
Enabled (inherited from Control) | Indicates whether the control is enabled.
ExtendLastCol (inherited from C1FlexGridBase) | Gets or sets whether the last column should be extended to fill the control.
Focused (inherited from Control) | Determines if this control has focus.
FocusRect (inherited from C1FlexGridBase) | Gets or sets the type of focus rectangle to display.
Font (inherited from Control) | The font used to display text in the control.
ForeColor (inherited from C1FlexGridBase) | Gets or sets the foreground color for the control.
Glyphs (inherited from C1FlexGridBase) | Gets the collection of control glyphs (images used to show sorting, checkboxes, etc).
Handle (inherited from Control) | The native handle for this control.
HasChildren (inherited from Control) | True if this control has child controls in its collection.
Height (inherited from Control) | The height of the control, in container coordinates.
HighLight (inherited from C1FlexGridBase) | Gets or sets when to highlight selected cells.
ImeMode (inherited from Control) | Determines the IME (Input Method Editor) status of the object when selected.
InvokeRequired (inherited from Control) | Determines if Invoke or InvokeAsync should be used to access this control cross-thread.
IsAccessible (inherited from Control) | Determines if this control supports Accessibility.
IsDisposed (inherited from Control) | Determines if this control has been disposed.
IsHandleCreated (inherited from Control) | Determines if the native handle has been created for this control.
Left (inherited from Control) | The upper left of the control, in container coordinates.
LeftCol (inherited from C1FlexGridBase) | Gets or sets the first visible column in the scrollable area.
Location (inherited from Control) | The position of the top-left corner of the control with respect to its container.
MouseCol (inherited from C1FlexGridBase) | Gets the index of the column under the cursor.
MouseRow (inherited from C1FlexGridBase) | Gets the index of the row under the cursor.
Parent (inherited from Control) | The parent of this control.
PrintParameters (inherited from C1FlexGridBase) | Gets a GridPrinter object that specifies printing parameters for the grid.
ProductName (inherited from Control) | Retrieves the name of the product associated with this component.
ProductVersion (inherited from Control) | Retrieves the version of the product associated with this component.
RecreatingHandle (inherited from Control) | Determines if this control is in the process of recreating its handle.
Region (inherited from Control) | The region, or shape, of this control.
Right (inherited from Control) | The upper right of the control, in container coordinates.
RightCol (inherited from C1FlexGridBase) | Gets the last visible column in the scrollable area.
RightToLeft (inherited from Control) | Indicates whether the control should draw right-to-left for RTL languages.
Row (inherited from C1FlexGridBase) | Gets or sets the row that contains the cursor.
RowSel (inherited from C1FlexGridBase) | Gets or sets the last row in the current selection.
ScrollableRectangle (inherited from C1FlexGridBase) | Gets a rectangle that defines the scrollable portion of the control.
ScrollBars (inherited from ScrollableControl) | Gets or sets which scroll bars should appear on the control.
ScrollPosition (inherited from ScrollableControl) | Gets or sets the location of the auto-scroll position.
ScrollTips (inherited from ScrollableControl) | Gets or sets whether the control should display tooltips as the user scrolls vertically.
ScrollTipText (inherited from ScrollableControl) | Gets or sets the tooltip text displayed as the user scrolls vertically.
ScrollTrack (inherited from ScrollableControl) | Gets or sets whether the control should scroll as the user drags the scrollbar thumb.
Selection (inherited from C1FlexGridBase) | Gets the selected range in normalized form.
ShowButtons (inherited from C1FlexGridBase) | Gets or sets when to display combo buttons in cells.
ShowCellLabels (inherited from C1FlexGridBase) | Gets or sets whether the grid should display labels over cells whose contents are partially hidden.
ShowCursor (inherited from C1FlexGridBase) | Gets or sets whether the grid should display a DB-style cursor on the first fixed column.
ShowErrors (inherited from C1FlexGridBase) | Gets or sets whether the grid should display error information in cells and rows.
ShowSort (inherited from C1FlexGridBase) | Gets or sets whether the grid should display sorting glyphs (a triangle) on the headers of sorted columns.
Size (inherited from Control) | The size of the control in pixels.
SubtotalPosition (inherited from C1FlexGridBase) | Gets or sets whether node rows appear above or below the data.
TabIndex (inherited from Control) | Determines the index in the TAB order that this control will occupy.
TabStop (inherited from Control) | Indicates whether the user can use the TAB key to give focus to the control.
Tag (inherited from Control) | User defined data associated with the control.
Top (inherited from Control) | The top of the control, in container coordinates.
TopLevelControl (inherited from Control) | Retrieves the top level control that contains this control.
TopRow (inherited from C1FlexGridBase) | Gets or sets the first visible row in the scrollable area.
Tree (inherited from C1FlexGridBase) | Gets a reference to the GridTree object that controls the appearance of the outline tree in the grid.
Visible (inherited from Control) | Determines whether the control is visible or hidden.
Width (inherited from Control) | The width of the control, in container coordinates.
Item (inherited from C1FlexGridBase) |

Public Methods

AutoSizeCols (inherited from C1FlexGridBase) | Overloaded. Adjusts the width of all columns to fit the data.
AutoSizeRows (inherited from C1FlexGridBase) | Overloaded. Adjusts the height of all rows to fit the data.
BeginInit (inherited from C1FlexGridBase) | Signals the object that initialization is starting.
CreateImage (inherited from C1FlexGridBase) | Overloaded. Creates an image of the entire grid.
EndInit (inherited from C1FlexGridBase) | Signals the object that initialization is complete.
FinishEditing (inherited from C1FlexGridBase) | Overloaded. Finishes editing the current cell and takes the grid out of edit mode.
HitTest (inherited from C1FlexGridBase) | Overloaded. Returns information about the control at the current mouse position.
RemoveItem (inherited from C1FlexGridBase) | Overloaded. Removes the last row from the grid.
StartEditing (inherited from C1FlexGridBase) | Overloaded. Puts the grid in edit mode and starts editing the current cell.
GetMergedRange (inherited from C1FlexGrid) | Returns the merged range that contains a given cell.
Clear (inherited from C1FlexGridBase) | Clears the grid.

Public Events

AfterAddRow (inherited from C1FlexGridBase) | Fires after a new row is added by the user.
AfterCollapse (inherited from C1FlexGridBase) | Fires after a node row is collapsed or expanded.
AfterDataRefresh (inherited from C1FlexGridBase) | Fires after any data source change notifications.
AfterDeleteRow (inherited from C1FlexGridBase) | Fires after one or more rows are deleted by the user.
AfterDragColumn (inherited from C1FlexGridBase) | Fires after the user finishes dragging a column.
AfterDragRow (inherited from C1FlexGridBase) | Fires after the user finishes dragging a row.
AfterEdit (inherited from C1FlexGridBase) | Fires after a cell has been edited.
AfterFreezeColumn (inherited from C1FlexGridBase) | Fires after columns are frozen by dragging the frozen column divider.
AfterFreezeRow (inherited from C1FlexGridBase) | Fires after rows are frozen by dragging the frozen row divider.
AfterResizeColumn (inherited from C1FlexGridBase) | Fires after a column is resized by dragging the column header.
AfterResizeRow (inherited from C1FlexGridBase) | Fires after a row is resized by dragging the row header.
AfterRowColChange (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
AfterScroll (inherited from C1FlexGridBase) | Fires after the grid scrolls.
AfterSelChange (inherited from C1FlexGridBase) | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
AfterSort (inherited from C1FlexGridBase) | Fires after a column is sorted by a click on a column header.
BackColorChanged (inherited from Control) | Event fired when the value of BackColor property is changed on Control
BackgroundImageChanged (inherited from Control) | Event fired when the value of BackgroundImage property is changed on Control
BeforeAddRow (inherited from C1FlexGridBase) | Fires before a new row is added by the user.
BeforeAutosizeColumn (inherited from C1FlexGridBase) | Fires before a column is automatically resized by a double-click on a column header.
BeforeAutosizeRow (inherited from C1FlexGridBase) | Fires before a row is automatically resized by a double-click on a row header.
BeforeCollapse (inherited from C1FlexGridBase) | Fires before a node row is collapsed or expanded.
BeforeDeleteRow (inherited from C1FlexGridBase) | Fires before a row is deleted by the user.
BeforeDoubleClick (inherited from C1FlexGridBase) | Fires before the DoubleClick event is handled by the grid.
BeforeDragColumn (inherited from C1FlexGridBase) | Fires before the user starts dragging a column.
BeforeDragRow (inherited from C1FlexGridBase) | Fires before the user starts dragging a row.
BeforeEdit (inherited from C1FlexGridBase) | Fires before the grid enters edit mode, and also when the cell that has the focus needs to be painted.
BeforeFreezeColumn (inherited from C1FlexGridBase) | Fires before columns are frozen by dragging the frozen column divider.
BeforeFreezeRow (inherited from C1FlexGridBase) | Fires before rows are frozen by dragging the frozen row divider.
BeforeMouseDown (inherited from C1FlexGridBase) | Fires before the System.Windows.Forms.Control.MouseDown event is handled by the grid.
BeforePageBreak (inherited from C1FlexGridBase) | Fires while the control is being printed to provide control over page breaks.
BeforeResizeColumn (inherited from C1FlexGridBase) | Fires before a column is resized by dragging the column header.
BeforeResizeRow (inherited from C1FlexGridBase) | Fires before a row is resized by dragging the row header.
BeforeRowColChange (inherited from C1FlexGridBase) | Fires before the current cell changes ( Row and Col properties).
BeforeScroll (inherited from C1FlexGridBase) | Fires before the grid scrolls.
BeforeScrollTip (inherited from C1FlexGridBase) | Fires before the vertical scrolltip is displayed.
BeforeSelChange (inherited from C1FlexGridBase) | Fires before the selection changes ( Row, Col, RowSel, ColSel properties).
BeforeSort (inherited from C1FlexGridBase) | Fires before a column is sorted by a click on a column header.
BeginPrint (inherited from C1FlexGridBase) | Fires before the grid starts printing.
BindingContextChanged (inherited from Control) | Event fired when the value of BindingContext property is changed on Control
CancelAddRow (inherited from C1FlexGridBase) | Fires when the cursor leaves the new row without making any changes to it.
CausesValidationChanged (inherited from Control) | Event fired when the value of CausesValidation property is changed on Control
CellButtonClick (inherited from C1FlexGridBase) | Fires after the user clicks a cell button.
CellChanged (inherited from C1FlexGridBase) | Fires after the contents of a cell have changed.
ChangeEdit (inherited from C1FlexGridBase) | Fires in edit mode, after the contents of the editor change.
ChangeUICues (inherited from Control) | Occurs when focus rectangles and keyboard cue underlines are being shown or hidden.
Click (inherited from Control) | Occurs when the control is clicked.
ComboCloseUp (inherited from C1FlexGridBase) | Fires in edit mode, when the dropdown portion of an editor closes.
ComboDropDown (inherited from C1FlexGridBase) | Fires in edit mode, when the dropdown portion of an editor opens.
ContextMenuChanged (inherited from Control) | Event fired when the value of ContextMenu property is changed on Control
ControlAdded (inherited from Control) | Occurs when a control is added to this control.
ControlRemoved (inherited from Control) | Occurs when a control is removed from this control.
CursorChanged (inherited from Control) | Event fired when the value of Cursor property is changed on Control
DockChanged (inherited from Control) | Event fired when the value of Dock property is changed on Control
DoubleClick (inherited from Control) | Occurs when the control is double-clicked.
DragDrop (inherited from Control) | Occurs when the mouse drags an item and the user releases the mouse indicating that the item should be 'dropped' into this Control.
DragEnter (inherited from Control) | Occurs when the mouse drags an item into the client area for this Control.
DragLeave (inherited from Control) | Occurs when the mouse drags an item and is no longer over the client area for this Control.
DragOver (inherited from Control) | Occurs when the mouse drags an item and is moving over the client area of this Control.
EnabledChanged (inherited from Control) | Occurs when the control's enabled state changes.
EndPrint (inherited from C1FlexGridBase) | Fires after the grid finishes printing.
Enter (inherited from Control) | Occurs when the control becomes the active control of the form.
EnterCell (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
FontChanged (inherited from Control) | Event fired when the value of Font property is changed on Control
ForeColorChanged (inherited from Control) | Event fired when the value of ForeColor property is changed on Control
GetCellErrorInfo (inherited from C1FlexGridBase) | Fires when ShowErrors is set to True and the control needs error information for a cell.
GetRowErrorInfo (inherited from C1FlexGridBase) | Fires when ShowErrors is set to True and the control needs error information for a row.
GetUnboundValue (inherited from C1FlexGridBase) | Fires when the grid needs to retrieve data for an unbound cell.
GiveFeedback (inherited from Control) | Occurs when the mouse drags an item. The system requests that the Control provide feedback to that effect.
GotFocus (inherited from Control) | Occurs when the control gets focus.
GridChanged (inherited from C1FlexGridBase) | Fires when the grid or its contents change.
GridError (inherited from C1FlexGridBase) | Fires after the data source reports an error condition.
HandleCreated (inherited from Control) | Occurs when the control's native handle is created.
HandleDestroyed (inherited from Control) | Occurs when the control's native handle is destroyed.
HelpRequested (inherited from Control) | Occurs when the user invokes help for the control.
ImeModeChanged (inherited from Control) | Occurs when the control's IME mode changes
Invalidated (inherited from Control) | Occurs when one of the invalidate methods is called.
KeyDown (inherited from Control) | Occurs when a key is first pressed.
KeyDownEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user presses a key.
KeyPress (inherited from Control) | Occurs after the user is finished pressing a key.
KeyPressEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user presses a character key.
KeyUp (inherited from Control) | Occurs when a key is released.
KeyUpEdit (inherited from C1FlexGridBase) | Fires in edit mode, when the user releases a key.
Layout (inherited from Control) | Occurs when the control is about to lay out its contents.
Leave (inherited from Control) | Occurs when the control is no longer the active control of the form.
LeaveCell (inherited from C1FlexGridBase) | Fires before the current cell changes ( Row and Col properties).
LeaveEdit (inherited from C1FlexGridBase) | Fires after the control leaves edit mode.
LocationChanged (inherited from Control) | Event fired when the value of Location property is changed on Control
LostFocus (inherited from Control) | Occurs when the control gets focus.
MouseDown (inherited from Control) | Occurs when a mouse button is pressed.
MouseEnter (inherited from Control) | Occurs when the mouse enters the visible part of the control.
MouseHover (inherited from Control) | Occurs when the mouse remains stationary inside of the control for an amount of time.
MouseHoverCell (inherited from C1FlexGridBase) | Fires when the mouse enters or leaves a cell.
MouseLeave (inherited from Control) | Occurs when the mouse leaves the visible part of the control.
MouseMove (inherited from Control) | Occurs when the mouse is moved.
MouseUp (inherited from Control) | Occurs when a mouse button is released.
MouseWheel (inherited from Control) | Occurs when the mouse wheel is rolled.
Move (inherited from Control) | Occurs when a control is moved.
OwnerDrawCell (inherited from C1FlexGridBase) | Fires before the grid draws a cell, when the DrawMode property is set to .
Paint (inherited from Control) | Occurs when a control needs repainting.
ParentChanged (inherited from Control) | Event fired when the value of Parent property is changed on Control
PrintPage (inherited from C1FlexGridBase) | Fires after the grid finishes printing a page.
QueryAccessibilityHelp (inherited from Control) | Occurs when an Accessibility client invokes help for the control.
QueryContinueDrag (inherited from Control) | Occurs when the mouse drags an item. The system requests whether the drag and drop operation should be allowed to continue.
Resize (inherited from Control) | Occurs when a control is resized.
RightToLeftChanged (inherited from Control) | Event fired when the value of RightToLeft property is changed on Control
RowColChange (inherited from C1FlexGridBase) | Fires after the current cell changes ( Row and Col properties).
SelChange (inherited from C1FlexGridBase) | Fires after the selection changes ( Row, Col, RowSel, ColSel properties).
SetUnboundValue (inherited from C1FlexGridBase) | Fires when the grid needs to store data in an unbound cell.
SetupEditor (inherited from C1FlexGridBase) | Fires after a cell editor has been initialized by the grid, to allow additional custom initialization.
SizeChanged (inherited from Control) | Event fired when the value of Size property is changed on Control
StartDrag (inherited from C1FlexGridBase) | Fires before the grid starts an automatic OLE drag operation.
StartEdit (inherited from C1FlexGridBase) | Fires before the control enters edit mode.
StyleChanged (inherited from Control) | Event fired when the window style of a Control is changed
SystemColorsChanged (inherited from Control) | Event fired when the system colors change
TabIndexChanged (inherited from Control) | Event fired when the value of TabIndex property is changed on Control
TabStopChanged (inherited from Control) | Event fired when the value of TabStop property is changed on Control
TextChanged (inherited from Control) | Event fired when the value of Text property is changed on Control
Validated (inherited from Control) | Occurs after a control has been successfully validated.
ValidateEdit (inherited from C1FlexGridBase) | Fires before the control exits cell edit mode, while the editor is still active.
Validating (inherited from Control) | Occurs when a control is being validated. Set to True the Cancel property on the event parameter to cancel the validation.
VisibleChanged (inherited from Control) | Occurs when the control's visibility changes.

Protected Properties

ResizeRedraw (inherited from Control)

Indicates whether the control should redraw itself when resized.

Protected Methods

CreateAccessibilityInstance (inherited from C1FlexGridBase) | Creates a new accessibility object for the control.
OnImeStartComposition (inherited from ScrollableControl) | Called when the control receives a WM_IME_STARTCOMPOSITION message.
OnThemeChanged (inherited from C1FlexGridBase) | Called when the control receives a WM_THEMECHANGED message.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridClassic Methods

C1FlexGridClassic Methods

The methods of the C1FlexGridClassic class are listed here. For a complete list of C1FlexGridClassic class members, see the C1FlexGridClassic Members topic.

Public Methods

AutoSizeCols (inherited from C1FlexGridBase) | Overloaded. Adjusts the width of all columns to fit the data.
AutoSizeRows (inherited from C1FlexGridBase) | Overloaded. Adjusts the height of all rows to fit the data.
BeginInit (inherited from C1FlexGridBase) | Signals the object that initialization is starting.
CreateImage (inherited from C1FlexGridBase) | Overloaded. Creates an image of the entire grid.
EndInit (inherited from C1FlexGridBase) | Signals the object that initialization is complete.
FinishEditing (inherited from C1FlexGridBase) | Overloaded. Finishes editing the current cell and takes the grid out of edit mode.
HitTest (inherited from C1FlexGridBase) | Overloaded. Returns information about the control at the current mouse position.
RemoveItem (inherited from C1FlexGridBase) | Overloaded. Removes the last row from the grid.
StartEditing (inherited from C1FlexGridBase) | Overloaded. Puts the grid in edit mode and starts editing the current cell.
GetMergedRange (inherited from C1FlexGrid) | Returns the merged range that contains a given cell.
Clear (inherited from C1FlexGridBase) | Clears the grid.

Protected Methods

CreateAccessibilityInstance (inherited from C1FlexGridBase) | Creates a new accessibility object for the control.
OnImeStartComposition (inherited from ScrollableControl) | Called when the control receives a WM_IME_STARTCOMPOSITION message.
OnThemeChanged (inherited from C1FlexGridBase) | Called when the control receives a WM_THEMECHANGED message.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1FlexGridClassic Properties

C1FlexGridClassic Properties

The properties of the C1FlexGridClassic class are listed here. For a complete list of C1FlexGridClassic class members, see the C1FlexGridClassic Members topic.

Public Properties

AccessibilityObject (inherited from Control) | The accessibility object for this control.
AccessibleDefaultActionDescription (inherited from Control) | The default action description of the control.
AccessibleDescription (inherited from Control) | The description that will be reported to accessibility clients.
AccessibleName (inherited from Control) | The name that will be reported to accessibility clients.
AccessibleRole (inherited from Control) | The role that will be reported to accessibility clients.
AllowAddNew (inherited from C1FlexGridBase) | Gets or sets whether the grid should display a new row template after the last data row.
AllowDelete (inherited from C1FlexGridBase) | Gets or sets whether the grid should monitor the keyboard and handle the DEL key.
AllowFreezing (inherited from C1FlexGridBase) | Gets or sets whether the user is allowed to freeze rows and columns with the mouse.
Anchor (inherited from Control) | The anchor of the control. Anchors define to which edges of the container a certain control is bound. When a control is anchored to an edge, the distance between the control's closest edge and the specified edge will remain constant.
AutoClipboard (inherited from C1FlexGridBase) | Gets or sets whether the grid should handle the clipboard keys and automatically perform cut, copy, paste, and delete operations.
AutoGenerateColumns (inherited from C1FlexGridBase) | Gets or sets whether columns are automatically created when the grid is bound to a data source.
AutoResize (inherited from C1FlexGridBase) | Gets or sets whether column widths are automatically adjusted when data is loaded.
AutoSearch (inherited from C1FlexGridBase) | Gets or sets whether the grid should move the cursor searching for entries as the user types.
AutoSearchDelay (inherited from C1FlexGridBase) | Gets or sets the delay (in seconds) before the AutoSearch buffer is reset.
BackColor (inherited from C1FlexGridBase) | Gets or sets the background color for the control.
BindingContext (inherited from Control) | The binding manager for this container.
BorderStyle (inherited from ScrollableControl) | Gets or sets the type of border around the control.
Bottom (inherited from Control) | The bottom of the control, in container coordinates.
BottomRow (inherited from C1FlexGridBase) | Gets the last visible row in the scrollable area.
Bounds (inherited from Control) | The bounds of the control, in container coordinates.
CanFocus (inherited from Control) | Checks if this control can receive the focus.
CanSelect (inherited from Control) | Checks if this control can be selected.
Capture (inherited from Control) | Determines if this control is currently capturing all mouse input.
CausesValidation (inherited from Control) | Indicates whether this control causes and raises validation events.
ClientRectangle (inherited from Control) | Retrieves the rectangle of the inner area of this control.
ClientSize (inherited from Control) | Determines the size of the inner area of this control.
Clip (inherited from C1FlexGridBase) | Gets or sets the contents of the selected range.
ClipSeparators (inherited from C1FlexGridBase) | Gets or sets the characters used as row and column separators in clip strings.
Col (inherited from C1FlexGridBase) | Gets or sets the column that contains the cursor.
ColSel (inherited from C1FlexGridBase) | Gets or sets the last column in the current selection.
ComboList (inherited from C1FlexGridBase) | Gets or sets the list of items to be used by the drop-down editor.
CompanyName (inherited from Control) | ControlCompanyNameDescr
ContainsFocus (inherited from Control) | Determines if this control or one if its children currently has the focus.
ContextMenu (inherited from Control) | The shortcut menu to display when the user right-clicks the control.
Controls (inherited from Control) | The collection of child controls within this control.
Created (inherited from Control) | Determines if the control has been fully created.
Cursor (inherited from ScrollableControl) | Gets or sets the cursor that appears when the mouse moves over the control.
CursorCell (inherited from C1FlexGridBase) | Gets a CellRange object that contains the cell at coordinates Row, Col.
CustomComparer (inherited from C1FlexGridBase) | Gets or sets a custom comparer object used by the grid to perform grouping, merging, and searching operations.
DataBindings (inherited from Control) | This collection holds all the bindings of properties of this control to data sources.
DataMember (inherited from C1FlexGridBase) | Gets or sets the specific list in a DataSource object that the grid should display.
DataSource (inherited from C1FlexGridBase) | Gets or sets the data source for the grid.
DisplayRectangle (inherited from Control) | Retrieves the display rectangle of this control.
Disposing (inherited from Control) | Determines if this control is in the process of being disposed.
Dock (inherited from Control) | The docking location of the control, indicating which borders are docked to the container.
DoubleBuffer (inherited from C1FlexGridBase) | Gets or sets whether the control should use an off-screen buffer when painting to reduce flicker.
DragMode (inherited from C1FlexGridBase) | Gets or sets a value that determines if the user can drag data from the control.
DrawMode (inherited from C1FlexGridBase) | Gets or sets whether the control should fire the OwnerDrawCell event.
DropMode (inherited from C1FlexGridBase) | Gets or sets a value that determines if the control can accept data that the user drags onto it.
EditMask (inherited from C1FlexGridBase) | Gets or sets the input mask to use when editing cells.
EditOptions (inherited from C1FlexGridBase) | Gets or sets flags that customize the grid's editing behavior.
Editor (inherited from C1FlexGridBase) | Gets or sets a reference to the cell editor that is currently active.
Enabled (inherited from Control) | Indicates whether the control is enabled.
ExtendLastCol (inherited from C1FlexGridBase) | Gets or sets whether the last column should be extended to fill the control.
Focused (inherited from Control) | Determines if this control has focus.
FocusRect (inherited from C1FlexGridBase) | Gets or sets the type of focus rectangle to display.
Font (inherited from Control) | The font used to display text in the control.
ForeColor (inherited from C1FlexGridBase) | Gets or sets the foreground color for the control.
Glyphs (inherited from C1FlexGridBase) | Gets the collection of control glyphs (images used to show sorting, checkboxes, etc).
Handle (inherited from Control) | The native handle for this control.
HasChildren (inherited from Control) | True if this control has child controls in its collection.
Height (inherited from Control) | The height of the control, in container coordinates.
HighLight (inherited from C1FlexGridBase) | Gets or sets when to highlight selected cells.
ImeMode (inherited from Control) | Determines the IME (Input Method Editor) status of the object when selected.
InvokeRequired (inherited from Control) | Determines if Invoke or InvokeAsync should be used to access this control cross-thread.
IsAccessible (inherited from Control) | Determines if this control supports Accessibility.
IsDisposed (inherited from Control) | Determines if this control has been disposed.
IsHandleCreated (inherited from Control) | Determines if the native handle has been created for this control.
Left (inherited from Control) | The upper left of the control, in container coordinates.
LeftCol (inherited from C1FlexGridBase) | Gets or sets the first visible column in the scrollable area.
Location (inherited from Control) | The position of the top-left corner of the control with respect to its container.
MouseCol (inherited from C1FlexGridBase) | Gets the index of the column under the cursor.
MouseRow (inherited from C1FlexGridBase) | Gets the index of the row under the cursor.
Parent (inherited from Control) | The parent of this control.
PrintParameters (inherited from C1FlexGridBase) | Gets a GridPrinter object that specifies printing parameters for the grid.
ProductName (inherited from Control) | Retrieves the name of the product associated with this component.
ProductVersion (inherited from Control) | Retrieves the version of the product associated with this component.
RecreatingHandle (inherited from Control) | Determines if this control is in the process of recreating its handle.
Region (inherited from Control) | The region, or shape, of this control.
Right (inherited from Control) | The upper right of the control, in container coordinates.
RightCol (inherited from C1FlexGridBase) | Gets the last visible column in the scrollable area.
RightToLeft (inherited from Control) | Indicates whether the control should draw right-to-left for RTL languages.
Row (inherited from C1FlexGridBase) | Gets or sets the row that contains the cursor.
RowSel (inherited from C1FlexGridBase) | Gets or sets the last row in the current selection.
ScrollableRectangle (inherited from C1FlexGridBase) | Gets a rectangle that defines the scrollable portion of the control.
ScrollBars (inherited from ScrollableControl) | Gets or sets which scroll bars should appear on the control.
ScrollPosition (inherited from ScrollableControl) | Gets or sets the location of the auto-scroll position.
ScrollTips (inherited from ScrollableControl) | Gets or sets whether the control should display tooltips as the user scrolls vertically.
ScrollTipText (inherited from ScrollableControl) | Gets or sets the tooltip text displayed as the user scrolls vertically.
ScrollTrack (inherited from ScrollableControl) | Gets or sets whether the control should scroll as the user drags the scrollbar thumb.
Selection (inherited from C1FlexGridBase) | Gets the selected range in normalized form.
ShowButtons (inherited from C1FlexGridBase) | Gets or sets when to display combo buttons in cells.
ShowCellLabels (inherited from C1FlexGridBase) | Gets or sets whether the grid should display labels over cells whose contents are partially hidden.
ShowCursor (inherited from C1FlexGridBase) | Gets or sets whether the grid should display a DB-style cursor on the first fixed column.
ShowErrors (inherited from C1FlexGridBase) | Gets or sets whether the grid should display error information in cells and rows.
ShowSort (inherited from C1FlexGridBase) | Gets or sets whether the grid should display sorting glyphs (a triangle) on the headers of sorted columns.
Size (inherited from Control) | The size of the control in pixels.
SubtotalPosition (inherited from C1FlexGridBase) | Gets or sets whether node rows appear above or below the data.
TabIndex (inherited from Control) | Determines the index in the TAB order that this control will occupy.
TabStop (inherited from Control) | Indicates whether the user can use the TAB key to give focus to the control.
Tag (inherited from Control) | User defined data associated with the control.
Top (inherited from Control) | The top of the control, in container coordinates.
TopLevelControl (inherited from Control) | Retrieves the top level control that contains this control.
TopRow (inherited from C1FlexGridBase) | Gets or sets the first visible row in the scrollable area.
Tree (inherited from C1FlexGridBase) | Gets a reference to the GridTree object that controls the appearance of the outline tree in the grid.
Visible (inherited from Control) | Determines whether the control is visible or hidden.
Width (inherited from Control) | The width of the control, in container coordinates.
Item (inherited from C1FlexGridBase) |

Protected Properties

ResizeRedraw (inherited from Control)

Indicates whether the control should redraw itself when resized.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid.Classic Assembly

C1.Win.C1FlexGrid.Classic Assembly

Namespaces

C1.Win.C1FlexGrid.Classic

See Also

C1.Win.C1FlexGrid Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid.Classic Hierarchy

C1.Win.C1FlexGrid.Classic Hierarchy

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

System.Windows.Forms.Control

C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl

C1.Win.C1FlexGrid.C1FlexGridBase ---- C1.C1PrintDocument.ControlPrinters.IC1ControlPrintable, System.ComponentModel.ISupportInitialize

C1.Win.C1FlexGrid.C1FlexGrid

C1.Win.C1FlexGrid.Classic.C1FlexGridClassic

See Also

C1.Win.C1FlexGrid.Classic Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid.Classic Namespace

C1.Win.C1FlexGrid.Classic Namespace

C1.Win.C1FlexGrid.Classic Hierarchy

Classes

Class | Description
C1FlexGridClassic |

See Also

C1.Win.C1FlexGrid.Classic Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid Hierarchy

C1.Win.C1FlexGrid Hierarchy

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

System.Windows.Forms.Control

C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl

C1.Win.C1FlexGrid.C1FlexGridBase ---- C1.C1PrintDocument.ControlPrinters.IC1ControlPrintable, System.ComponentModel.ISupportInitialize

C1.Win.C1FlexGrid.C1FlexGrid

System.EventArgs

C1.Win.C1FlexGrid.BeforeMouseDownEventArgs

C1.Win.C1FlexGrid.DragRowColEventArgs

C1.Win.C1FlexGrid.GetErrorInfoEventArgs

C1.Win.C1FlexGrid.GridChangedEventArgs

C1.Win.C1FlexGrid.GridErrorEventArgs

C1.Win.C1FlexGrid.KeyEditEventArgs

C1.Win.C1FlexGrid.KeyPressEditEventArgs

C1.Win.C1FlexGrid.OwnerDrawCellEventArgs

C1.Win.C1FlexGrid.RangeEventArgs

C1.Win.C1FlexGrid.RowColEventArgs

C1.Win.C1FlexGrid.SortColEventArgs

C1.Win.C1FlexGrid.UnboundValueEventArgs

C1.Win.C1FlexGrid.ValidateEditEventArgs

C1.Win.C1FlexGrid.CellBorder

C1.Win.C1FlexGrid.CellStyle

C1.Win.C1FlexGrid.CellStyleCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.Win.C1FlexGrid.RowCol

C1.Win.C1FlexGrid.Column

C1.Win.C1FlexGrid.Row

C1.Win.C1FlexGrid.RowColCollection ---- System.Collections.IEnumerable

C1.Win.C1FlexGrid.ColumnCollection

C1.Win.C1FlexGrid.RowCollection

C1.Win.C1FlexGrid.GridGlyphs

C1.Win.C1FlexGrid.GridPrinter

C1.Win.C1FlexGrid.GridTree

System.Collections.Specialized.ListDictionary

C1.Win.C1FlexGrid.MultiColumnDictionary ---- C1.Win.C1FlexGrid.IC1MultiColumnDictionary, System.Collections.IDictionary

C1.Win.C1FlexGrid.Node

System.ValueType

C1.Win.C1FlexGrid.CellRange

C1.Win.C1FlexGrid.HitTestInfo

System.Enum

C1.Win.C1FlexGrid.AggregateEnum

C1.Win.C1FlexGrid.AggregateFlags

C1.Win.C1FlexGrid.AllowDraggingEnum

C1.Win.C1FlexGrid.AllowFreezingEnum

C1.Win.C1FlexGrid.AllowMergingEnum

C1.Win.C1FlexGrid.AllowResizingEnum

C1.Win.C1FlexGrid.AllowSortingEnum

C1.Win.C1FlexGrid.AutoSearchEnum

C1.Win.C1FlexGrid.AutoSizeFlags

C1.Win.C1FlexGrid.BorderDirEnum

C1.Win.C1FlexGrid.BorderStyleEnum

C1.Win.C1FlexGrid.CellStyleEnum

C1.Win.C1FlexGrid.CheckEnum

C1.Win.C1FlexGrid.ClearFlags

C1.Win.C1FlexGrid.DisplayEnum

C1.Win.C1FlexGrid.DragModeEnum

C1.Win.C1FlexGrid.DrawCellFlags

C1.Win.C1FlexGrid.DrawModeEnum

C1.Win.C1FlexGrid.DropModeEnum

C1.Win.C1FlexGrid.EditFlags

C1.Win.C1FlexGrid.FileFlags

C1.Win.C1FlexGrid.FileFormatEnum

C1.Win.C1FlexGrid.FocusRectEnum

C1.Win.C1FlexGrid.GlyphEnum

C1.Win.C1FlexGrid.GridChangedTypeEnum

C1.Win.C1FlexGrid.HighLightEnum

C1.Win.C1FlexGrid.HitTestTypeEnum

C1.Win.C1FlexGrid.ImageAlignEnum

C1.Win.C1FlexGrid.KeyActionEnum

C1.Win.C1FlexGrid.MoveCursorEnum

C1.Win.C1FlexGrid.NodeMoveEnum

C1.Win.C1FlexGrid.NodeTypeEnum

C1.Win.C1FlexGrid.PrintGridFlags

C1.Win.C1FlexGrid.SelectionModeEnum

C1.Win.C1FlexGrid.ShowButtonsEnum

C1.Win.C1FlexGrid.SortFlags

C1.Win.C1FlexGrid.StyleElementFlags

C1.Win.C1FlexGrid.SubtotalPositionEnum

C1.Win.C1FlexGrid.TextAlignEnum

C1.Win.C1FlexGrid.TextDirectionEnum

C1.Win.C1FlexGrid.TextEffectEnum

C1.Win.C1FlexGrid.TreeStyleFlags

System.Delegate

System.MulticastDelegate

C1.Win.C1FlexGrid.BeforeMouseDownEventHandler

C1.Win.C1FlexGrid.DragRowColEventHandler

C1.Win.C1FlexGrid.GetErrorInfoEventHandler

C1.Win.C1FlexGrid.GridChangedEventHandler

C1.Win.C1FlexGrid.GridErrorEventHandler

C1.Win.C1FlexGrid.KeyEditEventHandler

C1.Win.C1FlexGrid.KeyPressEditEventHandler

C1.Win.C1FlexGrid.OwnerDrawCellEventHandler

C1.Win.C1FlexGrid.RangeEventHandler

C1.Win.C1FlexGrid.RowColEventHandler

C1.Win.C1FlexGrid.SortColEventHandler

C1.Win.C1FlexGrid.UnboundValueEventHandler

C1.Win.C1FlexGrid.ValidateEditEventHandler

See Also

C1.Win.C1FlexGrid Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid.Util.BaseControls Hierarchy

C1.Win.C1FlexGrid.Util.BaseControls Hierarchy

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

System.Windows.Forms.Control

C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl

System.ValueType

System.Enum

C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum

See Also

C1.Win.C1FlexGrid.Util.BaseControls Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1FlexGrid.Util.Styles Hierarchy

C1.Win.C1FlexGrid.Util.Styles Hierarchy

System.Object

C1.Win.C1FlexGrid.Util.Styles.Style

See Also

C1.Win.C1FlexGrid.Util.Styles Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CellAlignment Property - C#

C#

//select rows 1 through 7 in Column 3

fg.Select 1, 3, 7, 3;

fg.FillStyle = FillStyleSettings.flexFillRepeat;

df.CellAlignment = AlignmentSettings.flexAlignCenterCenter;

//return .FillStyle to its default (if needed)

fg.FillStyle = FillStyleSettings.flexFillSingle;

} With


CellAlignment Property - Delphi

Delphi

With fg do

begin

  // select rows 1 through 7 in
Column 3
Select(1, 3, 7, 3);
FillStyle := FillStyleSettings.flexFillRepeat;
CellAlignment := AlignmentSettings.flexAlignCenterCenter;
// return .FillStyle to its default (if
needed)
FillStyle :=
FillStyleSettings.flexFillSingle;
end;


CellAlignment Property - Visual Basic

Visual Basic

With fg
'select rows 1 through 7 in Column 3
.Select 1, 3, 7, 3
.FillStyle = FillStyleSettings.flexFillRepeat
.CellAlignment = AlignmentSettings.flexAlignCenterCenter
'return .FillStyle to its default (if needed)
.FillStyle = FillStyleSettings.flexFillSingle
End With


Cell appearance - C#

C#

CellStyle cs = fg.Styles.Highlight;

cs.Font = new Font(fg.Font, FontStyle.Bold);

cs.ForeColor = Color.Green;

cs.BackColor = Color.Red;


Cell appearance - C#2

C#

CellStyle cs = fg.Styles.Add("Fifth");

cs.BackColor = Color.Gray;

for (int index = fg.Rows.Fixed ; index <= fg.Rows.Count – 1; index += 5){

fg.Rows[index].Style = cs;


Cell appearance - C#3

C#

// create a new custom style

CellStyle s = _flex.Styles.Add("MyStyle");

s.BackColor = Color.Red;

s.ForeColor = Color.White;

// assign new style to a column

_flex.Cols[3].Style = _flex.Styles["MyStyle"];

// assign new style to a row

_flex.Rows[3].Style = _flex.Styles["MyStyle"];

// assign new style to a cell range

CellRange rg = _flex.GetCellRange(4,4,6,6);

rg.Style = _flex.Styles["MyStyle"];


Cell appearance - Delphi

Delphi

var

cs: CellStyle;

begin

cs := fg.Styles.Highlight;

cs.Font := Font.Create(fg.Font, FontStyle.Bold);

cs.ForeColor := Color.Green;

cs.BackColor := Color.Red;

end;


Cell appearance - Delphi2

Delphi

var

fg: System.Object;

cs: CellStyle;

begin

cs := fg.Styles.Add('Fifth');

cs.BackColor := Color.Gray;

index := fg.Rows.Fixed; while (idex < fg.Rows.Count) do

begin

fg.Rows[index].Style := cs;

end;

end;


Cell appearance - Delphi3

Delphi

var

rg: CellRange;

s: CellStyle;

begin

s := _flex.Styles.Add('MyStyle');

s.BackColor := Color.Red;

s.ForeColor := Color.White;

_flex.Cols[3].Style := _flex.Styles['MyStyle'];

_flex.Rows[3].Style := _flex.Styles['MyStyle'];

rg := _flex.GetCellRange(4, 4, 6, 6);

rg.Style := _flex.Styles['MyStyle'];

end;


Cell appearance - Visual Basic

Visual Basic

Dim cs As CellStyle = fg.Styles.Highlight

cs.Font = New Font(fg.Font, FontStyle.Bold)

cs.ForeColor = Color.Green

cs.BackColor = Color.Red


Cell appearance - Visual Basic2

Visual Basic

Dim cs As CellStyle = fg.Styles.Add("Fifth")

cs.BackColor = Color.Gray

Dim idex%

For idex = fg.Rows.Fixed To fg.Rows.Count - 1 Step 5

fg.Rows(idex).Style = cs

Next


Cell appearance - Visual Basic3

Visual Basic

' create a new custom style

Dim s As CellStyle = _flex.Styles.Add("MyStyle")

s.BackColor = Color.Red

s.ForeColor = Color.White

' assign new style to a column

_flex.Cols(3).Style = _flex.Styles("MyStyle") '

' assign new style to a row

_flex.Rows(3).Style = _flex.Styles("MyStyle") '

' assign new style to a cell range

Dim rg As CellRange = _flex.GetCellRange(4, 4, 6, 6)

rg.Style = _flex.Styles("MyStyle")


CellBackColor Property - C#

C#

fg.CellBackColor = System.Drawing.Color.Red;


CellBackColor Property - C#2

C#

fg.Select (1, 3, 7, 3);

fg.FillStyle = FillStyleSettings.flexFillRepeat;

fg.CellBackColor = System.Drawing.Color.Red;

//return .FillStyle to its default (if needed)

fg.FillStyle = FillStyleSettings.flexFillSingle;

//Make cell 1, 1 the current cell so we can view the change

fg.Select (1, 1);


CellBackColor Property - Delphi

Delphi

fg.CellBackColor := System.Drawing.Color.Red;


CellBackColor Property - Delphi2

Delphi

With fg do

begin

Select (1, 3, 7, 3);
FillStyle := FillStyleSettings.flexFillRepeat;
CellBackColor := System.Drawing.Color.Red;
// return .FillStyle to its default (if needed)
FillStyle := FillStyleSettings.flexFillSingle;
// Make cell 1, 1 the current cell so we can view the change
Select (1, 1);
end;


CellBackColor Property - Visual Basic

Visual Basic

fg.CellBackColor = System.Drawing.Color.Red


CellBackColor Property - Visual Basic2

Visual Basic

With fg
.Select (1, 3, 7, 3)
.FillStyle = FillStyleSettings.flexFillRepeat
.CellBackColor = System.Drawing.Color.Red
'return .FillStyle to its default (if needed)
.FillStyle = FillStyleSettings.flexFillSingle
'Make cell 1, 1 the current cell so we can view the change
.Select (1, 1)
End With


Cell Buttons - C#

C#

// set up date column

Col c = fg.Cols[1];

c.DataType = typeof(Color);

c.ComboList = "...";// << show cell button


Cell Buttons - C#2

C#

private void fg_CellButtonClick( object sender, RowColEventArgs e) fg.CellButtonClick {

// create color picker dialog

ColorDialog clrDlg = new ColorDialog();

// initialize the dialog

if ( fg(e.Row, e.Col) Is typeof(Color) )

{

clrDlg.Color = fg(e.Row, e.Col);

}

// get new color from dialog and assign it to the cell

if ( clrDlg.ShowDialog() = DialogResult.OK )

{

fg(e.Row, e.Col) = clrDlg.Color;

}

}


Cell Buttons - Delphi

Delphi

var

c: Col;

begin

c := fg.Cols[1];

c.DataType := TypeOf(Color);

c.ComboList := '...';

end;


Cell Buttons - Delphi2

Delphi

procedure fg_CellButtonClick(sender: System.Object; _

e: RowColEventArgs);

var

clrDlg: ColorDialog;

begin

// create color picker dialog

clrDlg := ColorDialog.Create;

// initialize the dialog

If fg[e.Row, e.Col] Is Color Then

clrDlg.Color := fg[e.Row, e.Col];

// get new color from dialog and assign it to the cell

If clrDlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then

fg[e.Row, e.Col] := clrDlg.Color

end;


Cell Buttons - Visual Basic

Visual Basic

' set up date column

Dim c As Col = fg.Cols(1)

c.DataType = GetType(Color)

c.ComboList = "..." ' << show cell button


Cell Buttons - Visual Basic2

Visual Basic

Private Sub fg_CellButtonClick(ByVal sender As Object, _

ByVal e As RowColEventArgs) Handles fg.CellButtonClick

' create color picker dialog

Dim clrDlg As New ColorDialog()

' initialize the dialog

If fg(e.Row, e.Col) Is GetType(Color) Then

clrDlg.Color = fg(e.Row, e.Col)

End If

' get new color from dialog and assign it to the cell

If clrDlg.ShowDialog() = DialogResult.OK Then

fg(e.Row, e.Col) = clrDlg.Color

End If

End Sub


CellChecked Property - C#

C#

private void Form1_Load( System.object sender, System.EventArgs e) {

r&;

for ( r = fg.FixedRows; r <= fg.Rows - 1

fg.set_Cell(CellPropertySettings.flexcpChecked,

r, 1, CellPropertySettings.flexcpChecked);

fg.set_Cell(CellPropertySettings.flexcpText, r, 1, "Row " + r);

}

fg.Editable = EditableSettings.flexEDKbdMouse;

}

private void Button1_Click( System.object sender, System.EventArgs e)

{

for (int r = fg.FixedRows; r <= fg.Rows – 1; r++)

{

if ( fg.get_Cell(CellPropertySettings.flexcpChecked, r, 1) ==

CellPropertySettings.flexcpChecked ) {

Console.WriteLine(fg.get_TextMatrix(1, 1) + " is checked");

}

}

}


CellChecked Property - Delphi

Delphi

procedure Form1_Load(sender: System.Object; e: System.EventArgs);

var

r: Integer;

begin

For r := fg.FixedRows To fg.Rows – 1 do

begin

fg.set_Cell(CellPropertySettings.flexcpChecked, _

r, 1, CellPropertySettings.flexcpChecked);

fg.set_Cell(CellPropertySettings.flexcpText, r, 1, 'Row ' + System.Object(r).ToString)

end;

fg.Editable := EditableSettings.flexEDKbdMouse

end;

procedure Button1_Click(sender: System.Object;

e: System.EventArgs);

var

r: Integer;

begin

For r := fg.FixedRows To fg.Rows – 1 do

begin

If fg.get_Cell(CellPropertySettings.flexcpChecked, r, 1) = _

CellPropertySettings.flexcpChecked Then

Debug.WriteLine(fg.get_TextMatrix(1, 1).ToString + " is checked")

end;

end;


CellChecked Property - Visual Basic

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

Dim r&

For r = fg.FixedRows To fg.Rows - 1

fg.set_Cell(CellPropertySettings.flexcpChecked, _

r, 1, CellPropertySettings.flexcpChecked)

fg.set_Cell(CellPropertySettings.flexcpText, r, 1, "Row " & r)

Next

fg.Editable = EditableSettings.flexEDKbdMouse

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles Button1.Click

Dim r&

For r = fg.FixedRows To fg.Rows - 1

If fg.get_Cell(CellPropertySettings.flexcpChecked, r, 1) = _

CellPropertySettings.flexcpChecked Then

Debug.WriteLine(fg.get_TextMatrix(1, 1) & " is checked")

End If

Next

End Sub


Cell content - C#

C#

fg.Cols[1].Format = "d"; // << short date

fg.Cols[2].Format = "c"; // << currency


Cell content - C#2

C#

fg.Cols[1].Format = "d"; // << short date

fg.Cols[2].Format = "c"; // << currency

fg[1, 2] = 10000;

Console.WriteLine("Raw value: {0}", fg[1, 2]);

Console.WriteLine("Display value: {0}", fg.GetDataDisplay(1, 2));

Raw value: 10000;

Display value: $10,000.00;


Cell content - Delphi

Delphi

fg.Cols[1].Format := 'd';

fg.Cols[2].Format := 'c';


Cell content - Delphi2

Delphi

var

value: Raw;

begin

fg.Cols[1].Format := "d"; // << short date

fg.Cols[2].Format := "c"; // << currency

fg[1, 2] := 10000;

Console.WriteLine('Raw value: {0}', fg[1, 2]);

Console.WriteLine('Display value: {0}', fg.GetDataDisplay(1, 2));

end;


Cell content - Visual Basic

Visual Basic

fg.Cols(1).Format = "d" ' << short date

fg.Cols(2).Format = "c" ' << currency


Cell content - Visual Basic2

Visual Basic

fg.Cols(1).Format = "d" ' << short date

fg.Cols(2).Format = "c" ' << currency

fg(1, 2) = 10000

Console.WriteLine("Raw value: {0}", fg(1, 2))

Console.WriteLine("Display value: {0}", fg.GetDataDisplay(1, 2))

Raw value: 10000

Display value: $10,000.00


Cell Ranges - C#

C#

CellRange rg = fg.GetCellRange(3, 3, 10, 10);

rg.Data = null;

rg.Style = fg.Styles["MyRangeStyle"];


Cell Ranges - C#2

C#

CellRange rg = fg.GetCellRange(3, 3, 10, 10);

rg.StyleNew.BackColor = Color.Red;


Cell Ranges - Delphi

Delphi

var

rg: CellRange;

begin

rg := fg.GetCellRange(3, 3, 10, 10);

rg.Data := nil;

rg.Style := fg.Styles['MyRangeStyle'];

end;


Cell Ranges - Delphi2

Delphi

var

rg: CellRange;

begin

rg := fg.GetCellRange(3, 3, 10, 10);

rg.StyleNew.BackColor := Color.Red;

end;


CellRange Struct - C#

C#

// create new custom cell style

CellStyle st = flex.Styles.Add("MyStyle");

st.Font = new Font("Tahoma", 14);

// assign new style to a group of cells

CellRange rg = flex.GetCellRange(1,1,10,10);

rg.Style = st;


CellRange Struct - Delphi

Delphi

var

rg: CellRange;

st: CellStyle;

begin

st := flex.Styles.Add('MyStyle');

st.Font := Font.Create('Tahoma', 14);

// assign new style to a group of cells

rg := flex.GetCellRange(1, 1, 10, 10);

rg.Style := st;

end;


CellRange Struct - Visual Basic

Visual Basic

' create new custom cell style

Dim st As CellStyle = flex.Styles.Add("MyStyle")

st.Font = New Font("Tahoma", 14)

' assign new style to a group of cells

Dim rg As CellRange = flex.GetCellRange(1, 1, 10, 10)

rg.Style = st


Cell Ranges - Visual Basic

Visual Basic

Dim rg As CellRange = fg.GetCellRange(3, 3, 10, 10)

rg.Data = Nothing

rg.Style = fg.Styles("MyRangeStyle")


Cell Ranges - Visual Basic2

Visual Basic

Dim rg As CellRange = fg.GetCellRange(3, 3, 10, 10)

rg.StyleNew.BackColor = Color.Red


ChangeEdit Event - C#

C#

// set up grid styles to allow wordwrapping:

private void Form1_Load(object sender, System.EventArgs e)

{

flex.Styles.Normal.WordWrap = true;

}

// after editing a row, do an AutoSizeRow

private void flex_AfterEdit(object sender, RowColEventArgs e)

{

flex.AutoSizeRow(e.Row);

}

// while editing, adjust the row height to fit the contents of the editor

private void flex_ChangeEdit(object sender, System.EventArgs e)

{

using (Graphics g = flex.CreateGraphics())

{

// measure text height

StringFormat sf = new StringFormat();

int wid = flex.Cols[flex.Col].WidthDisplay - 2;

string text = flex.Editor.Text;

SizeF sz = g.MeasureString(text, flex.Font, wid, sf);

// adjust row height if necessary

Row row = flex.Rows[flex.Row];

if (sz.Height + 4 > row.HeightDisplay)

row.HeightDisplay = (int)sz.Height + 4;

}

}


ChangeEdit Event - Delphi

Delphi

// set up grid styles to allow wordwrapping:

procedure Form1_Load(sender: System.Object; e: System.EventArgs);

begin

flex.Styles.Normal.WordWrap := True;

end;

// after editing a row, do an AutoSizeRow

procedure flex_AfterEdit(sender: System.Object; e: RowColEventArgs);

begin

flex.AutoSizeRow(e.Row);

end;

// while editing, adjust the row height to fit the contents of the editor

procedure flex_ChangeEdit(sender: System.Object; e: System.EventArgs);

var

g: Graphics;

sf: StringFormat;

wid: Integer;

txt: string;

sz: SizeF;

r: Row;

begin

g := flex.CreateGraphics;

Try

// measure text height

sf := StringFormat.Create;

wid := flex.Cols[flex.Col].WidthDisplay – 2;

txt := flex.Editor.Text;

sz := g.MeasureString(txt, flex.Font, wid, sf);

// adjust row height if necessary

r := flex.Rows[flex.Row];

If sz.Height + 4 > row.HeightDisplay Then

row.HeightDisplay := Integer(sz.Height) + 4;

Finally

g.Dispose;

end;

end;


ChangeEdit Event - Visual Basic

Visual Basic

' set up grid styles to allow wordwrapping:

Private Sub Form1_Load(sender As Object, e As System.EventArgs)

flex.Styles.Normal.WordWrap = True

End Sub

' after editing a row, do an AutoSizeRow

Private Sub flex_AfterEdit(sender As Object, e As RowColEventArgs)

flex.AutoSizeRow(e.Row)

End Sub

' while editing, adjust the row height to fit the contents of the editor

Private Sub flex_ChangeEdit(sender As Object, e As System.EventArgs)

Dim g As Graphics = flex.CreateGraphics()

Try

' measure text height

Dim sf As New StringFormat()

Dim wid As Integer = flex.Cols(flex.Col).WidthDisplay - 2

Dim [text] As String = flex.Editor.Text

Dim sz As SizeF = g.MeasureString([text], flex.Font, wid, sf)

' adjust row height if necessary

Dim row As Row = flex.Rows(flex.Row)

If sz.Height + 4 > row.HeightDisplay Then

row.HeightDisplay = CInt(sz.Height) + 4

End If

Finally

g.Dispose()

End Try

End Sub


Checkboxes - C#

C#

fg.Cols["bools"].Format = "Yes;No";


Checkboxes - Delphi

Delphi

fg.Cols['bools'].Format := 'Yes;No';


Checkboxes - Visual Basic

Visual Basic

fg.Cols("bools").Format = "Yes;No"


Clearing a Tree View - C#

C#

flex.Rows.Count = flex.Rows.Fixed;


Clearing a Tree View - Delphi

Delphi

flex.Rows.Count := flex.Rows.Fixed;


Clearing a Tree View - Visual Basic

Visual Basic

flex.Rows.Count = flex.Rows.Fixed


Clear Method - C#

C#

r1&, c1&, r2&, c2&;

fg.set_Cell(CellPropertySettings.flexcpText, r1, C1, r2, c2, "");

fg.set_Cell(CellPropertySettings.flexcpCustomFormat, r1, C1, r2, c2, false);


Clear Method - C#2

C#

fg.Clear(ClearWhereSettings.flexClearSelection, ClearWhatSettings.flexClearText);


Clear Method - Delphi

Delphi

var

r1, c1, r2, c2: Integer;

begin

fg.set_Cell(CellPropertySettings.flexcpText, r1, C1, r2, c2, '');

fg.set_Cell(CellPropertySettings.flexcpCustomFormat, r1, C1, r2, c2, False);

end;


Clear Method - Delphi2

Delphi

fg.Clear(ClearWhereSettings.flexClearSelection, ClearWhatSettings.flexClearText);


Clear Method - Visual Basic

Visual Basic

Dim r1&, c1&, r2&, c2&

fg.set_Cell(CellPropertySettings.flexcpText, r1, C1, r2, c2, "")
fg.set_Cell(CellPropertySettings.flexcpCustomFormat, r1, C1, r2, c2, False)


Clear Method - Visual Basic2

Visual Basic

fg.Clear(ClearWhereSettings.flexClearSelection, ClearWhatSettings.flexClearText)


Clip Property - C#

C#

// build clip string

string s = "1st" + "\t" + "a" + "\n" + "2nd" + "\t" + "b";

// paste it over current selection

flex.Clip = s;


Clip Property - C#2

C#

// build clip string

CellRange rg = flex.GetCellRange(1,1,10,10);

MessageBox.Show(rg.Text);


Clip Property - Delphi

Delphi

var

s: string;

begin

s := '1st' + #9 + 'a' + #10 + '2nd' + #9 + 'b';

flex.Clip := s;

end;


Clip Property - Delphi2

Delphi

var

rg: CellRange;

begin

rg := flex.GetCellRange(1, 1, 10, 10);

MessageBox.Show(rg.Text);

end;


Clip Property - Visual Basic

Visual Basic

' build clip string

Dim s As String = "1st" + vbTab + "a" +vbLf + "2nd" +vbTab + "b"

' paste it over current selection

flex.Clip = s


Clip Property - Visual Basic2

Visual Basic

' build clip string

Dim rg As CellRange = flex.GetCellRange(1, 1, 10, 10)

MessageBox.Show(rg.Text)


ColAlignment Property - C#

C#

fg.set_ColAlignment(2, AlignmentSettings.flexAlignRightBottom);


ColAlignment Property - Delphi

Delphi

fg.set_ColAlignment(2, AlignmentSettings.flexAlignRightBottom);


ColAlignment Property - Visual Basic

Visual Basic

fg.set_ColAlignment(2, AlignmentSettings.flexAlignRightBottom)


ColFormat Property - C#

C#

private void Form1_Load( System.object sender, System.EventArgs e) {

// format numbers

fg.set_ColFormat(1, "#,###.##"); // number with thousand separators

fg.set_ColFormat(2, "#.###%"); // percentage

fg.set_ColFormat(3, "#,.##"); // thousands

fg.set_ColFormat(4, "Currency"); // thousands

// format booleans

fg.set_ColDataType(5, typeof(bool));

fg.set_ColFormat(5, "Probably;Hardly"); //bool

// format dates

fg.set_ColFormat(6, "ddd, mmmm d, yyyy");

fg.set_ColFormat(7, "Medium Date");

fg.set_ColFormat(8, "Medium Time");

// set some cells

fg.set_TextMatrix(1, 1, 1234.56);

fg.set_TextMatrix(1, 2, 0.5432);

fg.set_TextMatrix(1, 3, 125250);

fg.set_TextMatrix(1, 4, -1234.5);

fg.set_TextMatrix(1, 5, true);

ffg.set_TextMatrix(1, 6, #7/4/1969#);

fg.set_TextMatrix(1, 7, #7/4/1969#);

fg.set_TextMatrix(1, 8, #7/4/1969#);

// display results:

i%;

Console.WriteLine("Format"; Tab(20); "Content"; Tab(40); "Display");

Console.WriteLine("-----------"; Tab(20); "-----------"; Tab(40); "-------------");

for ( i = 1; i <= 8

Console.WriteLine(fg.get_ColFormat(i); Tab(20); ;

fg.Cell(flexcpText, 1, i); Tab(40); fg.Cell(flexcpTextDisplay, 1, i));

}

}


ColFormat Property - Delphi

Delphi

procedure Form1_Load(sender: System.Object; e: System.EventArgs);
var

i: Integer;

begin
// format numbers
fg.set_ColFormat(1, '#,###.##') // number with thousand separators
fg.set_ColFormat(2, '#.###%') // percentage
fg.set_ColFormat(3, '#,.##') // thousands
fg.set_ColFormat(4, 'Currency') // thousands

// format booleans
fg.set_ColDataType(5, GetType(Boolean))
fg.set_ColFormat(5, 'Probably;Hardly') // Boolean

// format
dates
fg.set_ColFormat(6, 'ddd, mmmm d, yyyy');
fg.set_ColFormat(7, 'Medium Date');
fg.set_ColFormat(8, 'Medium
Time');

// set some
cells
fg.set_TextMatrix(1, 1, 1234.56);
fg.set_TextMatrix(1, 2, 0.5432);
fg.set_TextMatrix(1, 3,
125250);
fg.set_TextMatrix(1, 4, -1234.5);
fg.set_TextMatrix(1, 5, True);
ffg.set_TextMatrix(1, 6,
System.DateTime.Parse('7/4/1969'));
fg.set_TextMatrix(1, 7,
System.DateTime.Parse('7/4/1969'));
fg.set_TextMatrix(1, 8,
System.DateTime.Parse('7/4/1969'));

//
display results:
For i := 1 To 8 do

begin

  Debug.WriteLine(fg.get_ColFormat(i),
Tab(20),
fg.Cell(flexcpText, 1, i);
Tab(40),
fg.Cell(flexcpTextDisplay, 1,
i))
end;
end;


ColFormat Property - Visual Basic

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

' format numbers
fg.set_ColFormat(1, "#,###.##") ' number with thousand separators
fg.set_ColFormat(2, "#.###%") ' percentage
fg.set_ColFormat(3, "#,.##") ' thousands
fg.set_ColFormat(4, "Currency") ' thousands

' format booleans
fg.set_ColDataType(5, GetType(Boolean))
fg.set_ColFormat(5, "Probably;Hardly") 'Boolean

' format dates
fg.set_ColFormat(6, "ddd, mmmm d, yyyy")
fg.set_ColFormat(7, "Medium Date")
fg.set_ColFormat(8, "Medium Time")

' set some cells
fg.set_TextMatrix(1, 1, 1234.56)
fg.set_TextMatrix(1, 2, 0.5432)
fg.set_TextMatrix(1, 3, 125250)
fg.set_TextMatrix(1, 4, -1234.5)
fg.set_TextMatrix(1, 5, True)
ffg.set_TextMatrix(1, 6, #7/4/1969#)
fg.set_TextMatrix(1, 7, #7/4/1969#)
fg.set_TextMatrix(1, 8, #7/4/1969#)

' display results:
Dim i%
Debug.WriteLine("Format"; Tab(20); "Content"; Tab(40); "Display")
Debug.WriteLine("-----------"; Tab(20); "-----------"; Tab(40); "-------------")
For i = 1 To 8
Debug.WriteLine(fg.get_ColFormat(i); Tab(20);
fg.Cell(flexcpText, 1, i); Tab(40); _
fg.Cell(flexcpTextDisplay, 1, i))
Next
End Sub


ColHidden Property - C#

C#

fg.set_ColHidden(1, true);


ColHidden Property - Delphi

Delphi

fg.set_ColHidden(1, True);


ColHidden Property - Visual Basic

Visual Basic

fg.set_ColHidden(1, True)


ColIndex Property - C#

C#

private void fg_MouseMove( object sender, MouseEventArgs e) fg.MouseMove

{

c%;

c = fg.get_ColIndex("Counter");

fg.set_TextMatrix(1, c, fg.get_ValueMatrix(1, c) + 1);

}

private void Form1_Load( System.object sender, System.EventArgs e)

{

fg.ExplorerBar = ExplorerBarSettings.flexExMove;

fg.set_TextMatrix(0, 1, "Counter");

fg.set_ColKey(1, "Counter");

}


ColIndex Property - C#2

C#

fg.set_ColAlignment(fg.get_ColIndex("CategoryID"), C1.Win.C1FlexGrid.Classic.AlignmentSettings.flexAlignCenterCenter);


ColIndex Property - Delphi

Delphi

procedure fg_MouseMove(sender: System.Object; e: MouseEventArgs);

var

c: Integer;

begin

c := fg.get_ColIndex('Counter');
fg.set_TextMatrix(1, c, fg.get_ValueMatrix(1, c) + 1);
end;

procedure Form1_Load(sender: System.Object; e: System.EventArgs);
begin

fg.ExplorerBar := ExplorerBarSettings.flexExMove;
fg.set_TextMatrix(0, 1, 'Counter');
fg.set_ColKey(1, 'Counter');
end;


ColIndex Property - Delphi2

Delphi

fg.set_ColAlignment(fg.get_ColIndex('CategoryID'), C1.Win.C1FlexGrid.Classic.AlignmentSettings.flexAlignCenterCenter);


ColIndex Property - Visual Basic

Visual Basic

Private Sub fg_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) _

Handles fg.MouseMove
Dim c%
c = fg.get_ColIndex("Counter")
fg.set_TextMatrix(1, c, fg.get_ValueMatrix(1, c) + 1)
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
fg.ExplorerBar = ExplorerBarSettings.flexExMove
fg.set_TextMatrix(0, 1, "Counter")
fg.set_ColKey(1, "Counter")
End Sub


ColIndex Property - Visual Basic2

Visual Basic

fg.set_ColAlignment(fg.get_ColIndex("CategoryID"), C1.Win.C1FlexGrid.Classic.AlignmentSettings.flexAlignCenterCenter)


ColIsVisible Property - C#

C#

if ( fg.get_ColIsVisible(1) ) {

Console.WriteLine("Column 1 is visible");

}


ColIsVisible Property - Delphi

Delphi

begin

if fg.get_ColIsVisible(1) then

Console.WriteLine('Column 1 is visible');

end;


ColIsVisible Property - Visual Basic

Visual Basic

If fg.get_ColIsVisible(1) Then

Debug.WriteLine("Column 1 is visible")

End If


ColPosition Property - C#

C#

void InsertCol(pos%) {

fg.Cols = fg.Cols + 1;

fg.set_ColPosition(fg.Cols - 1, pos) ;

fg.set_TextMatrix(0, pos, "new " + fg.Cols) ;

}


ColPosition Property - Delphi

Delphi

procedure InsertCol(pos: Integer);

begin

fg.Cols := (fg.Cols + 1);

fg.set_ColPosition((fg.Cols - 1), pos);

fg.set_TextMatrix(0, pos, 'new ' + fg.Cols.ToString);

end;


ColPosition Property - Visual Basic

Visual Basic

Sub InsertCol(pos%)
fg.Cols = fg.Cols +
1
fg.set_ColPosition(fg.Cols - 1, pos)
fg.set_TextMatrix(0, pos, "New " & fg.Cols)
End Sub


ColSel Property - C#

C#

CellRange rg = flex.Selection;

for (int r = rg.r1; r <= rg.r2; r++)

for (int c = rg.c1; c <= rg.c2; c++)

Console.WriteLine("the value at {0} {1} is {2}", r, c, flex[r, c]);


ColSel Property - Delphi

Delphi

var

c: Integer;

r: Integer;

rg: CellRange;

begin

rg := flex.Selection;

for r := rg.r1 to rg.r2 do

for c := rg.c1 to rg.c2 do

Console.WriteLine('the value at {0} {1} is {2}', r, c, flex[r]);

end;


ColSel Property - Visual Basic

Visual Basic

Dim rg As CellRange = flex.Selection

Dim r As Integer

For r = rg.r1 To rg.r2

Dim c As Integer

For c = rg.c1 To rg.c2

Console.WriteLine("the value at {0} {1} is {2}", r, c, flex(r, c))

Next c

Next r


ColSort Property - C#

C#

private void Form1_Load( System.object sender, System.EventArgs e)

{

fg.Cols = 4;

fg.set_ColSort(1, SortSettings.flexSortGenericAscending);

fg.set_ColSort(2, SortSettings.flexSortNone);

fg.set_ColSort(3, SortSettings.flexSortGenericDescending);

}

private void Button1_Click( System.object sender, System.EventArgs e) Button1.Click

{

fg.Select (1, 1, 1, 3);

fg.Sort = SortSettings.flexSortUseColSort;

}


ColSort Property - Delphi

Delphi

procedure Form1_Load(sender: System.Object; e: System.EventArgs);

begin

fg.Cols := 4;
fg.set_ColSort(1, SortSettings.flexSortGenericAscending);
fg.set_ColSort(2, SortSettings.flexSortNone);
fg.set_ColSort(3, SortSettings.flexSortGenericDescending);
end;

procedure Button1_Click(sender: System.Object;
e: System.EventArgs);

begin
fg.Select (1, 1, 1, 3);
fg.Sort := SortSettings.flexSortUseColSort;
End;


ColSort Property - Visual Basic

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

fg.Cols = 4
fg.set_ColSort(1, SortSettings.flexSortGenericAscending)
fg.set_ColSort(2, SortSettings.flexSortNone)
fg.set_ColSort(3, SortSettings.flexSortGenericDescending)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
fg.Select (1, 1, 1, 3)
fg.Sort = SortSettings.flexSortUseColSort
End Sub


ColWidthMax Property - C#

C#

fg.ColWidthMax = 2880;


ColWidthMax Property - Delphi

Delphi

fg.ColWidthMax := 2880;


ColWidthMax Property - Visual Basic

Visual Basic

fg.ColWidthMax = 2880


ColWidthMin Property - C#

C#

fg.ColWidthMin = 720;


ColWidthMin Property - Delphi

Delphi

fg.ColWidthMin := 720;


ColWidthMin Property - Visual Basic

Visual Basic

fg.ColWidthMin = 720


ColWidth Property - C#

C#

fg.set_ColWidth(2, 1440);


ColWidth Property - Delphi

Delphi

fg.set_ColWidth(2, 1440);


ColWidth Property - Visual Basic

Visual Basic

fg.set_ColWidth(2, 1440)


ComboList Property - C#

C#

flex.ComboList = "ListItem 1|ListItem 2";


ComboList Property - C#2

C#

flex.ComboList = "|ComboItem 1|ComboItem 2";


ComboList Property - C#3

C#

flexComboList = "...";


ComboList Property - C#4

C#

flexComboList = "|...";


ComboList Property - C#5

C#

private void _flex_BeforeEdit(object sender, RowColEventArgs e)

{

_flex.ComboList = (e.Row % 2 == 0)? "..." : "";

}


ComboList Property (CellStyle) - C#

C#

CellStyle s = _flex.Styles.Add("TheList");

s.ComboList = "Fiat|Mercedes|Porsche|Pontiac";

CellRange rg = _flex.GetCellRange(10,10);

rg.Style = s;


ComboList Property (CellStyle) - Delphi

Delphi

var

r: CellRange;

s: CellStyle;

begin

s := _flex.Styles.Add('TheList');

s.ComboList := 'Fiat|Mercedes|Porsche|Pontiac';

rg := _flex.GetCellRange(10, 10);

rg.Style := s;

end;


ComboList Property (CellStyle) - Visual Basic

Visual Basic

Dim s As CellStyle = _flex.Styles.Add("TheList")

s.ComboList = "Fiat|Mercedes|Porsche|Pontiac"

Dim rg As CellRange = _flex.GetCellRange(10, 10)

rg.Style = s


ComboList Property - Delphi

Delphi

flex.ComboList := 'ListItem 1|ListItem 2';


ComboList Property - Delphi2

Delphi

flex.ComboList := '|ComboItem 1|ComboItem 2';


ComboList Property - Delphi3

Delphi

flexComboList := '...';


ComboList Property - Delphi4

Delphi

flexComboList := '|...';


ComboList Property - Delphi5

Delphi

procedure _flex_BeforeEdit(sender: System.Object; e: RowColEventArgs);

begin

_flex.ComboList := '';

If (e.Row Mod 2) = 0 Then

flex.ComboList = '...'

Else

flex.ComboList = '';

end;


ComboList Property - Visual Basic

Visual Basic

flex.ComboList = "ListItem 1|ListItem 2"


ComboList Property - Visual Basic2

Visual Basic

flex.ComboList = "|ComboItem 1|ComboItem 2"


ComboList Property - Visual Basic3

Visual Basic

flexComboList = "..."


ComboList Property - Visual Basic4

Visual Basic

flexComboList = "|..."


ComboList Property - Visual Basic5

Visual Basic

Private Sub _flex_BeforeEdit(sender As Object, e As RowColEventArgs)

_flex.ComboList = ""

If e.Row Mod 2 = 0 Then

flex.ComboList = "..."

Else

flex.ComboList = ""

End If

End Sub


Conditional formatting - C#

C#

// create a custom style for large values

cs = fg.Styles.Add("LargeValue");

cs.Font = new Font(Font, FontStyle.Italic);

cs.BackColor = Color.Gold;

// format cells based on their content

private void fg_CellChanged( object sender, RowColEventArgs e) {

// mark currency values > 50,000 as LargeValues

// (reset others by setting their Style to null)

CellStyle cs;

if ( Val(fg(e.Row, e.Col)) >= 50000 ) {

cs = fg.Styles["LargeValue"];

}

fg.SetCellStyle(e.Row, e.Col, cs);

}


Conditional formatting - Delphi

Delphi

cs := fg.Styles.Add('LargeValue');

cs.Font := Font.Create(Font, FontStyle.Italic);

cs.BackColor := Color.Gold;

procedure fg_CellChanged(sender: System.Object; e: RowColEventArgs)

begin

// mark currency values > 50,000 as LargeValues

// (reset others by setting their Style to null)

if val(fg[e.Row, e.Col] >= 50000 then

cs := fg.Styles['LargeValue'];

fg.SetCellStyle(e.Row, e.Col, cs);

end;


Conditional formatting - Visual Basic

Visual Basic

' create a custom style for large values

cs = fg.Styles.Add("LargeValue")

cs.Font = New Font(Font, FontStyle.Italic)
cs.BackColor = Color.Gold

' format cells based on their content
Private Sub fg_CellChanged(ByVal sender As Object,
ByVal e As RowColEventArgs) Handles fg.CellChanged

' mark currency values > 50,000 as LargeValues
 ' (reset others by setting their Style to Nothing)
Dim cs As CellStyle
If Val(fg(e.Row, e.Col)) >= 50000 Then
cs = fg.Styles("LargeValue")
End If
fg.SetCellStyle(e.Row, e.Col, cs)
End Sub


Converting Column Letters to Uppercase - C#

C#

private void flex_SetupEditor(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)

{

if (flex.Cols[e.Col].Name == "UCASECOL")

{

TextBox tb = flex.Editor as TextBox;

tb.CharacterCasing = CharacterCasing.Upper;

}

}


Converting Column Letters to Uppercase - Delphi

Delphi

procedure flex_SetupEditor(sender: System.Object; e: C1.Win.C1FlexGrid.RowColEventArgs)

var

tb: TextBox;

begin

if (flex.Cols[e.Col].Name = ‘UCASECOL’)

begin

tb := flex.Editor as TextBox;

tb.CharacterCasing := CharacterCasing.Upper;

end;

end;


Converting Column Letters to Uppercase - Visual Basic

Visual Basic

Private Sub flex_SetupEditor(ByVal sender As Object, ByVal e As C1.Win.C1FlexGrid.RowColEventArgs) Handles flex.SetupEditor

If flex.Cols(e.Col).Name = "UCASECOL" Then

Dim tb As TextBox = flex.Editor, TextBox

tb.CharacterCasing = CharacterCasing.Upper

End If

End Sub


CreateImage Method - C#

C#

private void button1_Click(object sender, System.EventArgs e)

{

Image img = _flex.CreateImage(0,0,10,5);

img.Save(@"c:\temp\flex.png", System.Drawing.Imaging.ImageFormat.Png);

}


CreateImage Method - Delphi

Delphi

procedure Class1.button1_Click(sender: System.Object; e: System.EventArgs);

var

img: Image;

begin

img := _flex.CreateImage(0, 0, 10, 5);

img.Save('c:\temp\flex.png', System.Drawing.Imaging.ImageFormat.Png);

end;


CreateImage Method - Visual Basic

Visual Basic

Private Sub button1_Click(sender As Object, e As System.EventArgs)

Dim img As Image = _flex.CreateImage(0, 0, 10, 5)

img.Save("c:\temp\flex.png") '

End Sub


Creating Custom Trees - C#

C#

private void Form1_Load( System.object sender, System.EventArgs e) base.Load {

// initialize grid layout

fg.Cols.Fixed = 0;

fg.Cols.Count = 1;

fg.Rows.Count = 1;

fg.ExtendLastCol = true;

fg.Styles.Normal.TextAlign = TextAlignEnum.LeftCenter;

fg.Styles.Normal.Border.Style = BorderStyleEnum.None;

// initialize outline tree

fg.Tree.Column = 0;

fg.Tree.Style = TreeStyleFlags.SimpleLeaf;

// populate the grid

AddDirectory("c:\", 0);

}


Creating Custom Trees - C#2

C#

private void AddDirectory( string dir, int level)

{

// add this directory

string thisDir = Path.GetFileName(dir);

if ( thisDir.Length == 0 ) thisDir = dir;

fg.AddItem(thisDir.ToUpper());

// make this new row a node

Row row = fg.Rows[fg.Rows.Count – 1];

row.IsNode = true;

// set node level

Node nd = row.Node;

nd.Level = level;

// add files in this directory

int cnt = 0;

foreach (string file In Directory.GetFiles(dir)

{

fg.AddItem(Path.GetFileName(file).ToLower());

cnt = cnt + 1;

if ( cnt > 10 ) break;

}


Creating Custom Trees - Delphi

Delphi

procedure Form1_Load(sender: System.Object; _

e: System.EventArgs);

begin

// initialize grid layout

fg.Cols.Fixed := 0;

fg.Cols.Count := 1;

fg.Rows.Count := 1;

fg.ExtendLastCol := True;

fg.Styles.Normal.TextAlign := TextAlignEnum.LeftCenter;

fg.Styles.Normal.Border.Style := BorderStyleEnum.None;

// initialize outline tree

fg.Tree.Column := 0;

fg.Tree.Style := TreeStyleFlags.SimpleLeaf;

// populate the grid

AddDirectory("c:\", 0)

end;


Creating Custom Trees - Delphi2

Delphi

procedure AddDirectory(dir: String; level: Integer);

var

thisDir: string;

r: Row;

nd: Node;

file: string;

cnt: Integer;

files: array of string;

subdir: string;

begin

// add this directory

thisDir := Path.GetFileName(dir);

If thisDir.Length = 0 Then thisDir := dir;

fg.AddItem(thisDir.ToUpper());

// make this new row a node

r := fg.Rows(fg.Rows.Count - 1);

r.IsNode := True;

// set node level

nd := r.Node;

nd.Level := level;

// add files in this directory

cnt := 0;

files := Directory.GetFiles(dir);

for I := 0 to High(Files) do

begin

fg.AddItem(Path.GetFileName(files[I].ToLower());

cnt := cnt + 1;

if cnt > 10 then

break;

end;

// add subdirectories (up to level 4)

If level <= 4 Then

begin

cnt := 0;

files := Directory.GetDirectories(dir);

for I := 0 to High(files) do

begin

AddDirectory(subdir, level + 1);

cnt := cnt + 1;

if cnt > 10 then

break;

end;

end;

end;


Creating Custom Trees - Visual Basic

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles MyBase.Load

' initialize grid layout

fg.Cols.Fixed = 0

fg.Cols.Count = 1

fg.Rows.Count = 1

fg.ExtendLastCol = True

fg.Styles.Normal.TextAlign = TextAlignEnum.LeftCenter

fg.Styles.Normal.Border.Style = BorderStyleEnum.None

' initialize outline tree

fg.Tree.Column = 0

fg.Tree.Style = TreeStyleFlags.SimpleLeaf

' populate the grid

AddDirectory("c:\", 0)

End Sub


Creating Custom Trees - Visual Basic2

Visual Basic

Private Sub AddDirectory(ByVal dir As String, ByVal level As Integer)

' add this directory

Dim thisDir As String

thisDir = Path.GetFileName(dir)

If thisDir.Length = 0 Then thisDir = dir

fg.AddItem(thisDir.ToUpper())

' make this new row a node

Dim row As Row = fg.Rows(fg.Rows.Count - 1)

row.IsNode = True

' set node level

Dim nd As Node = row.Node

nd.Level = level

' add files in this directory

Dim file As String, cnt As Integer

cnt = 0

For Each file In Directory.GetFiles(dir)

fg.AddItem(Path.GetFileName(file).ToLower())

cnt = cnt + 1

If cnt > 10 Then Exit For

Next

' add subdirectories (up to level 4)

If level <= 4 Then

Dim subdir As String

cnt = 0

For Each subdir In Directory.GetDirectories(dir)

AddDirectory(subdir, level + 1)

cnt = cnt + 1

If cnt > 10 Then Exit For

Next

End If

End Sub


Creating Subtotals - C#

C#

private void ShowTotals() {

// show OutlineBar on column 0

fg.Tree.Column = 0;

fg.Tree.Style = TreeStyleFlags.Simple;

// clear existing subtotals

fg.Subtotal(AggregateEnum.Clear);

// get a Grand total (use -1 instead of column index)

fg.Subtotal(AggregateEnum.Sum, -1, -1, 3, "Grand Total");

// total per Product (column 0)

fg.Subtotal(AggregateEnum.Sum, 0, 0, 3, "Total {0}");

// total per Region (column 1)

fg.Subtotal(AggregateEnum.Sum, 1, 1, 3, "Total {0}");

// size column widths based on content

fg.AutoSizeCols();

}


Creating Subtotals - C#2

C#

// set styles for subtotals

CellStyle cs;

cs = fg.Styles[CellStyleEnum.GrandTotal];

cs.BackColor = Color.Black;

cs.ForeColor = Color.White;

cs.Font = new Font(Font, FontStyle.Bold);

cs = fg.Styles[CellStyleEnum.Subtotal0];

cs.BackColor = Color.DarkRed;

cs.ForeColor = Color.White;

cs.Font = new Font(Font, FontStyle.Bold);

cs = fg.Styles[CellStyleEnum.Subtotal1];

cs.BackColor = Color.DarkBlue;

cs.ForeColor = Color.White;


Creating Subtotals - Delphi

Delphi

procedure ShowTotals()

begin

// show OutlineBar on column 0

fg.Tree.Column := 0;

fg.Tree.Style := TreeStyleFlags.Simple;

// clear existing subtotals

fg.Subtotal(AggregateEnum.Clear);

// get a Grand total (use -1 instead of column index)

fg.Subtotal(AggregateEnum.Sum, -1, -1, 3, 'Grand Total');

// total per Product (column 0)

fg.Subtotal(AggregateEnum.Sum, 0, 0, 3, 'Total {0}');

// total per Region (column 1)

fg.Subtotal(AggregateEnum.Sum, 1, 1, 3, 'Total {0}');

// size column widths based on content

fg.AutoSizeCols;

end;


Creating Subtotals - Delphi2

Delphi

cs := fg.Styles[CellStyleEnum.GrandTotal);

cs.BackColor := Color.Black;

cs.ForeColor := Color.White;

cs.Font := Font.Create(Font, FontStyle.Bold);

cs := fg.Styles[CellStyleEnum.Subtotal0];

cs.BackColor := Color.DarkRed;

cs.ForeColor := Color.White;

cs.Font := Font.Create(Font, FontStyle.Bold);

cs := fg.Styles[CellStyleEnum.Subtotal1];

cs.BackColor := Color.DarkBlue;

cs.ForeColor := Color.White;


Creating Subtotals - Visual Basic

Visual Basic

Private Sub ShowTotals()

' show OutlineBar on column 0

fg.Tree.Column = 0

fg.Tree.Style = TreeStyleFlags.Simple

' clear existing subtotals

fg.Subtotal(AggregateEnum.Clear)

' get a Grand total (use -1 instead of column index)

fg.Subtotal(AggregateEnum.Sum, -1, -1, 3, "Grand Total")

' total per Product (column 0)

fg.Subtotal(AggregateEnum.Sum, 0, 0, 3, "Total {0}")

' total per Region (column 1)

fg.Subtotal(AggregateEnum.Sum, 1, 1, 3, "Total {0}")

' size column widths based on content

fg.AutoSizeCols()

End Sub


Creating Subtotals - Visual Basic2

Visual Basic

' set styles for subtotals

Dim cs As CellStyle

cs = fg.Styles(CellStyleEnum.GrandTotal)

cs.BackColor = Color.Black

cs.ForeColor = Color.White

cs.Font = New Font(Font, FontStyle.Bold)

cs = fg.Styles(CellStyleEnum.Subtotal0)

cs.BackColor = Color.DarkRed

cs.ForeColor = Color.White

cs.Font = New Font(Font, FontStyle.Bold)

cs = fg.Styles(CellStyleEnum.Subtotal1)

cs.BackColor = Color.DarkBlue

cs.ForeColor = Color.White


Data Analysis Tutorial - C#

C#

using System.Data.OleDb;

using C1.Win.C1FlexGrid;


Data Analysis Tutorial - C#2

C#

private void Form1_Load( System.object sender, EventArgs e) base.Load {

// set up grid layout/behavior

fg.AllowEditing = False

fg.AllowSorting = AllowSortingEnum.None;

fg.AllowMerging = AllowMergingEnum.Nodes;

fg.SelectionMode = SelectionModeEnum.Cell;

fg.ExtendLastCol = true;

fg.Cols[0].Width = fg.Cols.DefaultSize / 4;

fg.Tree.Style = TreeStyleFlags.Simple;

fg.Tree.Column = 1;

// set up grid styles

fg.Styles.Normal.Border.Style = BorderStyleEnum.None;

fg.Styles.Normal.Trimming = StringTrimming.EllipsisCharacter;

CellStyle s = fg.Styles[CellStyleEnum.GrandTotal];

s.BackColor = Color.Black;

s.ForeColor = Color.White;

s = fg.Styles[CellStyleEnum.Subtotal0];

s.BackColor = Color.Gold;

s.ForeColor = Color.Black;

s = fg.Styles[CellStyleEnum.Subtotal1];

s.BackColor = Color.Khaki;

s.ForeColor = Color.Black;

s = fg.Styles[CellStyleEnum.Subtotal2];

s.BackColor = Color.LightGoldenrodYellow;

s.ForeColor = Color.Black;

// bind flex to data source

fg.DataSource = GetDataSource();

// prevent user from dragging last three columns

fg.Cols[4].AllowDragging = false;

fg.Cols[5].AllowDragging = false;

fg.Cols[6].AllowDragging = false;

}


Data Analysis Tutorial - C#3

C#

private DataTable GetDataSource()

{

// set up connection string

string conn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;";

// set up SQL statement

string rs =

"SELECT Employees.LastName,Orders.ShipCountry," +

"Categories.CategoryName,Products.ProductName,Orders.OrderDate," +

"[Quantity]*[Products].[UnitPrice] AS [Sale Amount] " +

"FROM (Categories INNER JOIN Products " +

"ON Categories.CategoryID = Products.CategoryID) " +

"INNER JOIN ((Employees INNER JOIN Orders " +

"ON Employees.EmployeeID = Orders.EmployeeID) " +

"INNER JOIN [Order Details] " +

"ON Orders.OrderID = [Order Details].OrderID) " +

"ON Products.ProductID = [Order Details].ProductID " +

"ORDER BY Employees.LastName,Orders.ShipCountry," +

"Categories.CategoryName;";

// retrieve data into DataSet

OleDbDataAdapter OleDbDataAdapter da = new OleDbDataAdapter(rs, conn);

DataSet DataSet ds = new DataSet();

da.Fill(ds);

// return data table

GetDataSource = ds.Tables[0]

}


Data Analysis Tutorial - C#4

C#

private void fg_AfterDragColumn( object sender, DragRowColEventArgs e) fg.AfterDragColumn {

// sort the recordset when the user drags columns

// this will cause a data refresh, removing all subtotals and

// firing the AfterDataRefresh event, which rebuilds the subtotals.

string sort = fg.Cols[1].Name + ", " +

fg.Cols[2].Name + ", " +

fg.Cols(3).Name;

DataTable dt = fg.DataSource;

dt.DefaultView.Sort = sort;

}


Data Analysis Tutorial - C#5

C#

private void fg_AfterDataRefresh( object sender, ListChangedEventArgs e) fg.AfterDataRefresh {

// total on Sale Amount

int totalOn = fg.Cols["Sale Amount"].SafeIndex;

string caption = "Total for {0}";

// calculate three levels of totals

fg.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption);

fg.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption);

fg.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption);

// collapse outline to level 2

fg.Tree.Show(2);

// autosize the grid to accommodate tree

fg.AutoSizeCols(1, 1, 1000, 3, 30, AutoSizeFlags.IgnoreHidden);

}


Data Analysis Tutorial - Delphi

Delphi

uses System.Data.OleDb,

C1.Win.C1FlexGrid;


Data Analysis Tutorial - Delphi2

Delphi

procedure Form1_Load(sender: System.Object;

e: System.EventArgs);

var

s: CellStyle;

begin

// set up grid layout/behavior

fg.AllowEditing = False

fg.AllowSorting := AllowSortingEnum.None;

fg.AllowMerging := AllowMergingEnum.Nodes;

fg.SelectionMode := SelectionModeEnum.Cell;

fg.ExtendLastCol := True;

fg.Cols[0].Width := fg.Cols.DefaultSize / 4;

fg.Tree.Style := TreeStyleFlags.Simple;

fg.Tree.Column := 1;

// set up grid styles

fg.Styles.Normal.Border.Style := BorderStyleEnum.None;

fg.Styles.Normal.Trimming := StringTrimming.EllipsisCharacter;

s := fg.Styles[CellStyleEnum.GrandTotal];

s.BackColor := Color.Black;

s.ForeColor := Color.White;

s = fg.Styles[CellStyleEnum.Subtotal0];

s.BackColor := Color.Gold;

s.ForeColor := Color.Black;

s := fg.Styles[CellStyleEnum.Subtotal1];

s.BackColor := Color.Khaki;

s.ForeColor := Color.Black;

s := fg.Styles[CellStyleEnum.Subtotal2];

s.BackColor := Color.LightGoldenrodYellow;

s.ForeColor := Color.Black;

// bind flex to data source

fg.DataSource := GetDataSource;

// prevent user from dragging last three columns

fg.Cols[4].AllowDragging := False;

fg.Cols[5].AllowDragging := False;

fg.Cols[6].AllowDragging := False;

end;


Data Analysis Tutorial - Delphi3

Delphi

function Class1.GetDataSource: DataTable;

var

DataSet: DataSet;

OleDbDataAdapter: OleDbDataAdapter;

rs: string;

conn: string;

begin

conn := ('Provider=Microsoft.Jet.OLEDB.4.0;' + 'Data Source=C: rogram Files icrosoft Visual Studio B98 WIND.MDB;');

// set up SQL statement

rs :=

'SELECT Employees.LastName,Orders.ShipCountry,' +

'Categories.CategoryName,Products.ProductName,Orders.OrderDate,' +

'[Quantity]*[Products].[UnitPrice] AS [Sale Amount] ' +

'FROM (Categories INNER JOIN Products ' +

'ON Categories.CategoryID = Products.CategoryID) ' +

'INNER JOIN ((Employees INNER JOIN Orders ' +

'ON Employees.EmployeeID = Orders.EmployeeID) ' +

'INNER JOIN [Order Details] ' +

'ON Orders.OrderID = [Order Details].OrderID) ' +

'ON Products.ProductID = [Order Details].ProductID ' +

'ORDER BY Employees.LastName,Orders.ShipCountry,' +

'Categories.CategoryName;';

da := OleDbDataAdapter.Create(rs, conn);

ds := DataSet.Create;

da.Fill(ds);

Self.GetDataSource := ds.Tables[0];

end;


Data Analysis Tutorial - Delphi4

Delphi

procedure fg_AfterDragColumn(sender: Object;

e: DragRowColEventArgs);

var

sort: string;

dt: DataTable;

begin

// sort the recordset when the user drags columns

// this will cause a data refresh, removing all subtotals and

// firing the AfterDataRefresh event, which rebuilds the subtotals.

sort := fg.Cols[1].Name + ', ' +

fg.Cols[2].Name + ', ' +

fg.Cols[3].Name;

dt := fg.DataSource;

dt.DefaultView.Sort := sort;

end;


Data Analysis Tutorial - Delphi5

Delphi

procedure fg_AfterDataRefresh(sender: System.Object;

e: ListChangedEventArgs);

var

totalOn: Integer;

caption: string;

begin

// total on Sale Amount

totalOn := fg.Cols['Sale Amount'].SafeIndex;

caption := 'Total for {0}';

// calculate three levels of totals

fg.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption);

fg.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption);

fg.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption);

// collapse outline to level 2

fg.Tree.Show(2);

// autosize the grid to accommodate tree

fg.AutoSizeCols(1, 1, 1000, 3, 30, AutoSizeFlags.IgnoreHidden);

end;


Data Analysis Tutorial - Visual Basic

Visual Basic

Imports System.Data.OleDb

Imports C1.Win.C1FlexGrid


Data Analysis Tutorial - Visual Basic2

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, _

ByVal e As EventArgs) Handles MyBase.Load

' set up grid layout/behavior

fg.AllowEditing = False

fg.AllowSorting = AllowSortingEnum.None

fg.AllowMerging = AllowMergingEnum.Nodes

fg.SelectionMode = SelectionModeEnum.Cell

fg.ExtendLastCol = True

fg.Cols(0).Width = fg.Cols.DefaultSize / 4

fg.Tree.Style = TreeStyleFlags.Simple

fg.Tree.Column = 1

' set up grid styles

fg.Styles.Normal.Border.Style = BorderStyleEnum.None

fg.Styles.Normal.Trimming = StringTrimming.EllipsisCharacter

Dim s As CellStyle = fg.Styles(CellStyleEnum.GrandTotal)

s.BackColor = Color.Black

s.ForeColor = Color.White

s = fg.Styles(CellStyleEnum.Subtotal0)

s.BackColor = Color.Gold

s.ForeColor = Color.Black

s = fg.Styles(CellStyleEnum.Subtotal1)

s.BackColor = Color.Khaki

s.ForeColor = Color.Black

s = fg.Styles(CellStyleEnum.Subtotal2)

s.BackColor = Color.LightGoldenrodYellow

s.ForeColor = Color.Black

' bind flex to data source

fg.DataSource = GetDataSource()

' prevent user from dragging last three columns

fg.Cols(4).AllowDragging = False

fg.Cols(5).AllowDragging = False

fg.Cols(6).AllowDragging = False

End Sub


Data Analysis Tutorial - Visual Basic3

Visual Basic

Private Function GetDataSource() As DataTable

' set up connection string

Dim conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB;"

' set up SQL statement

Dim rs As String = _

"SELECT Employees.LastName,Orders.ShipCountry," & _

"Categories.CategoryName,Products.ProductName,Orders.OrderDate," & _

"[Quantity]*[Products].[UnitPrice] AS [Sale Amount] " & _

"FROM (Categories INNER JOIN Products " & _

"ON Categories.CategoryID = Products.CategoryID) " & _

"INNER JOIN ((Employees INNER JOIN Orders " & _

"ON Employees.EmployeeID = Orders.EmployeeID) " & _

"INNER JOIN [Order Details] " & _

"ON Orders.OrderID = [Order Details].OrderID) " & _

"ON Products.ProductID = [Order Details].ProductID "

"ORDER BY Employees.LastName,Orders.ShipCountry," & _

"Categories.CategoryName;"

' retrieve data into DataSet

Dim da As OleDbDataAdapter = New OleDbDataAdapter(rs, conn)

Dim ds As DataSet = New DataSet()

da.Fill(ds)

' return data table

GetDataSource = ds.Tables(0)

End Function


Data Analysis Tutorial - Visual Basic4

Visual Basic

Private Sub fg_AfterDragColumn(ByVal sender As Object, _

ByVal e As DragRowColEventArgs) Handles fg.AfterDragColumn

' sort the recordset when the user drags columns

' this will cause a data refresh, removing all subtotals and

' firing the AfterDataRefresh event, which rebuilds the subtotals.

Dim sort As String = fg.Cols(1).Name & ", " & _

fg.Cols(2).Name & ", " & _

fg.Cols(3).Name

Dim dt As DataTable = fg.DataSource

dt.DefaultView.Sort = sort

End Sub


Data Analysis Tutorial - Visual Basic5

Visual Basic

Private Sub fg_AfterDataRefresh(ByVal sender As Object, _

ByVal e As ListChangedEventArgs) Handles fg.AfterDataRefresh

' total on Sale Amount

Dim totalOn As Integer = fg.Cols("Sale Amount").SafeIndex

Dim caption As String = "Total for {0}"

' calculate three levels of totals

fg.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption)

fg.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption)

fg.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption)

' collapse outline to level 2

fg.Tree.Show(2)

' autosize the grid to accommodate tree

fg.AutoSizeCols(1, 1, 1000, 3, 30, AutoSizeFlags.IgnoreHidden)

End Sub


DataMap Property - C#

C#

Hashtable employeeMap = new Hashtable();

foreach (Employee e in EmployeeCollection)

employeeMap.Add(e.ID, e.LastName);

flex.Cols[1].DataType = typeof(Employee);

flex.Cols[1].DataMap = employeeMap;


DataMap Property - Delphi

Delphi

var

employeeMap: Hashtable;

I: Integer;

e: Employee;

begin

employeeMap := Hashtable.Create;

for I := 0 to EmployeeCollection.Count – 1 do

begin

e := Employee(EmployeeCollection[I]);

employeeMap.Add(System.Object(e.ID), System.Object(e.LastName));

end;

flex.Cols[1].DataType := TypeOf(Employee);

flex.Cols[1].DataMap := employeeMap;

end;


DataMap Property - Visual Basic

Visual Basic

Dim employeeMap As New Hashtable()

Dim e As Employee

For Each e In EmployeeCollection

employeeMap.Add(e.ID, e.LastName)

Next e

flex.Cols(1).DataType = GetType(Employee)

flex.Cols(1).DataMap = employeeMap


Data Property (Node) - C#

C#

object o1 = node.Data;

int row = nd.Row.SafeIndex;

int col = flex.Tree.Column;

object o2 = flex[row, col];

Debug.Assert(o1.Equals(o2), "o1 and o2 refer to the same object");


Data Property (Node) - Delphi

Delphi

var

o2: System.Object;

col: Integer;

row: Integer;

o1: System.Object;

begin

o1 := node.Data;

row := nd.Row.SafeIndex;

col := flex.Tree.Column;

o2 := flex[row];

Debug.Assert(o1.Equals(o2), 'o1 and o2 refer to the same object');

end;


Data Property (Node) - Visual Basic

Visual Basic

Dim o1 As Object = node.Data

Dim row As Integer = nd.Row.SafeIndex

Dim col As Integer = flex.Tree.Column

Dim o2 As Object = flex(row, col)

Debug.Assert(o1.Equals(o2), "o1 and o2 refer to the same object")


DataSource Property - C#

C#

// replace with actual connection string

string conn = @"Provider=Microsoft.Jet.OLEDB.4.0; User ID=Admin; ...";

string rs = "select * from customers";

OleDbDataAdapter da = new OleDbDataAdapter(rs, conn);

DataSet ds = new DataSet();

da.Fill(ds);

flex.DataSource = ds.Tables[0];


DataSource Property - C#2

C#

// bind grids together

fgRight.DataSource = fgLeft;

fgLeft.ScrollBars = ScrollBars.Horizontal;

// synchronize vertical scrolling

private void flex_AfterScroll(object sender,

C1.Win.C1FlexGrid.RangeEventArgs e)

{

C1FlexGrid fg = (C1FlexGrid)sender;

fg.Update();

int y = fg.ScrollPosition.Y;

if (fg == fgLeft)

fgRight.ScrollPosition = new Point(fgRight.ScrollPosition.X, y);

else

fgLeft.ScrollPosition = new Point(fgLeft.ScrollPosition.X, y);

}

}


DataSource Property - Delphi

Delphi

var

ds: DataSet;

da: OleDbDataAdapter;

rs: string;

conn: string;

begin

conn := 'Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin; ...';

rs := 'select * from customers';

da := OleDbDataAdapter.Create(rs, conn);

ds := DataSet.Create;

da.Fill(ds);

flex.DataSource := ds.Tables[0];

end;


DataSource Property - Delphi2

Delphi

// bind grids together

fgRight.DataSource := fgLeft;

fgLeft.ScrollBars := ScrollBars.Horizontal;

procedure Class1.flex_AfterScroll(sender: System.Object; e: C1.Win.C1FlexGrid.RangeEventArgs);

var

y: Integer;

fg: C1FlexGrid;

begin

fg := C1FlexGrid(sender);

fg.Update;

y := fg.ScrollPosition.Y;

if (fg = fgLeft) then

fgRight.ScrollPosition := Point.Create(fgRight.ScrollPosition.X, y)

else

fgLeft.ScrollPosition := Point.Create(fgLeft.ScrollPosition.X, y);

end;


DataSource Property - Visual Basic

Visual Basic

' replace with actual connection string

Dim conn As String = " Provider=Microsoft.Jet.OLEDB.4.0;UserID=Admin;... "

Dim rs As String = "select * from customers"

Dim da As New OleDbDataAdapter(rs, conn)

Dim ds As New DataSet()

da.Fill(ds)

flex.DataSource = ds.Tables(0)


DataSource Property - Visual Basic2

Visual Basic

' bind grids together

fgRight.DataSource = fgLeft

fgLeft.ScrollBars = ScrollBars.Horizontal

' synchronize vertical scrolling

Private Sub flex_AfterScroll(sender As Object,
e As C1.Win.C1FlexGrid.RangeEventArgs)

Dim fg As C1FlexGrid = CType(sender, C1FlexGrid)

fg.Update()

Dim y As Integer = fg.ScrollPosition.Y

If fg = fgLeft Then

fgRight.ScrollPosition = New Point(fgRight.ScrollPosition.X, y)

Else

fgLeft.ScrollPosition = New Point(fgLeft.ScrollPosition.X, y)

End If

End Sub


DataType Property - C#

C#

// store times in column 1, use masked editor

fg.Cols[1].DataType=typeof(DateTime);

fg.Cols[1].Format="hh:mm tt";

fg.Cols[1].EditMask="99:99 LL";

// store times in column 2, use DateTimePicker but prevent drop-down

fg.Cols[2].DataType=typeof(DateTime);

fg.Cols[2].Format="hh:mm tt";

private void fg_SetupEditor(object sender, RowColEventArgs e)

{

if (e.Col == 2)

{

DateTimePicker ctl = flex.Editor as DateTimePicker;

if (ctl != null)

ctl.ShowUpDown = true;

}

}


DataType Property - Delphi

Delphi

// store times in column 1, use masked editor

fg.Cols[1].DataType := typeof(DateTime);

fg.Cols[1].Format := 'hh:mm tt';

fg.Cols[1].EditMask := '99:99 LL';

// store times in column 2, use DateTimePicker but prevent drop-down

fg.Cols[2].DataType := typeof(DateTime);

fg.Cols[2].Format := 'hh:mm tt';

procedure fg_SetupEditor(sender: System.Object; e: RowColEventArgs);

var

ctl: DateTimePicker;

begin

If e.Col = 2 Then

begin

if ctl is DateTimePicker then

begin

ctl := DateTimePicker(flex.Editor);

ctl.ShowUpDown := True;

end;

end;

end;


DataType Property - Visual Basic

Visual Basic

' store times in column 1, use masked editor

fg.Cols(1).DataType = GetType(DateTime)

fg.Cols(1).Format = "hh:mm tt"

fg.Cols(1).EditMask = "99:99 LL"

' store times in column 2, use DateTimePicker but prevent drop-down

fg.Cols(2).DataType = GetType(DateTime) '

fg.Cols(2).Format = "hh:mm tt"

Private Sub fg_SetupEditor(sender As Object, e As RowColEventArgs)

If e.Col = 2 Then

Dim ctl As DateTimePicker = flex.Editor

If Not (ctl Is Nothing) Then

ctl.ShowUpDown = True

End If

End If

End Sub


EditCell Method - C#

C#

void fg_MouseDown(integer Button, int Shift, Dim X, Dim Y)

{

if (Button == vbRightButton)

{

fg.Select fa.MouseRow, fa.MouseCol ;

fg.EditCell ;

}

}


EditCell Method - Delphi

Delphi

procedure Form1.fg_MouseDown(Button: Integer; Shift: Integer; X: Integer; Y: Integer);
begin

if Button = vbCopyButton then

fg.Select(fa.MouseRow, fa.MouseCol);

fg.EditCell;

end;

end;


EditCell Method - Visual Basic

Visual Basic

Sub fg_MouseDown(Button As Integer, Shift As Integer, X!, Y!)

If Button = vbRightButton Then

fg.Select fa.MouseRow, fa.MouseCol

fg.EditCell

End If

End Sub


Editing with Lists and Combos - C#

C#

fg.Cols[1].ComboList = "Red|Green|Blue|Red|White"; // drop-down list

fg.Cols[2].ComboList = "|Red|Green|Blue|Red|White"; // drop-down combo


Editing with Lists and Combos - Delphi

Delphi

fg.Cols[1].ComboList := 'Red|Green|Blue|Red|White';

fg.Cols[2].ComboList := '|Red|Green|Blue|Red|White';


Editing with Lists and Combos - Visual Basic

Visual Basic

fg.Cols(1).ComboList = "Red|Green|Blue|Red|White" ' drop-down list

fg.Cols(2).ComboList = "|Red|Green|Blue|Red|White" ' drop-down combo


EditMask Property - C#

C#

CellStyle s = _flex.Styles.Add("TheMask");

s.EditMask = "##-##-####";

CellRange r = _flex.GetCellRange(10,10);

rg.Style = s;


EditMask Property (C1FlexGrid) - C#

C#

// set the mask so the user can enter a phone number,

// with optional area code, and a state in uppercase letters.

// use an asterisk as a placeholder

flex.EditMask = "(###) 000-0000 St\ate\: >LL;*";


EditMask Property (C1FlexGrid) - Delphi

Delphi

// set the mask so the user can enter a phone number,

// with optional area code, and a state in uppercase letters.

// use an asterisk as a placeholder

flex.EditMask := '(###) 000-0000 St'#7'te >LL;*';


EditMask Property (C1FlexGrid) - Visual Basic

Visual Basic

' set the mask so the user can enter a phone number,

' with optional area code, and a state in uppercase letters.

' use an asterisk as a placeholder

flex.EditMask = "(###) 000-0000 St" + "ate" > LL '


EditMask Property - Delphi

Delphi

var

r: CellRange;

s: CellStyle;

begin

s := _flex.Styles.Add('TheMask');

s.EditMask := '##-##-####';

r := _flex.GetCellRange(10, 10);

rg.Style := s;

end;


EditMask Property - Visual Basic

Visual Basic

Dim s As CellStyle = _flex.Styles.Add("TheMask")

s.EditMask = "##-##-####"

Dim r As CellRange = _flex.GetCellRange(10, 10)

rg.Style = s


Editor Property - C#

C#

private void flex_ BeforeScroll(object sender, RangeEventArgs e)

{

if (flex.Editor != null)

e.Cancel = true;

}


Editor Property - Delphi

Delphi

procedure flex_BeforeScroll(sender: System.Object; e: RangeEventArgs);

begin

If flex.Editor <> nil Then

e.Cancel := True

end;


Editor Property - Visual Basic

Visual Basic

Private flex_ As Sub New(sender As Object, e As RangeEventArgs)

If Not (flex.Editor Is Nothing) Then

e.Cancel = True

End If

End Sub


EditSelLength Property - C#

C#

private void fg_Click( System.object sender, System.EventArgs e) fg.Click

{

fg.EditCell;

fg.EditSelStart = 5;

fg.EditSelLength = 3;

}


EditSelLength Property - Delphi

Delphi

procedure fg_Click(sender: System.Object;

e: System.EventArgs);

begin

fg.EditCell;

fg.EditSelStart := 5;

fg.EditSelLength := 3;

end;


EditSelLength Property - Visual Basic

Visual Basic

Private Sub fg_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles fg.Click

fg.EditCell

fg.EditSelStart = 5

fg.EditSelLength = 3

End Sub


EditSelStart Property - C#

C#

private void fg_Click( System.object sender, System.EventArgs e) fg.Click

{

fg.EditCell;

fg.EditSelStart = 5;

fg.EditSelLength = 3;

}


EditSelStart Property - Delphi

Delphi

procedure fg_Click(sender: System.Object;

e: System.EventArgs);

begin

fg.EditCell;

fg.EditSelStart := 5;

fg.EditSelLength := 3;

end;


EditSelStart Property - Visual Basic

Visual Basic

Private Sub fg_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles fg.Click

fg.EditCell

fg.EditSelStart = 5

fg.EditSelLength = 3

End Sub


EditSelText Property - C#

C#

private void fg_Click( System.object sender,

System.EventArgs e)

{

fg.EditCell;

fg.EditSelStart = 5;

fg.EditSelLength = 3;

fg.EditSelText = "COW";

}


EditSelText Property - Delphi

Delphi

procedure fg_Click(sender: System.Object;

e: System.EventArgs);

begin

fg.EditCell;

fg.EditSelStart := 5;

fg.EditSelLength := 3;

fg.EditSelText := 'COW';

end;


EditSelText Property - Visual Basic

Visual Basic

Private Sub fg_Click(ByVal sender As System.Object,

ByVal e As System.EventArgs) Handles fg.Click

fg.EditCell

fg.EditSelStart = 5

fg.EditSelLength = 3

fg.EditSelText = "COW"

End Sub


EditText Property - C#

C#

private void fg_ValidateEdit( object sender,
C1.Win.C1FlexGrid.ValidateEditEventArgs e)

{

c$;

switch (e.Col) // different validation rules for each column

{

case 1: // column 1 only accepts strings

c = fg.EditText[0];

if ( s.ToUpper (c) < "A" || s.ToUpper(c) > "Z" ) e.Cancel = true;

case 2: // column 2 only accepts numbers > 0

try

{

int i = int.Parse(fg.EditText);

} catch {

e.Cancel = true;

}

}

}


EditText Property - Delphi

Delphi

procedure fg_ValidateEdit(sender: System.Object; _

e: C1.Win.C1FlexGrid.ValidateEditEventArgs);

var

c: char;

begin

case e.Col of // column 1 only accepts strings

1:

begin

c := fg.EditText.SubString(0, 1).ToUpper();

If (c < 'A') Or (c > 'Z') Then

e.Cancel := True;

end;

2:

begin

If Val(fg.EditText) <= 0 Then

e.Cancel := True;

end;

end;

end;


EditText Property - Visual Basic

Visual Basic

Private Sub fg_ValidateEdit(ByVal sender As Object, _

ByVal e As C1.Win.C1FlexGrid.ValidateEditEventArgs) _

Handles fg.ValidateEdit

Dim c$

Select Case e.Col ' different validation rules for each column

Case 1 ' column 1 only accepts strings

c = Left$(fg.EditText, 1)

If UCaseS(c) < "A" Or UCase$(c) > "Z" Then Beep: e.Cancel = True

Case 2 ' column 2 only accepts numbers > 0

If Val(fg.EditText) <= 0 Then Beep: e.Cancel = True

End Select

End Sub


Edit Tutorial - C#

C#

using C1.Win.C1FlexGrid;


Edit Tutorial - C#2

C#

private void Form1_Load( System.object sender, System.EventArgs e)

{

// set up columns

string cols = "Product|Region|Salesperson|Sales|Bonus";

string[]colNames = cols.Split("|");

for (int i = 0; i < fg.Cols.Count; i++)

{

fg[0, i] = colNames[i];

fg.Cols[i].Name = colNames[i];

}

}


Edit Tutorial - C#3

C#

private void Form1_Load( System.object sender, System.EventArgs e)

{

// set up columns

string cols = "Product|Region|Salesperson|Sales|Bonus";

string[] colNames = cols.Split('|');

for (int i = 0; i <= fg.Cols.Count – 1; i++)

{

fg[0, i] = colNames[i];

fg.Cols[i].Name = colNames[i];

}

// set column DataType and Format

Column c = fg.Cols["Sales"];

c.DataType = typeof(Decimal);

c.Format = "c"; // << currency

c = fg.Cols["Bonus"];

c.DataType = typeof(bool);

c.ImageAlign = ImageAlignEnum.CenterCenter;

}


Edit Tutorial - C#4

C#

private void Form1_Load( System.object sender, System.EventArgs e)

{

// set up columns

string cols = "Product|Region|Salesperson|Sales|Bonus";

string[] colNames = cols.Split("|");

for (int i = 0; i <= fg.Cols.Count – 1; i++)

{

fg[0, i] = colNames[i];

fg.Cols[i].Name = colNames[i];

}

// set column DataType and Format

Column c = fg.Cols["Sales"];

c.DataType = typeof(Decimal);

c.Format = "c"; // << currency

c = fg.Cols["Bonus"];

c.DataType = typeof(bool);

c.ImageAlign = ImageAlignEnum.CenterCenter;

// set up drop-down lists

fg.Cols["Product"].ComboList = "Applets|Wahoos|Gadgets";

fg.Cols["Region"].ComboList = "North|South|East|West";

fg.Cols["Salesperson"].ComboList = "|Mary|Paula|Sarah";

}


Edit Tutorial - C#5

C#

private void fg_ValidateEdit( object sender, ValidateEditEventArgs e)

{

string rgn = string.Empty;

string prd = string.Empty;

// collect the data we need

switch (e.Col)

{

case 0:

prd = fg.Editor.Text;

rgn = (string)fg[e.Row, "Region"];

break;

case 1:

prd = (string)fg[e.Row, "Product"];

rgn = fg.Editor.Text;

break;

}

// we can't sell Applets in the North Region

if ( prd == "Applets" && rgn == "North" ) {

MessageBox.Show("Warning: Regulation #12333AS/SDA-23 forbids " +

"the sale of " + prd + " in region " + rgn + ". " +

"Please verify input.");

e.Cancel = true;

}

}


Edit Tutorial - C#6

C#

internal class MyUpDown : NumericUpDown

{

// set initial value

public void C1EditorInitialize(object value, IDictionary editorAttributes)

{

// apply initial value

Value = (decimal)Convert.ChangeType(value, typeof(decimal));

// select the whole entry

Select(0, int.MaxValue);

}

// set FontHeight so the control honors the rectangle height

public void C1EditorUpdateBounds(Rectangle rc)

{

base.FontHeight = rc.Height;

Bounds = rc;

}

// suppress annoying beeps when user hits enter

override protected bool ProcessDialogKey(Keys keyData)

{

if (keyData == Keys.Enter)

{

Parent.Focus();

if (Parent.Focused) SendKeys.Send("{Down}");

return true;

}

return base.ProcessDialogKey(keyData);

}

}


Edit Tutorial - Delphi

Delphi

uses C1.Win.C1FlexGrid;


Edit Tutorial - Delphi2

Delphi

procedure Form1_Load(sender: System.Object;_

e: System.EventArgs);

var

cols: string;

colNames: array of string;

I: Integer;

begin

// set up columns

cols := 'Product|Region|Salesperson|Sales|Bonus';

colNames := cols.Split('|');

For i := 0 To fg.Cols.Count – 1 do

begin

fg[0, i] := colNames[i];

fg.Cols[i].Name := colNames[i];

end;

end;


Edit Tutorial - Delphi3

Delphi

procedure Form1_Load(sender: System.Object;

e: System.EventArgs);

var

cols: string;

colNames: array of string;

I: Integer;

c: Column;

begin

// set up columns

cols := 'Product|Region|Salesperson|Sales|Bonus';

colNames := cols.Split('|');

for i := 0 to fg.Cols.Count – 1 do

begin

fg[0, i] := colNames[i];

fg.Cols[i].Name := colNames[i];

end;

// set column DataType and Format

Dim c As Column := fg.Cols['Sales'];

c.DataType := typeof(Decimal);

c.Format := 'c'; // << currency

c := fg.Cols['Bonus'];

c.DataType := typeof(Boolean);

c.ImageAlign := ImageAlignEnum.CenterCenter;

end;


Edit Tutorial - Delphi4

Delphi

procedure Form1_Load(sender: System.Object;

e: System.EventArgs);

var

cols: string;

colNames: array of string;

I: Integer;

begin

// set up columns

cols := 'Product|Region|Salesperson|Sales|Bonus';

colNames := cols.Split('|');

for i := 0 to fg.Cols.Count – 1 do

begin

fg[0, i] := colNames[i];

fg.Cols[i].Name := colNames[I];

Next

// set column DataType and Format

c := fg.Cols['Sales'];

c.DataType := typeof(Decimal);

c.Format := 'c' // << currency

c := fg.Cols['Bonus'];

c.DataType := typeof(Boolean);

c.ImageAlign := ImageAlignEnum.CenterCenter;

// set up drop-down lists

fg.Cols['Product'].ComboList := 'Applets|Wahoos|Gadgets';

fg.Cols['Region'].ComboList := 'North|South|East|West';

fg.Cols['Salesperson'].ComboList := '|Mary|Paula|Sarah';

end;


Edit Tutorial - Delphi5

Delphi

procedure fg_ValidateEdit(sender: System.Object;

e: ValidateEditEventArgs);

var

rgn: string;

prd: string;

begin

// collect the data we need

case e.Col of

0:

begin

prd := fg.Editor.Text;

rgn := fg[e.Row, 'Region'];

end;

1:

begin

prd := fg[e.Row, 'Product'];

rgn := fg.Editor.Text;

end;

end;

// we can't sell Applets in the North Region

If (prd = 'Applets') And (rgn = 'North') Then

begin

MsgBox('Warning: Regulation #12333AS/SDA-23 forbids ' + _

'the sale of ' + prd + ' in region ' + rgn + ". " + _

'Please verify input.');

e.Cancel := True;

end;

end;


Edit Tutorial - Delphi6

Delphi

type TMyUpDown = class(NumericUpDown)

public

procedure C1EditorInitialize(value: System.Object; editorAttributes: IDictionary);

procedure C1EditorUpdateBounds(rc: Rectangle);

function ProcessDialogKey(keyData: Keys): boolean;

end;

procedure TMyUpDown.C1EditorInitialize(value: System.Object; editorAttributes: IDictionary);

begin

// apply initial value

value := Currency(Convert.ChangeType(value, TypeOf(Currency)));

// select the whole entry

Select(0, System.Int32.MaxValue);

end;

procedure TMyUpDown.C1EditorUpdateBounds(rc: Rectangle);

begin

inherited FontHeight := rc.Height;

Bounds := rc;

end;

function TMyUpDown.ProcessDialogKey(keyData: Keys): boolean;

begin

if (keyData = Keys.Enter) then

begin

Parent.Focus;

if (Parent.Focused) then

SendKeys.Send(‘{Down}’);

Result := true;

Exit;

end;

Result := inherited ProcessDialogKey(keyData);

end;


Edit Tutorial - Visual Basic

Visual Basic

Imports C1.Win.C1FlexGrid


Edit Tutorial - Visual Basic2

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles MyBase.Load

' set up columns

Dim cols As String = "Product|Region|Salesperson|Sales|Bonus"

Dim colNames As String() = cols.Split("|")

Dim i%

For i = 0 To fg.Cols.Count - 1

fg(0, i) = colNames(i)

fg.Cols(i).Name = colNames(i)

Next

End Sub


Edit Tutorial - Visual Basic3

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles MyBase.Load

' set up columns

Dim cols As String = "Product|Region|Salesperson|Sales|Bonus"

Dim colNames As String() = cols.Split("|")

Dim i%

For i = 0 To fg.Cols.Count – 1

fg(0, i) = colNames(i)

fg.Cols(i).Name = colNames(i)

Next

' set column DataType and Format

Dim c As Column = fg.Cols("Sales")

c.DataType = GetType(Decimal)

c.Format = "c" ' << currency

c = fg.Cols("Bonus")

c.DataType = GetType(Boolean)

c.ImageAlign = ImageAlignEnum.CenterCenter

End Sub


Edit Tutorial - Visual Basic4

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles MyBase.Load

' set up columns

Dim cols As String = "Product|Region|Salesperson|Sales|Bonus"

Dim colNames As String() = cols.Split("|")

Dim i%

For i = 0 To fg.Cols.Count – 1

fg(0, i) = colNames(i)

fg.Cols(i).Name = colNames(i)

Next

' set column DataType and Format

Dim c As Column = fg.Cols("Sales")

c.DataType = GetType(Decimal)

c.Format = "c" ' << currency

c = fg.Cols("Bonus")

c.DataType = GetType(Boolean)

c.ImageAlign = ImageAlignEnum.CenterCenter

' set up drop-down lists

fg.Cols("Product").ComboList = "Applets|Wahoos|Gadgets"

fg.Cols("Region").ComboList = "North|South|East|West"

fg.Cols("Salesperson").ComboList = "|Mary|Paula|Sarah"

End Sub


Edit Tutorial - Visual Basic5

Visual Basic

Private Sub fg_ValidateEdit(ByVal sender As Object, _

ByVal e As ValidateEditEventArgs) Handles fg.ValidateEdit

Dim rgn As String, prd As String

' collect the data we need

Select Case e.Col

Case 0

prd = fg.Editor.Text

rgn = fg(e.Row, "Region")

Case 1

prd = fg(e.Row, "Product")

rgn = fg.Editor.Text

End Select

' we can't sell Applets in the North Region

If prd = "Applets" And rgn = "North" Then

MsgBox("Warning: Regulation #12333AS/SDA-23 forbids " & _

"the sale of " & prd & " in region " & rgn & ". " & _

"Please verify input.")

e.Cancel = True

End If

End Sub


Edit Tutorial - Visual Basic6

Visual Basic

Public Class MyUpDown

Inherits NumericUpDown

' set initial value

Public Sub C1EditorInitialize(ByVal value As Object, _
ByVal editorAttributes As IDictionary)

value = Convert.ChangeType(value, GetType(Decimal))

MyBase.Select(0, Int32.MaxValue)

End Sub

' set FontHeight so the control honors the rectangle height

Public Sub C1EditorUpdateBounds(ByVal rc As Rectangle)

MyBase.FontHeight = rc.Height

Bounds = rc

End Sub

' suppress annoying beeps when user hits enter

Protected Overrides Function ProcessDialogKey(ByVal keyData As Keys) As Boolean

If (keyData = Keys.Enter) Then

Parent.Focus()

If (Parent.Focused) Then SendKeys.Send("{Down}")

Return True

End If

Return MyBase.ProcessDialogKey(keyData)

End Function

End Class


EditWindow Property - C#

C#

private void fg_BeforeScroll( object sender,
C1.Win.C1FlexGrid.RangeEventArgs e) fg.BeforeScroll {

if (!fg.EditWindow.Equals(0) && e.OldRange.TopRow != e.NewRange.TopRow ) {

e.Cancel = true;

}


EditWindow Property - Delphi

Delphi

procedure fg_BeforeScroll(sender: System.Object;

e: C1.Win.C1FlexGrid.RangeEventArgs);

begin

If Not fg.EditWindow.Equals(0) and (e.OldRange.TopRow <> e.NewRange.TopRow) Then

e.Cancel := True;

end;


EditWindow Property - Visual Basic

Visual Basic

Private Sub fg_BeforeScroll(ByVal sender As Object, _

ByVal e As C1.Win.C1FlexGrid.RangeEventArgs) Handles fg.BeforeScroll

If Not fg.EditWindow.Equals(0) AndAlso e.OldRange.TopRow <> e.NewRange.TopRow Then

e.Cancel = True

End Sub


ExplorerBar Property - C#

C#

//allow sorting, moving rows, and moving columns

fg.ExplorerBar = ExplorerBarSettings.flexExMoveRows ||

ExplorerBarSettings.flexExSortShowAndMove;


ExplorerBar Property - Delphi

Delphi

//allow sorting, moving rows, and moving columns

fg.ExplorerBar := (ExplorerBarSettings.flexExMoveRows or ExplorerBarSettings.flexExSortShowAndMove);


ExplorerBar Property - Visual Basic

Visual Basic

'allow sorting, moving rows, and moving columns

fg.ExplorerBar = ExplorerBarSettings.flexExMoveRows Or ExplorerBarSettings.flexExSortShowAndMove


ExtendLastCol setting - C#

C#

// print grid using PrintGrid method

_flex.PrinGrid("mygrid",

PrintGridFlags.ShowPreviewDialog | PrintGridFlags.ExtendLastCol);

// print grid using C1PrintDocument

_flex.PrintParameters.PrintGridFlags = PrintGridFlags.ExtendLastCol;

C1PrintDocument c1pd = new C1PrintDocument();

c1pd.StartDoc();

c1pd.RenderBlockText("This is a C1PrintDocument.");

c1pd.RenderBlockText(" ");

c1pd.RenderBlockC1Printable(_flex, c1pd.BodyAreaSize.Width);

c1pd.EndDoc();


ExtendLastCol setting - Delphi

Delphi

_flex.PrinGrid('mygrid', (PrintGridFlags.ShowPreviewDialog or PrintGridFlags.ExtendLastCol));

_flex.PrintParameters.PrintGridFlags := PrintGridFlags.ExtendLastCol;

c1pd := C1PrintDocument.Create;

c1pd.StartDoc;

c1pd.RenderBlockText('This is a C1PrintDocument.');

c1pd.RenderBlockText(' ');

c1pd.RenderBlockC1Printable(_flex, c1pd.BodyAreaSize.Width);

c1pd.EndDoc;


ExtendLastCol setting - Visual Basic

Visual Basic

' print grid using PrintGrid method

_flex.PrinGrid("mygrid", PrintGridFlags.ShowPreviewDialog Or PrintGridFlags.ExtendLastCol)

' print grid using C1PrintDocument

_flex.PrintParameters.PrintGridFlags = PrintGridFlags.ExtendLastCol

Dim c1pd As New C1PrintDocument()

c1pd.StartDoc()

c1pd.RenderBlockText("This is a C1PrintDocument.")

c1pd.RenderBlockText(" ")

c1pd.RenderBlockC1Printable(_flex, c1pd.BodyAreaSize.Width)

c1pd.EndDoc()


FixedCols Property - C#

C#

fg.FixedCols = 3;


FixedCols Property - Delphi

Delphi

fg.FixedCols := 3;


FixedCols Property - Visual Basic

Visual Basic

fg.FixedCols = 3


FixedRows Property - C#

C#

fg.FixedRows = 3;


FixedRows Property - Delphi

Delphi

fg.FixedRows := 3;


FixedRows Property - Visual Basic

Visual Basic

fg.FixedRows = 3


FooterFont Property - C#

C#

GridPrinter gp = flex.PrinterSettings;

gp.FooterFont = new Font("Arial", 16, FontStyle.Bold);

flex.PrintGrid("my grid",

PrintGridFlags.ActualSize, "Header\t\t{0}", "Footer");


FooterFont Property - Delphi

Delphi

var

gp: GridPrinter;

begin

gp := flex.PrinterSettings;

gp.FooterFont := Font.Create('Arial', 16, FontStyle.Bold);

flex.PrintGrid('my grid', PrintGridFlags.ActualSize, 'Header'#9#9'{0}', 'Footer');

end;


FooterFont Property - Visual Basic

Visual Basic

Dim gp As GridPrinter = flex.PrinterSettings

gp.FooterFont = New Font("Arial", 16, FontStyle.Bold)

flex.PrintGrid("my grid", PrintGridFlags.ActualSize, _

"Header" + vbTab + vbTab + "{0}", "Footer")


Footer Property - C#

C#

GridPrinter gp = _flex.PrintParameters;

gp.Footer = "Hello\tWorld\tFooter";

gp.PrintGridFlags = C1.Win.C1FlexGrid.PrintGridFlags.FitToPageWidth;

PrintPreviewDialog dlg = new PrintPreviewDialog();

dlg.Document = gp.PrintDocument;

dlg.ShowDialog();


Footer Property - Delphi

Delphi

var

dlg: PrintPreviewDialog;

gp: GridPrinter;

begin

gp := _flex.PrintParameters;

gp.Footer := 'Hello'#9'World'#9'Footer';

gp.PrintGridFlags := C1.Win.C1FlexGrid.PrintGridFlags.FitToPageWidth;

dlg := PrintPreviewDialog.Create;

dlg.Document := gp.PrintDocument;

dlg.ShowDialog;

end;


Footer Property - Visual Basic

Visual Basic

Dim gp As GridPrinter = _flex.PrintParameters

gp.Footer = "Hello" + ControlChars.Tab + "World" + ControlChars.Tab + "Footer"

gp.PrintGridFlags = C1.Win.C1FlexGrid.PrintGridFlags.FitToPageWidth

Dim dlg As New PrintPreviewDialog()

dlg.Document = gp.PrintDocument

dlg.ShowDialog()


Format Property (CellStyle) - C#

C#

CellStyle s = _flex.Styles.Add("BigNumber");

s.Format = "#,##0.##";

CellRange r = _flex.GetCellRange(10,10);

rg.Style = s;


Format Property (CellStyle) - Delphi

Delphi

var

r: CellRange;

s: CellStyle;

begin

s := _flex.Styles.Add('BigNumber');

s.Format := '#,##0.##';

r := _flex.GetCellRange(10, 10);

rg.Style := s;

end;


Format Property (CellStyle) - Visual Basic

Visual Basic

Dim s As CellStyle = _flex.Styles.Add("BigNumber")

s.Format = "#,##0.##"

Dim r As CellRange = _flex.GetCellRange(10, 10)

rg.Style = s


Formatting a Cell as ReadOnly2 - C#

C#

private void flex_BeforeEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)

{

for (int i = 1; i <= 9; i++) {

if (e.Col == 1 & e.Row == i) {

e.Cancel = true;

}

}

}


Formatting a Cell as ReadOnly2 - Delphi

Delphi

procedure flex_BeforeEdit(sender: System.Object; e: C1.Win.C1FlexGrid.RowColEventArgs);

var

i: Integer;

begin

for I := 1 to 9 do

if (e.Col = 1) and (e.Row = i)

e.Cancel := True;

end;


Formatting a Cell as ReadOnly2 - Visual Basic

Visual Basic

Private Sub flex_BeforeEdit(ByVal sender As Object, ByVal e As C1.Win.C1FlexGrid.RowColEventArgs) Handles flex.BeforeEdit

Dim i As Integer

For i = 1 To 9

If e.Col = 1 And e.Row = i Then

e.Cancel = True

End If

Next

End Sub


Formatting a Cell as ReadOnly - C#

C#

private void flex_BeforeEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)

{

if (e.Row == 1 & e.Col == 1) {

e.Cancel = true;

}

}


Formatting a Cell as ReadOnly - Delphi

Delphi

procedure flex_BeforeEdit(sender: System.Object; e: C1.Win.C1FlexGrid.RowColEventArgs);

begin

if (e.Row = 1) and (e.Col = 1)

e.Cancel := True;

end;


Formatting a Cell as ReadOnly - Visual Basic

Visual Basic

Private Sub flex_BeforeEdit(ByVal sender As Object, ByVal e As C1.Win.C1FlexGrid.RowColEventArgs) Handles flex.BeforeEdit

If e.Row = 1 And e.Col = 1 Then

e.Cancel = True

End If

End Sub


Formatting a Cell with Decimal Content2 - C#

C#

flex.Cols[1].Format = "$#,##0.00";


Formatting a Cell with Decimal Content2 - Delphi

Delphi

flex.Cols[1].Format := ‘$#,##0.00’;


Formatting a Cell with Decimal Content2 - Visual Basic

Visual Basic

flex.Cols(1).Format = "$#,##0.00"


Formatting a Cell with Decimal Content - C#

C#

flex[1, 1] = 1000;

flex[2, 1] = 3450;

flex[3, 1] = 8249;


Formatting a Cell with Decimal Content - Delphi

Delphi

flex[1, 1] := 1000;

flex[2, 1] := 3450;

flex[3, 1] := 8249;


Formatting a Cell with Decimal Content - Visual Basic

Visual Basic

flex(1, 1) = 1000

flex(2, 1) = 3450

flex(3, 1) = 8249


Formatting Cells Based on their Contents2 - C#

C#

// Format cells based on their content

private void flex_CellChanged(object sender, RowColEventArgs e)

// Mark currency values > 50,000 as LargeValues

// Reset others by setting their Style to Nothing)

{

CellStyle cs;

if (Val(flex(e.Row, e.Col)) >= 50000) {

cs = flex.Styles("LargeValue");

}

flex.SetCellStyle(e.Row, e.Col, cs);

}


Formatting Cells Based on their Contents2 - Delphi

Delphi

procedure flex_CellChanged(sender: System.Object; e: RoeColEventArgs);

var

cs: CellStyle;

begin

if (double.Parse(flex[e.Row, e.Col]) >= 50000)

begin

cs := flex.Styles[‘LargeValue’];

end;

flex.SetCellStyle(e.Row, e.Col, cs);

end;


Formatting Cells Based on their Contents2 - Visual Basic

Visual Basic

'Format cells based on their content

Private Sub flex_CellChanged(ByVal sender As Object, ByVal e As RowColEventArgs) Handles flex.CellChanged

'Mark currency values > 50,000 as LargeValues

'Reset others by setting their Style to Nothing)

Dim cs As CellStyle

If Val(flex(e.Row, e.Col)) >= 50000 Then

cs = flex.Styles("LargeValue")

End If

flex.SetCellStyle(e.Row, e.Col, cs)

End Sub


Formatting Cells Based on their Contents - C#

C#

private void Form1_Load(object sender, System.EventArgs e)

{

CellStyle cs;

cs = flex.Styles.Add("LargeValue");

cs.Font = new Font(Font, FontStyle.Italic);

cs.BackColor = Color.Gold;

}


Formatting Cells Based on their Contents - Delphi

Delphi

procedure Form1_Load(sender: System.Object; e: System.EventArgs)

var

cs: CellStyle;

begin

cs := flex.Styles.Add(‘LargeValue’);

cs.Font := Font.Create(Font, FontStyle.Italic);

cs.BackColor := Color.Gold;

end;


Formatting Cells Based on their Contents - Visual Basic

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim cs As CellStyle

'Create a custom style for large values

cs = flex.Styles.Add("LargeValue")

cs.Font = New Font(Font, FontStyle.Italic)

cs.BackColor = Color.Gold

End Sub


GetCellCheck Method - C#

C#

fg.Cols("bools").Format = "Yes;No";


GetCellCheck Method - C#2

C#

fg.SetCellCheck(3, 3, CheckEnum.Unchecked); // boolean

fg.SetCellCheck(4, 3, CheckEnum.TSUnchecked); // tri-state


GetCellCheck Method - Delphi

Delphi

fg.Cols['bools'].Format := 'Yes;No';


GetCellCheck Method - Delphi2

Delphi

fg.SetCellCheck(3, 3, CheckEnum.Unchecked);

fg.SetCellCheck(4, 3, CheckEnum.TSUnchecked);


GetCellCheck Method - Visual Basic

Visual Basic

fg.Cols("bools").Format = "Yes;No"


GetCellCheck Method - Visual Basic2

Visual Basic

fg.SetCellCheck(3, 3, CheckEnum.Unchecked) ' boolean

fg.SetCellCheck(4, 3, CheckEnum.TSUnchecked) ' tri-state


GetCellRange Method - C#

C#

CellRange rg = flex.GetCellRange(5, 5, 20, 8);

rg.Style = flex.Styles["MyStyle"];


GetCellRange Method - C#2

C#

// this does not compile!!!

flex.GetCellRange(5, 5, 20, 8).Style = flex.Styles["MyStyle"];


GetCellRange Method - Delphi

Delphi

var

rg: CellRange;

begin

rg := flex.GetCellRange(5, 5, 20, 8);

rg.Style := flex.Styles['MyStyle'];

end;


GetCellRange Method - Delphi2

Delphi

flex.GetCellRange(5, 5, 20, 8).Style := flex.Styles['MyStyle'];


GetCellRange Method - Visual Basic

Visual Basic

Dim rg As CellRange = flex.GetCellRange(5, 5, 20, 8)

rg.Style = flex.Styles("MyStyle")


GetCellRange Method - Visual Basic2

Visual Basic

' this does not compile!!!

flex.GetCellRange(5, 5, 20, 8).Style = flex.Styles("MyStyle")


GetData Method - C#

C#

object foo;

foo = fg.GetData(row, col); // is equivalent to

foo = fg[row, col];


GetData Method - Delphi

Delphi

var

foo: System.Object;

begin

foo := fg.GetData(row, col);

foo := fg[row, col];

end;


GetData Method - Visual Basic

Visual Basic

Dim foo As Object

foo = fg.GetData(row, col) ' is equivalent to

foo = fg(row, col)


GetMergedRange Method - C#

C#

// create a merged range

fg.MergeCells = MergeSettings.flexMergeFree;

fg.set_MergeRow(1, true);

fg.set_Cell(CellPropertySettings.flexcpText,

1, 1, 1, 4, "Merged Range");

// this changes only cell 1, 1

fg.set_Cell(CellPropertySettings.flexcpText,

1, 1, "Merged Range Has Changed");

// this changes the whole merged range

r1&, c1&, r2&, c2&;

fg.GetMergedRange (1, 2, r1, r2, c1, c2);

fg.set_Cell(CellPropertySettings.flexcpText,
1, 1, 1, 4, "Merged Range Has Changed");


GetMergedRange Method - Delphi

Delphi

var

r1, r2, c1, c2: Integer;

begin

// create a merged range

fg.MergeCells := MergeSettings.flexMergeFree;

fg.set_MergeRow(1, True);

fg.set_Cell(CellPropertySettings.flexcpText, 1, 1, 1, 4, 'Merged Range');

// this changes only cell 1, 1
fg.set_Cell(CellPropertySettings.flexcpText, 1, 1, 'Merged Range Has Changed');

// this changes the whole merged range

fg.GetMergedRange(1, 2, r1, r2, c1, c2);

fg.set_Cell(CellPropertySettings.flexcpText, 1, 1, 1, 4, 'Merged Range Has Changed');

end;


GetMergedRange Method - Visual Basic

Visual Basic

' create a merged range

fg.MergeCells = MergeSettings.flexMergeFree
fg.set_MergeRow(1, True)
fg.set_Cell(CellPropertySettings.flexcpText,
1, 1, 1, 4, "Merged Range")

' this changes only cell 1, 1
fg.set_Cell(CellPropertySettings.flexcpText,_
1, 1, "Merged Range Has Changed")

' this changes the whole merged range
Dim r1&, c1&, r2&, c2&
fg.GetMergedRange (1, 2, r1, r2, c1, c2)
fg.set_Cell(CellPropertySettings.flexcpText, _
1, 1, 1, 4, "Merged Range Has Changed")


GetSelection Method - C#

C#

r&, c&, r1&, c1, r2&, c2&;

fg.GetSelection (r1, c1, r2, c2);

for ( r = r1; r <= r2

for ( c = c1; c <= c2

Console.WriteLine (fg.get_TextMatrix (r,c));

}

}


GetSelection Method - Delphi

Delphi

var

r, c, r1, r2, c1, c2: Integer;

begin

fg.GetSelection(r1, c1, r2, c2);

for r := r1 to r2 do

for c := c1 to c2 do

Console.WriteLine(fg.get_TextMatrix(r, c));

end;


GetSelection Method - Visual Basic

Visual Basic

Dim r&, c&, r1&, c1, r2&, c2&

fg.GetSelection (r1, c1, r2, c2)
For r = r1 To r2
For c = c1 To c2
Debug.WriteLine (fg.get_TextMatrix (r,c))
Next
Next


GetUnboundValue - C#

C#

private void Form1_Load(object sender, System.EventArgs e)

{

// load table from db

DataTable dt = GetProductDataTable();

// bind to grid

_flex.Cols[0].Width = 20;

_flex.ShowCursor = true;

_flex.DataSource = dt;

// add unbound column

Column col = _flex.Cols.Add();

col.Name = col.Caption = "Unbound";

}

// keep unbound values in a hashtable

Hashtable _hash = new Hashtable();

// get value from hashtable using ProductID as key

private void _flex_GetUnboundValue(object sender,

C1.Win.C1FlexGrid.UnboundValueEventArgs e)

{

DataRowView drv = (DataRowView)_flex.Rows[e.Row].DataSource;

e.Value = _hash[drv["ProductID"]];

}

// store value in hashtable using ProductID as key

private void _flex_SetUnboundValue(object sender,

C1.Win.C1FlexGrid.UnboundValueEventArgs e)

{

DataRowView drv = (DataRowView)_flex.Rows[e.Row].DataSource;

_hash[drv["ProductID"]] = e.Value;

}


GetUnboundValue - Delphi

Delphi

TWinForm1 = class(TWinForm)

private

// keep unbound values in a hashtable

Fhash: Hashtable;

end;

constructor TWinForm.Create;

begin

inherited Create;

//

// Required for Windows Form Designer support

//

InitializeComponent;

//
Fhash := Hashtable.Create;

end;

procedure TWinForm1.TWinForm_Load(sender: System.Object; e: System.EventArgs);

var dt: DataTable;

col: Column;

begin

// load table from db

dt := GetProductDataTable;

// bind to grid

_flex.Cols[0].Width := 20;

_flex.ShowCursor := true;

_flex.DataSource := dt;

// add unbound column

col := _flex.Cols.Add;

col.Name := ‘Unbound’;

col.Caption := col.Name;

end;

// get value from hashtable using ProductID as key

procedure TWinForm1._flex_GetUnboundValue(sender: System.Object; e: C1.Win.C1FlexGrid.UnboundValueEventArgs);

var drv: DataRowView;

begin

drv := DataRowView(_flex.Rows[e.Row].DataSource);

e.Value := Fhash[drv[‘ProductID’]];

end;

// store value in hashtable using ProductID as key

procedure TWinForm1._flex_SetUnboundValue(sender: System.Object; e: C1.Win.C1FlexGrid.UnboundValueEventArgs);

var drv: DataRowView;

begin

drv := DataRowView(_flex.Rows[e.Row].DataSource);

Fhash[drv[‘ProductID’]] := e.Value;

end;


GetUnboundValue - Visual Basic

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load

' load table from db

Dim dt As DataTable = GetProductDataTable()

' bind to grid

_flex.Cols(0).Width = 20

_flex.ShowCursor = True

_flex.DataSource = dt

' add unbound column

Dim col As Column = _flex.Cols.Add()

col.Name = col.Caption = "Unbound"

End Sub

' keep unbound values in a hashtable

Dim _hash As New Hashtable()

Private Sub _flex_GetUnboundValue(ByVal sender As Object, _

ByVal e As C1.Win.C1FlexGrid.UnboundValueEventArgs) _

Handles _flex.GetUnboundValue

Dim drv As DataRowView = _flex.Rows(e.Row).DataSource

e.Value = _hash(drv("ProductID"))

End Sub

Private Sub _flex_SetUnboundValue(ByVal sender As Object, _

ByVal e As C1.Win.C1FlexGrid.UnboundValueEventArgs) _

Handles _flex.SetUnboundValue

Dim drv As DataRowView = _flex.Rows(e.Row).DataSource

_hash(drv("ProductID")) = e.Value

End Sub

End Sub


Get_ValueMatrix Method - C#

C#

Console.WriteLine(fg.get_ValueMatrix(1, 1));


Get_ValueMatrix Method - Delphi

Delphi

Console.WriteLine(fg.get_ValueMatrix(1, 1));


Get_ValueMatrix Method - Visual Basic

Visual Basic

Debug.WriteLine(fg.get_ValueMatrix(1, 1))


Glyphs Property - C#

C#

_flex.Glyphs[GlyphEnum.Ascending] = imgAscending;

_flex.Glyphs[GlyphEnum.Descending] = imgDescending;


Glyphs Property - Delphi

Delphi

_flex.Glyphs[GlyphEnum.Ascending] := imgAscending;

_flex.Glyphs[GlyphEnum.Descending] := imgDescending;


Glyphs Property - Visual Basic

Visual Basic

_flex.Glyphs(GlyphEnum.Ascending) = imgAscending '

_flex.Glyphs(GlyphEnum.Descending) = imgDescending '


HeaderFont Property - C#

C#

GridPrinter gp = flex.PrinterSettings;

gp.HeaderFont = new Font("Arial", 16, FontStyle.Bold);

flex.PrintGrid("my grid", PrintGridFlags.ActualSize,

"Header\t\t{0}", "Footer");


HeaderFont Property - Delphi

Delphi

var

gp: GridPrinter;

begin

gp := flex.PrinterSettings;

gp.HeaderFont := Font.Create('Arial', 16, FontStyle.Bold);

flex.PrintGrid('my grid', PrintGridFlags.ActualSize, 'Header'#9#9'{0}', 'Footer');

end;


HeaderFont Property - Visual Basic

Visual Basic

Dim gp As GridPrinter = flex.PrinterSettings

gp.HeaderFont = New Font("Arial", 16, FontStyle.Bold)

flex.PrintGrid("my grid", PrintGridFlags.ActualSize, _

"Header" + vbTab + vbTab + "{0}", "Footer")


Header Property - C#

C#

GridPrinter gp = _flex.PrintParameters;

gp.Header = "Hello\tWorld\tHeader";

gp.PrintGridFlags = C1.Win.C1FlexGrid.PrintGridFlags.FitToPageWidth;

PrintPreviewDialog dlg = new PrintPreviewDialog();

dlg.Document = gp.PrintDocument;

dlg.ShowDialog();


Header Property - Delphi

Delphi

var

dlg: PrintPreviewDialog;

gp: GridPrinter;

begin

gp := _flex.PrintParameters;

gp.Header := 'Hello'#9'World'#9'Header';

gp.PrintGridFlags := C1.Win.C1FlexGrid.PrintGridFlags.FitToPageWidth;

dlg := PrintPreviewDialog.Create;

dlg.Document := gp.PrintDocument;

dlg.ShowDialog;

end;


Header Property - Visual Basic

Visual Basic

Dim gp As GridPrinter = _flex.PrintParameters

gp.Header = "Hello" & vbTab & "World" &_

vbTab + "Header"

gp.PrintGridFlags = C1.Win.C1FlexGrid.PrintGridFlags.FitToPageWidth

Dim dlg As New PrintPreviewDialog()

dlg.Document = gp.PrintDocument

dlg.ShowDialog()


HitTest Method - C#

C#

private void _flex_BeforeMouseDown(object sender, BeforeMouseDownEventArgs e)

{

HitTestInfo hti = _flex.HitTest(e.X, e.Y);

Console.WriteLine("at {0},{1}: row {2} col {3} type {4}",

hti.X, hti.Y, hti.Row, hti.Column, hti.Type);

}


HitTest Method - C#2

C#

private void _flex_DoubleClick(object sender, System.EventArgs e)

{

Point pt = Control.MousePosition;

pt = _flex.PointToClient(pt);

HitTestInfo hti = _flex.HitTest(pt.X, pt.Y);

Console.WriteLine("at {0},{1}: row {2} col {3} type {4}",
hti.X, hti.Y, hti.Row, hti.Column, hti.Type);

}


HitTest Method - Delphi

Delphi

var

hti: HitTestInfo;

items: array of object;

begin

hti := _flex.HitTest(e.X, e.Y);

SetLength(items, 5);

items[0] := System.Object(hti.X);

items[1] := System.Object(hti.Y);

items[2] := System.Object(hti.Row);

items[3] := System.Object(hti.Column);

items[4] := System.Object(hti.Type);

Console.WriteLine('at {0},{1}: row {2} col {3} type {4}',

items);

end;


HitTest Method - Delphi2

Delphi

var

hti: HitTestInfo;

pt: Point;

items: array of object;

begin

pt := Control.MousePosition;

pt := _flex.PointToClient(pt);

hti := _flex.HitTest(pt.X, pt.Y);

SetLength(items, 5);

items[0] := System.Object(hti.X);

items[1] := System.Object(hti.Y);

items[2] := System.Object(hti.Row);

items[3] := System.Object(hti.Column);

items[4] := System.Object(hti.Type);

Console.WriteLine('at {0},{1}: row {2} col {3} type {4}',

items);

end;


HitTest Method - Visual Basic

Visual Basic

Private Sub _flex_BeforeMouseDown(sender As Object, e As BeforeMouseDownEventArgs)

Dim hti As HitTestInfo = _flex.HitTest(e.X, e.Y)

Console.WriteLine("at {0},{1}: row {2} col {3} type {4}", _

hti.X, hti.Y, hti.Row, hti.Column, hti.Type)

End Sub


HitTest Method - Visual Basic2

Visual Basic

Private Sub _flex_DoubleClick(sender As Object, e As System.EventArgs)

Dim pt As Point = Control.MousePosition

pt = _flex.PointToClient(pt)

Dim hti As HitTestInfo = _flex.HitTest(pt.X, pt.Y)

Console.WriteLine("at {0},{1}: row {2} col {3} type {4}", _

hti.X, hti.Y, hti.Row, hti.Column, hti.Type)

End Sub


ImageAlign Property (Column) - C#

C#

flex.Cols[1].ImageAlign = ImageAlignEnum.RightTop;

Console.WriteLine(flex.Cols[1].Style.ImageAlign);

ImageAlignEnum.RightTop


ImageAlign Property (Column) - Delphi

Delphi

flex.Cols[1].ImageAlign := ImageAlignEnum.RightTop;

Console.WriteLine(flex.Cols[1].Style.ImageAlign);

ImageAlignEnum.RightTop;


ImageAlign Property (Column) - Visual Basic

Visual Basic

flex.Cols(1).ImageAlign = ImageAlignEnum.RightTop

Console.WriteLine(flex.Cols(1).Style.ImageAlign)

ImageAlignEnum.RightTop


ImageMap Property (Column) - C#

C#

private enum Countries

{

Australia, Brazil, Canada, Denmark, France,

Germany, Italy, Japan, Korea, Mexico,

Netherlands, Portugal, Russia, Spain, Turkey, USA

};

// set up image map

Hashtable imgMap = new Hashtable();

for (i = 0; i < imgListFlags.Images.Count; i++)

imgMap.Add((Countries)i, imgListFlags.Images[i]);

Column col = flex.Cols["countries"];

col.ImageMap = imgMap;

col.ImageAndText = false;

col.ImageAlign = ImageAlignEnum.CenterCenter;


ImageMap Property (Column) - Delphi

Delphi

type

Countries = (Australia, Brazil, Canada, Denmark, France, Germany, Italy, Japan, Korea, Mexico, Netherlands, Portugal, Russia, Spain, Turkey, USA);

var

col: Column;

imgMap: Hashtable;

begin

imgMap := Hashtable.Create;

for i := 0 to imgListFlags.Images.Count – 1 do

imgMap.Add(System.Object(i), imgListFlags.Images[i]);

col := flex.Cols['countries'];

col.ImageMap := imgMap;

col.ImageAndText := False;

col.ImageAlign := ImageAlignEnum.CenterCenter;

end;


ImageMap Property (Column) - Visual Basic

Visual Basic

Private Enum Countries

Australia

Brazil

Canada

Denmark

France

Germany

Italy

Japan

Korea

Mexico

Netherlands

Portugal

Russia

Spain

Turkey

USA

End Enum

' set up image map

Dim imgMap As New Hashtable()

For i = 0 To imgListFlags.Images.Count - 1

imgMap.Add(CType(i, Countries), imgListFlags.Images(i))

Next i

Dim col As Column = flex.Cols("countries")

col.ImageMap = imgMap

col.ImageAndText = False

col.ImageAlign = ImageAlignEnum.CenterCenter


Image Property (Node) - C#

C#

Image img1 = node.Image;

int row = nd.Row.SafeIndex;

int col = flex.Tree.Column;

Image img2 = flex.GetCellImage(row, col);

Debug.Assert(img1.Equals(img2), "img1 and img2 are the same image");


Image Property (Node) - Delphi

Delphi

var

img2: Image;

col: Integer;

row: Integer;

img1: Image;

begin

img1 := node.Image;

row := nd.Row.SafeIndex;

col := flex.Tree.Column;

img2 := flex.GetCellImage(row, col);

Debug.Assert(img1.Equals(img2), 'img1 and img2 are the same image');

end;


Image Property (Node) - Visual Basic

Visual Basic

Dim img1 As Image = node.Image

Dim row As Integer = nd.Row.SafeIndex

Dim col As Integer = flex.Tree.Column

Dim img2 As Image = flex.GetCellImage(row, col)

Debug.Assert(img1.Equals(img2), "img1 and img2 are the same image")


Index Property (Row) - C#

C#

Row row = _flex.Rows[12];

Console.WriteLine("*** Row index is {0}", row.Index);

*** Row index is 12


Index Property (Row) - Delphi

Delphi

var

r: Row;

begin

r := _flex.Rows[12];

Console.WriteLine('*** Row index is {0}', r.Index);

end;


Index Property (Row) - Visual Basic

Visual Basic

Dim row As Row = _flex.Rows(12)

Console.WriteLine("*** Row index is {0}", row.Index)


Item Property - C#

C#

// create a column, assign it a name and get the new index

Column myCol = flex.Cols.Add();

myCol.Name = "address";

myCol.DataType = typeof(string);

int colIndex = myCol.Index;

// assign a value to a cell using cell coordinates:

flex[1, colIndex] = "555, Broadway";

// get the value using the column name

MessageBox.Show("The address is " + flex[1, "address"].ToString());


Item Property (ColumnCollection) - C#

C#

// set the column name

flex.Cols[2].Name = "bools";

flex.Cols[2].DataType = typeof(bool);

// show boolean column as text

flex.Cols["bools"].Format = "Yes;No";


Item Property (ColumnCollection) - Delphi

Delphi

// set the column name

flex.Cols[2].Name := 'bools';

flex.Cols[2].DataType := TypeOf(Boolean);

// show boolean column as text

flex.Cols['bools'].Format := 'Yes;No';


Item Property (ColumnCollection) - Visual Basic

Visual Basic

' set the column name

flex.Cols(2).Name = "bools" '

flex.Cols(2).DataType = GetType(Boolean) '

' show boolean column as text

flex.Cols("bools").Format = "Yes;No" '


Item Property - Delphi

Delphi

var

colIndex: Integer;

myCol: Column;

begin

myCol := flex.Cols.Add;

myCol.Name := 'address';

myCol.DataType := TypeOf(string);

colIndex := myCol.Index;

flex[1] := '555, Broadway';

MessageBox.Show(('The address is ' + flex[1].ToString);

end;


Item Property (GridGlyphs) - C#

C#

_flex.Glyphs[GlyphEnum.Ascending] = imgAscending;

_flex.Glyphs[GlyphEnum.Descending] = imgDescending;


Item Property (GridGlyphs) - Delphi

Delphi

_flex.Glyphs[GlyphEnum.Ascending] := imgAscending;

_flex.Glyphs[GlyphEnum.Descending] := imgDescending;


Item Property (GridGlyphs) - Visual Basic

Visual Basic

_flex.Glyphs(GlyphEnum.Ascending) = imgAscending

_flex.Glyphs(GlyphEnum.Descending) = imgDescending


Item Property - Visual Basic

Visual Basic

' create a column, assign it a name and get the new index

Dim myCol As Column = flex.Cols.Add()

myCol.Name = "address"

myCol.DataType = GetType(String)

Dim colIndex As Integer = myCol.Index

' assign a value to a cell using cell coordinates:

flex(1, colIndex) = "555, Broadway" '

' get the value using the column name

MessageBox.Show(("The address is " + flex(1, "address").ToString()))


KeyActionTab Property - C#

C#

private void flex_Enter(object sender, System.EventArgs e)

{

flex.Select(flex.Rows.Fixed, flex.Cols.Fixed);

}

private void flex_RowColChange(object sender, System.EventArgs e)

{

bool lastCell = (flex.Col == flex.Cols.Count-1 &&

flex.Row == flex.Rows.Count-1);

flex.KeyActionTab = (lastCell)

? KeyActionEnum.None

: KeyActionEnum.MoveAcross;

}


KeyActionTab Property - Delphi

Delphi

procedure Class1.flex_Enter(sender: System.Object; e: System.EventArgs);

begin

flex.Select(flex.Rows.Fixed, flex.Cols.Fixed);

end;

procedure flex_RowColChange(sender: System.Object; e: System.EventArgs);

var

lastCell: Boolean;

begin

lastCell := (flex.Col = flex.Cols.Count – 1_ And

(flex.Row = flex.Rows.Count – 1);

If lastCell Then

flex.KeyActionTab := KeyActionEnum.None

Else

flex.KeyActionTab := KeyActionEnum.MoveAcross;

end;


KeyActionTab Property - Visual Basic

Visual Basic

Private Sub flex_Enter(sender As Object, e As System.EventArgs)

flex.Select(flex.Rows.Fixed, flex.Cols.Fixed)

End Sub 'flex_Enter

Private Sub flex_RowColChange(sender As Object, e As System.EventArgs)

Dim lastCell As Boolean

lastCell = flex.Col = flex.Cols.Count - 1 And _

flex.Row = flex.Rows.Count - 1

If lastCell Then

flex.KeyActionTab = KeyActionEnum.None

Else

flex.KeyActionTab = KeyActionEnum.MoveAcross

End If

End Sub 'flex_RowColChange


KeyDownEdit Event - C#

C#

string selText = "";

Control ctl = flex.Editor

if (ctl is TextBox) selText = ((TextBox)ctl).SelectedText;

if (ctl is ComboBox) selText = ((ComboBox)ctl).SelectedText;


KeyDownEdit Event - Delphi

Delphi

var

ctl: Control;

selText: string;

begin

selText := '';

ctl := flex.Editor;

if (ctl is TextBox) then selText := TextBox(ctl).SelectedText;

if (ctl is ComboBox) then selText := ComboBox(ctl).SelectedText;

end;


KeyDownEdit Event - Visual Basic

Visual Basic

Dim selText As String = ""

Dim ctl As Control = flex.Editor

If TypeOf ctl Is TextBox Then

selText = CType(ctl, TextBox).SelectedText

End If

If TypeOf ctl Is ComboBox Then

selText = CType(ctl, ComboBox).SelectedText

End If


KeyPressEdit Event - C#

C#

string selText = "";

Control ctl = flex.Editor

if (ctl is TextBox) selText = ((TextBox)ctl).SelectedText;

if (ctl is ComboBox) selText = ((ComboBox)ctl).SelectedText;


KeyPressEdit Event - Delphi

Delphi

var

ctl: Control;

selText: string;

begin

selText := '';

ctl := flex.Editor;

if (ctl is TextBox) then selText := TextBox(ctl).SelectedText;

if (ctl is ComboBox) then selText := ComboBox(ctl).SelectedText;

end;


KeyPressEdit Event - Visual Basic

Visual Basic

Dim selText As String = ""

Dim ctl As Control = flex.Editor

If TypeOf ctl Is TextBox Then

selText = CType(ctl, TextBox).SelectedText

End If

If TypeOf ctl Is ComboBox Then

selText = CType(ctl, ComboBox).SelectedText

End If


Key Property - C#

C#

object o1 = node.Key;

object o2 = nd.Row.UserData;

Debug.Assert(o1.Equals(o2), "o1 and o2 refer to the same object");


Key Property - Delphi

Delphi

var

o2: System.Object;

o1: System.Object;

begin

o1 := node.Key;

o2 := nd.Row.UserData;

Debug.Assert(o1.Equals(o2), 'o1 and o2 refer to the same object');

end;


Key Property - Visual Basic

Visual Basic

Dim o1 As Object = node.Key

Dim o2 As Object = nd.Row.UserData

Debug.Assert(o1.Equals(o2), "o1 and o2 refer to the same object")


KeyUpEdit Event - C#

C#

string selText = "";

Control ctl = flex.Editor

if (ctl is TextBox) selText = ((TextBox)ctl).SelectedText;

if (ctl is ComboBox) selText = ((ComboBox)ctl).SelectedText;


KeyUpEdit Event - Delphi

Delphi

var

ctl: Control;

selText: string;

begin

selText := '';

ctl := flex.Editor;

if ctl is TextBox then

selText := TextBox(ctl).SelectedText;

if ctl is ComboBox then

selText := ComboBox(ctl).SelectedText;

end;


KeyUpEdit Event - Visual Basic

Visual Basic

Dim selText As String = ""

Dim ctl As Control = flex.Editor

If TypeOf ctl Is TextBox Then

selText = CType(ctl, TextBox).SelectedText

End If

If TypeOf ctl Is ComboBox Then

selText = CType(ctl, ComboBox).SelectedText

End If


Layout - C#

C#

fg.Rows.Count = 500;

fg.Cols.Count = 10;


Layout - C#2

C#

fg.Rows.Fixed = 1;

fg.Cols.Fixed = 0;


Layout - Delphi

Delphi

fg.Rows.Count := 500;

fg.Cols.Count := 10;


Layout - Delphi2

Delphi

fg.Rows.Fixed := 1;

fg.Cols.Fixed := 0;


Layout - Visual Basic

Visual Basic

fg.Rows.Count = 500

fg.Cols.Count = 10


Layout - Visual Basic2

Visual Basic

fg.Rows.Fixed = 1

fg.Cols.Fixed = 0


Masks - C#

C#

// set up phone number edit mask

fg.Cols[1].EditMask = "(999) 999-9999;


Masks - C#2

C#

fg.Cols[1].DataType=typeof(DateTime);

fg.Cols[1].Format="hh:mm tt";

fg.Cols[1].EditMask="99:99 LL";


Masks - Delphi

Delphi

fg.Cols(1).EditMask := '(999) 999-9999';


Masks - Delphi2

Delphi

fg.Cols[1].DataType := TypeOf(DateTime);

fg.Cols[1].Format := 'hh:mm tt';

fg.Cols[1].EditMask := '99:99 LL';


Masks - Visual Basic

Visual Basic

' set up phone number edit mask

fg.Cols(1).EditMask = "(999) 999-9999


Masks - Visual Basic2

Visual Basic

fg.Cols(1).DataType = GetType(DateTime)

fg.Cols(1).Format = "hh:mm tt"

fg.Cols(1).EditMask = "99:99 LL"


MergeCells Property - C#

C#

// regular spreadsheet view

fg.MergeCells = MergeSettings.flexMergeNever;

fg.set_MergeCol(0, true);

fg.set_MergeCol(1, true);

fg.set_MergeCol(2, true);

fg.set_MergeCol(3, false);


MergeCells Property - C#2

C#

// free merging: notice how the first region cell (East) merges

// across employees (Donna and John) to its left.

fg.MergeCells = MergeSettings.flexMergeFree;

fg.set_MergeCol(0, true);

fg.set_MergeCol(1, true);

fg.set_MergeCol(2, true);

fg.set_MergeCol(3, false);


MergeCells Property - C#3

C#

// restricted merging: notice how the first region cell (East)

// no longer merges across employees to its left.

fg.MergeCells = MergeSettings.flexMergeRestrictAll;

fg.set_MergeCol(0, true);

fg.set_MergeCol(1, true);

fg.set_MergeCol(2, true);

fg.set_MergeCol(3, false);


MergeCells Property - Delphi

Delphi

begin

fg.MergeCells := MergeSettings.flexMergeNever;

fg.set_MergeCol(0, True);

fg.set_MergeCol(1, True);

fg.set_MergeCol(2, True);

fg.set_MergeCol(3, False);

end;


MergeCells Property - Delphi2

Delphi

begin

// free merging: notice how the first region cell (East) merges

// across employees (Donna and John) to its left.

fg.MergeCells := MergeSettings.flexMergeFree;

fg.set_MergeCol(0, True);

fg.set_MergeCol(1, True);

fg.set_MergeCol(2, True);

fg.set_MergeCol(3, False);

end;


MergeCells Property - Delphi3

Delphi

begin

// restricted merging: notice how the first region cell (East)

// no longer merges across employees to its left.

fg.MergeCells := MergeSettings.flexMergeRestrictAll;

fg.set_MergeCol(0, True);

fg.set_MergeCol(1, True);

fg.set_MergeCol(2, True);

fg.set_MergeCol(3, False);

end;


MergeCells Property - Visual Basic

Visual Basic

' regular spreadsheet view

fg.MergeCells = MergeSettings.flexMergeNever

fg.set_MergeCol(0, True)

fg.set_MergeCol(1, True)

fg.set_MergeCol(2, True)

fg.set_MergeCol(3, False)


MergeCells Property - Visual Basic2

Visual Basic

' free merging: notice how the first region cell (East) merges

' across employees (Donna and John) to its left.

fg.MergeCells = MergeSettings.flexMergeFree

fg.set_MergeCol(0, True)

fg.set_MergeCol(1, True)

fg.set_MergeCol(2, True)

fg.set_MergeCol(3, False)


MergeCells Property - Visual Basic3

Visual Basic

' restricted merging: notice how the first region cell (East)

' no longer merges across employees to its left.

fg.MergeCells = MergeSettings.flexMergeRestrictAll

fg.set_MergeCol(0, True)

fg.set_MergeCol(1, True)

fg.set_MergeCol(2, True)

fg.set_MergeCol(3, False)


Merged data views - C#

C#

private void Form1_Load( System.object sender, System.EventArgs e)

{

// bind the grid to a data source

DataSet ds = new DataSet();

SqlDataAdapter1.Fill(ds);

fg.DataSource = ds.Tables[0];

// set up cell merging

fg.AllowMerging = AllowMergingEnum.RestrictCols;

for (int i = fg.Cols.Fixed; i <= fg.Cols.Count – 1; i++)

fg.Cols(i).AllowMerging = true;

}


Merged data views - Delphi

Delphi

procedure Form1_Load(sender: System.Object;_

e: System.EventArgs);

var

I: Integer;

ds: DataSet;

begin

// bind the grid to a data source

ds := DataSet.Create;

SqlDataAdapter1.Fill(ds);

fg.DataSource := ds.Tables[0];

// set up cell merging

fg.AllowMerging := AllowMergingEnum.RestrictCols;

For i := fg.Cols.Fixed To fg.Cols.Count – 1 do

fg.Cols[i].AllowMerging := True;

end;


Merged data views - Visual Basic

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles MyBase.Load

Dim i%

' bind the grid to a data source

Dim ds As New DataSet()

SqlDataAdapter1.Fill(ds)

fg.DataSource = ds.Tables(0)

' set up cell merging

fg.AllowMerging = AllowMergingEnum.RestrictCols

For i = fg.Cols.Fixed To fg.Cols.Count – 1

fg.Cols(i).AllowMerging = True

Next

End Sub


Merged table headers - C#

C#

private void Form1_Load( System.object sender, System.EventArgs e) base.Load

{

i%;

// initialize control

fg.Styles.Normal.WordWrap = true;

fg.Cols.Count = 9;

fg.Rows.Fixed = 2;

fg.AllowMerging = AllowMergingEnum.FixedOnly;

// create row headers

fg.Rows[0].AllowMerging = true;

// four cells with same contents, will merge

CellRange rng = fg.GetCellRange(0, 1, 0, 4);

rng.Data = "North";

// four cells with same contents, will merge

rng = fg.GetCellRange(0, 5, 0, 8);

rng.Data = "South";

for ( i = 1 ; i <= 4; i++)

{

fg[1, i] = "Qtr " + i;

fg[1, i + 4] = "Qtr " + i;

}

// create column header

fg.Cols[0].AllowMerging = true;

// two cells with same contents, will merge

rng = fg.GetCellRange(0, 0, 1, 0);

rng.Data = "Sales by Product";

// align and autosize the cells

fg.Styles.Fixed.TextAlign = TextAlignEnum.CenterCenter;

fg.AutoSizeCols(1, fg.Cols.Count - 1, 10);

}


Merged table headers - Delphi

Delphi

procedure Form1_Load(sender: System.Object; _

e: System.EventArgs);

var

I: Integer;

rng: CellRange;

begin

// initialize control

fg.Styles.Normal.WordWrap := True;

fg.Cols.Count := 9;

fg.Rows.Fixed := 2;

fg.AllowMerging := AllowMergingEnum.FixedOnly;

// create row headers

fg.Rows[0].AllowMerging := True;

// four cells with same contents, will merge

rng := fg.GetCellRange(0, 1, 0, 4);

rng.Data := 'North';

// four cells with same contents, will merge

rng := fg.GetCellRange(0, 5, 0, 8);

rng.Data := 'South';

For i := 1 To 4 do

begin

fg[1, i] := 'Qtr ' + I;

fg[1, i + 4] = 'Qtr ' + I;

end;

// create column header

fg.Cols[0].AllowMerging := True;

// two cells with same contents, will merge

rng := fg.GetCellRange(0, 0, 1, 0);

rng.Data := 'Sales by Product';

// align and autosize the cells

fg.Styles.Fixed.TextAlign := TextAlignEnum.CenterCenter;

fg.AutoSizeCols(1, fg.Cols.Count - 1, 10);

end;


Merged table headers - Visual Basic

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles MyBase.Load

Dim i%

' initialize control

fg.Styles.Normal.WordWrap = True

fg.Cols.Count = 9

fg.Rows.Fixed = 2

fg.AllowMerging = AllowMergingEnum.FixedOnly

' create row headers

fg.Rows(0).AllowMerging = True

' four cells with same contents, will merge

Dim rng As CellRange = fg.GetCellRange(0, 1, 0, 4)

rng.Data = "North"

' four cells with same contents, will merge

rng = fg.GetCellRange(0, 5, 0, 8)

rng.Data = "South"

For i = 1 To 4

fg(1, i) = "Qtr " & i

fg(1, i + 4) = "Qtr " & i

Next

' create column header

fg.Cols(0).AllowMerging = True

' two cells with same contents, will merge

rng = fg.GetCellRange(0, 0, 1, 0)

rng.Data = "Sales by Product"

' align and autosize the cells

fg.Styles.Fixed.TextAlign = TextAlignEnum.CenterCenter

fg.AutoSizeCols(1, fg.Cols.Count - 1, 10)

End Sub


MergeWith Method - C#

C#

// add a combo box to a column (saved with the column style)

_flex.Cols[2].ComboList = "A|B|C|D|E|F";

// apply a new style to the column without disturbing the combo

_flex.Cols[2].Style.MergeWith(flex.Styles.Frozen);

// ** this wouldn't work, it would remove the ComboList saved with the column style

//_flex.Cols[2].Style = flex.Styles.Frozen;


MergeWith Method - Delphi

Delphi

// add a combo box to a column (saved with the column style)

_flex.Cols[2].ComboList := 'A|B|C|D|E|F';

// apply a new style to the column without disturbing the combo

_flex.Cols[2].Style.MergeWith(flex.Styles.Frozen);

// ** this wouldn't work, it would remove the ComboList saved with the column style

//_flex.Cols(2).Style = flex.Styles.Frozen


MergeWith Method - Visual Basic

Visual Basic

' add a combo box to a column (saved with the column style)

_flex.Cols(2).ComboList = "A|B|C|D|E|F"

' apply a new style to the column without disturbing the combo

_flex.Cols(2).Style.MergeWith(flex.Styles.Frozen)

' ** this wouldn't work, it would remove the ComboList saved with the column style

'_flex.Cols(2).Style = flex.Styles.Frozen


MouseCol Property - C#

C#

private void flex_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)

{

// build tooltip text

string str = string.Format("This is cell {0}, {1}",

flex.MouseRow, flex.MouseCol);

// ttip is a Windows.Forms.ToolTip component

if (str != ttip.GetToolTip(flex))

ttip.SetToolTip(flex, str);

}


MouseCol Property - Delphi

Delphi

procedure flex_MouseMove(sender: System.Object; e: System.Windows.Forms.MouseEventArgs);

var

str: string;

begin

// build tooltip text

str := String.Format('This is cell {0}, {1}', flex.MouseRow, flex.MouseCol);

// ttip is a Windows.Forms.ToolTip component

If str <> ttip.GetToolTip(flex) Then

ttip.SetToolTip(flex, str);

end;


MouseCol Property - Visual Basic

Visual Basic

Private Sub flex_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs)

' build tooltip text

Dim str As String = String.Format("This is cell {0}, {1}", flex.MouseRow, flex.MouseCol)

' ttip is a Windows.Forms.ToolTip component

If str <> ttip.GetToolTip(flex) Then

ttip.SetToolTip(flex, str)

End If

End Sub


Multi-Column Combos2 - C#

C#

// create data-based MultiColumnDictionary and assign it to column

// note: the list will automatically be updated is the data source changes.

DataTable dt = GetDataTable("employees");

string[] columnNames = new string[] { "FirstName", "LastName", "Country" };

MultiColumnDictionary map = new MultiColumnDictionary(dt, "EmployeeID", columnNames, 1);

_flex.Cols[2].DataMap = map;


Multi-Column Combos2 - Delphi

Delphi

dt := GetDataTable('employees');

columnNames := array of string.Create('FirstName', 'LastName', 'Country');

map := MultiColumnDictionary.Create(dt, 'EmployeeID', columnNames, 1);

_flex.Cols[2].DataMap := map;


Multi-Column Combos2 - Visual Basic

Visual Basic

' create data-based MultiColumnDictionary and assign it to column

' note: the list will automatically be updated is the data source changes.

Dim dt As DataTable = GetDataTable("employees")

Dim columnNames() As String = New String() {"FirstName", "LastName", "Country"}

Dim map As MultiColumnDictionary = New MultiColumnDictionary(dt,"EmployeeID",columnNames,1)

_flex.Cols(2).DataMap = map


Multi-Column Combos - C#

C#

// create string-based MultiColumnDictionary and assign it to column

// note: this will automatically generate keys of type int for each item,

// the key values will be stored in the grid.

string text = "Row1, Col1\tRow1, Col2|Row2, Col1\tRow2, Col2";

MultiColumnDictionary map = new MultiColumnDictionary(text, 0, true);

_flex.Cols[1].DataMap = map;


Multi-Column Combos - Delphi

Delphi

text := 'Row1, Col1'#9'Row1, Col2|Row2, Col1'#9'Row2, Col2';

map := MultiColumnDictionary.Create(text, 0, True);

_flex.Cols[1].DataMap := map;


Multi-Column Combos - Visual Basic

Visual Basic

' create string-based MultiColumnDictionary and assign it to column

' note: this will automatically generate keys of type int for each item,

' the key values will be stored in the grid.

Dim text As String = "Row1, Col1\tRow1, Col2|Row2, Col1\tRow2, Col2"

Dim map As MultiColumnDictionary = New MultiColumnDictionary(text,0,True)

_flex.Cols(1).DataMap = map


Namespaces - C#

C#

C1.Win.C1FlexGrid.C1FlexGrid flex;


Namespaces - C#2

C#

// Define a new Column object (custom Column class)

Column MyCol;

// Define a new C1FlexGrid.Column object.

C1.Win.C1FlexGrid.Column FlexCol;


Namespaces - C#3

C#

using C1Column = C1.Win.C1FlexGrid.Column;

using MyColumn = MyProject.Column;

C1Column c1;

MyColumn c2;


Namespaces - Delphi

Delphi

uses C1.Win.C1FlexGrid;


Namespaces - Delphi2

Delphi

var

FlexCol: C1.Win.C1FlexGrid.Column;

MyCol: Column;


Namespaces - Delphi3

Delphi

uses C1.Win.C1FlexGrid.Column,

MyProject.Column;

var

c2: MyColumn;

c1: C1Column;


Namespaces - Visual Basic

Visual Basic

Dim flex As C1.Win.C1FlexGrid.C1FlexGrid


Namespaces - Visual Basic2

Visual Basic

' Define a new Column object (custom Column class)

Dim MyCol as Column

' Define a new C1FlexGrid.Column object.

Dim FlexCol as C1.Win.C1FlexGrid.Column


Namespaces - Visual Basic3

Visual Basic

Imports C1Column = C1.Win.C1FlexGrid.Column

Imports MyColumn = MyProject.Column

Dim c1 As C1Column

Dim c2 As MyColumn


NewRow Property - C#

C#

_flex.Styles.NewRow.BackColor = Color.Yellow;


NewRow Property - Delphi

Delphi

_flex.Styles.NewRow.BackColor := Color.Yellow;


NewRow Property - Visual Basic

Visual Basic

_flex.Styles.NewRow.BackColor = Color.Yellow


Normal Property - C#

C#

flex.Styles.Normal.Font = new Font("Arial", 9);

flex.Styles.Fixed.Font = new Font("Arial", 9, FontStyle.Bold);

flex.Styles.Focus.Font = new Font("Arial", 9, FontStyle.Underline);


Normal Property - Delphi

Delphi

flex.Styles.Normal.Font := Font.Create('Arial', 9);

flex.Styles.Fixed.Font := Font.Create('Arial', 9, FontStyle.Bold);

flex.Styles.Focus.Font := Font.Create('Arial', 9, FontStyle.Underline);


Normal Property - Visual Basic

Visual Basic

flex.Styles.Normal.Font = New Font("Arial", 9)

flex.Styles.Fixed.Font = New Font("Arial", 9, FontStyle.Bold)

flex.Styles.Focus.Font = New Font("Arial", 9, FontStyle.Underline)


Outline Tutorial - C#

C#

using C1.Win.C1FlexGrid;


Outline Tutorial - C#2

C#

private void Form1_Load( System.object sender, System.EventArgs e)

{

// initialize grid

fg.Rows.Count = 1;

fg.Cols.Count = 2;

fg.Cols.Fixed = 0;

fg.ExtendLastCol = true;

fg[0, 0] = "Element";

fg[0, 1] = "Text";

// initialize outline tree

fg.Tree.Column = 0;

fg.Tree.Style = TreeStyleFlags.SimpleLeaf;

fg.Cols[0].AllowEditing = false;

// initialize styles

fg.Styles.Normal.Border.Style = BorderStyleEnum.None;

fg.Styles.Normal.TextAlign = TextAlignEnum.LeftCenter;

fg.Styles.Normal.WordWrap = false;

CellStyle cs = fg.Styles.Add("Data");

cs.BackColor = SystemColors.Control;

}


Outline Tutorial - C#3

C#

private void Button1_Click( System.object sender, System.EventArgs e)

{

// get file name

OpenFileDialog fo = new OpenFileDialog();

fo.DefaultExt = "xml";

fo.Filter = "XML Files (*.xml)|*.xml";

if ( fo.ShowDialog() != DialogResult.OK ) return

// load XML file

Xml.XmlDocument xdoc = new Xml.XmlDocument();

xdoc.Load(fo.FileName);

// stop redrawing to improve speed

fg.Redraw = false;

// populate grid

fg.Rows.Count = 1;

GetXMLData(xdoc.ChildNodes[1], 0)

// autosize tree column

fg.AutoSizeCol(0);

// show levels 0,1,2

fg.Tree.Show(2);

// ready to redraw

fg.Redraw = true;

}


Outline Tutorial - C#4

C#

private void GetXMLData( Xml.XmlNode node, int level)

{

// skip comment nodes

if ( node.NodeType == Xml.XmlNodeType.Comment )

return;

}

// add new row for this node

int row = fg.Rows.Count;

fg.Rows.Add();

// add data to new row

fg(row, 0) = node.Name;

if ( node.ChildNodes.Count = 1 ) {

fg(row, 1) = node.InnerText;

fg.SetCellStyle(row, 1, fg.Styles["Data"]);

}

// if the node has a "Name" subnode, save it to use as a tooltip

if (node.ChildNodes.Count > 0) {

Xml.XmlNode ndName = node.SelectSingleNode("Name");

if (ndName != null) {

fg.Rows[row].UserData = ndName.InnerText;

}

}

// if this node has children, get them as well

if ( node.ChildNodes.Count > 1 ) {

// make this row a node

fg.Rows[row].IsNode = true;

fg.Rows[row].Node.Level = level;

// recurse to get children

Xml.XmlNode child;

foreach ( child In node.ChildNodes )

GetXMLData(child, level + 1)

}

}


Outline Tutorial - C#5

C#

private void fg_DoubleClick( object sender, EventArgs e) fg.DoubleClick {

if ( fg.MouseCol == 0 ) {

ToggleNodeState();

}

}

private void fg_KeyPress( object sender, KeyPressEventArgs e) fg.KeyPress {

if ( e.KeyChar == 13 ) {

ToggleNodeState();

}

}

private void ToggleNodeState() {

// if the current row is not a node, no work

Row r = fg.Rows[fg.Row];

if (! r.IsNode ) return;

// toggle collapsed state

r.Node.Collapsed = !r.Node.Collapsed;

}


Outline Tutorial - C#6

C#

private void fg_BeforeEdit( object sender, RowColEventArgs e) fg.BeforeEdit {

// if the current row is a node, don't edit it

Row r = fg.Rows[fg.Row];

if (r.IsNode ) e.Cancel = true;

}


Outline Tutorial - C#7

C#

private void fg_MouseMove( object sender, MouseEventArgs e) fg.MouseMove {

// check tooltip for this cell

string tip;

if ( fg.MouseCol == 0 && fg.MouseRow > 0 ) {

tip = fg.Rows[fg.MouseRow].UserData;

}

// set it if different from current

if ( tip != ToolTip1.GetToolTip(fg) ) {

ToolTip1.SetToolTip(fg, tip);

}

}


Outline Tutorial - Delphi

Delphi

uses C1.Win.C1FlexGrid;


Outline Tutorial - Delphi2

Delphi

procedure Form1_Load(sender: System.Object;

e: System.EventArgs);

var

cs: CellStyle;

begin

// initialize grid

fg.Rows.Count := 1;

fg.Cols.Count := 2;

fg.Cols.Fixed := 0;

fg.ExtendLastCol := True;

fg[0, 0] := 'Element';

fg[0, 1] := 'Text';

// initialize outline tree

fg.Tree.Column := 0;

fg.Tree.Style := TreeStyleFlags.SimpleLeaf;

fg.Cols[0].AllowEditing := False;

// initialize styles

fg.Styles.Normal.Border.Style := BorderStyleEnum.None;

fg.Styles.Normal.TextAlign := TextAlignEnum.LeftCenter;

fg.Styles.Normal.WordWrap := False;

cs := fg.Styles.Add('Data');

cs.BackColor := SystemColors.Control;

end;


Outline Tutorial - Delphi3

Delphi

procedure Button1_Click(sender: System.Object;

e: System.EventArgs);

var

fo: OpenFileDialog;

xdoc: Xml.XmlDocument;

begin

// get file name

fo := OpenFileDialog.Create;

fo.DefaultExt := 'xml';

fo.Filter := 'XML Files (*.xml)|*.xml';

If fo.ShowDialog <> System.Windows.Forms.DialogResult.OK Then

exit;

// load XML file

xdoc := Xml.XmlDocument.Create;

xdoc.Load(fo.FileName);

// stop redrawing to improve speed

fg.Redraw := False;

// populate grid

fg.Rows.Count := 1;

GetXMLData(xdoc.ChildNodes[1], 0);

// autosize tree column

fg.AutoSizeCol(0);

// show levels 0,1,2

fg.Tree.Show(2);

// ready to redraw

fg.Redraw := True;

end;


Outline Tutorial - Delphi4

Delphi

procedure GetXMLData(node: Xml.XmlNode; level: Integer);

var

r: Integer;

ndName: Xml.XmlNode;

child: Xml.XmlNode;

begin

// skip comment nodes

if node.NodeType = Xml.XmlNodeType.Comment then

exit;

// add new row for this node

r := fg.Rows.Count;

fg.Rows.Add;

// add data to new row

fg[row, 0] := node.Name;

if node.ChildNodes.Count = 1 then

begin

fg[row, 1] := node.InnerText;

fg.SetCellStyle(row, 1, fg.Styles['Data']);

end;

if node.ChildNodes.Count > 0 then

begin

ndName := node.SelectSingleNode('Name');

if ndName <> nil then

begin

fg.Rows[row].UserData := ndName.InnerText;

end;

end;

// if this node has children, get them as well

if node.ChildNodes.Count > 1 then

begin

// make this row a node

fg.Rows[row].IsNode := True;

fg.Rows[row].Node.Level := level;

// recurse to get children

for I := 0 to node.ChildNodes.Count – 1 do

GetXMLData(node.ChildNodes[I], level + 1);

end;

end;


Outline Tutorial - Delphi5

Delphi

procedure fg_DoubleClick(sender: System.Object;

e: System.EventArgs);

begin

If fg.MouseCol = 0 Then

ToggleNodeState;

end;

procedure fg_KeyPress(sender: System.Object;

e: KeyPressEventArgs);

begin

If e.KeyChar = #13 Then

ToggleNodeState;

end;

procedure ToggleNodeState;

var

r: Row;

begin

// if the current row is not a node, no work

r := fg.Rows[fg.Row];

If Not r.IsNode Then

exit;

// toggle collapsed state

r.Node.Collapsed := Not r.Node.Collapsed;

end;


Outline Tutorial - Delphi6

Delphi

procedure fg_BeforeEdit(sender: System.Object;

e: RowColEventArgs);

var

r: Row;

begin

// if the current row is a node, don't edit it

r := fg.Rows[fg.Row];

If r.IsNode Then

e.Cancel := True;

end;


Outline Tutorial - Delphi7

Delphi

procedure fg_MouseMove(sender: System.Object;

e: System.MouseEventArgs);

var

tip: string;

begin

// check tooltip for this cell

If (fg.MouseCol = 0) And (fg.MouseRow > 0) Then

tip := fg.Rows[fg.MouseRow].UserData;

// set it if different from current

If tip <> ToolTip1.GetToolTip(fg) Then

ToolTip1.SetToolTip(fg, tip);

end;


Outline Tutorial - Visual Basic

Visual Basic

Imports C1.Win.C1FlexGrid


Outline Tutorial - Visual Basic2

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles MyBase.Load

' initialize grid

fg.Rows.Count = 1

fg.Cols.Count = 2

fg.Cols.Fixed = 0

fg.ExtendLastCol = True

fg(0, 0) = "Element"

fg(0, 1) = "Text"

' initialize outline tree

fg.Tree.Column = 0

fg.Tree.Style = TreeStyleFlags.SimpleLeaf

fg.Cols(0).AllowEditing = False

' initialize styles

fg.Styles.Normal.Border.Style = BorderStyleEnum.None

fg.Styles.Normal.TextAlign = TextAlignEnum.LeftCenter

fg.Styles.Normal.WordWrap = False

Dim cs As CellStyle = fg.Styles.Add("Data")

cs.BackColor = SystemColors.Control

End Sub


Outline Tutorial - Visual Basic3

Visual Basic

Private Sub Button1_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles Button1.Click

' get file name

Dim fo As OpenFileDialog = New OpenFileDialog()

fo.DefaultExt = "xml"

fo.Filter = "XML Files (*.xml)|*.xml"

If fo.ShowDialog() <> DialogResult.OK Then Exit Sub

' load XML file

Dim xdoc As Xml.XmlDocument = New Xml.XmlDocument()

xdoc.Load(fo.FileName)

' stop redrawing to improve speed

fg.Redraw = False

' populate grid

fg.Rows.Count = 1

GetXMLData(xdoc.ChildNodes(1), 0)

' autosize tree column

fg.AutoSizeCol(0)

' show levels 0,1,2

fg.Tree.Show(2)

' ready to redraw

fg.Redraw = True

End Sub


Outline Tutorial - Visual Basic4

Visual Basic

Private Sub GetXMLData(ByVal node As Xml.XmlNode, ByVal level As Integer)

' skip comment nodes

If node.NodeType = Xml.XmlNodeType.Comment Then

Exit Sub

End If

' add new row for this node

Dim row As Integer = fg.Rows.Count

fg.Rows.Add()

' add data to new row

fg(row, 0) = node.Name

If node.ChildNodes.Count = 1 Then

fg(row, 1) = node.InnerText

fg.SetCellStyle(row, 1, fg.Styles("Data"))

End If

' if the node has a "Name" subnode, save it to use as a tooltip

If node.ChildNodes.Count > 0 Then

Dim ndName As Xml.XmlNode = node.SelectSingleNode("Name")

If Not (ndName Is Nothing) Then

fg.Rows(row).UserData = ndName.InnerText

End If

End If

' if this node has children, get them as well

If node.ChildNodes.Count > 1 Then

' make this row a node

fg.Rows(row).IsNode = True

fg.Rows(row).Node.Level = level

' recurse to get children

Dim child As Xml.XmlNode

For Each child In node.ChildNodes

GetXMLData(child, level + 1)

Next

End If

End Sub


Outline Tutorial - Visual Basic5

Visual Basic

Private Sub fg_DoubleClick(ByVal sender As Object, _

ByVal e As EventArgs) Handles fg.DoubleClick

If fg.MouseCol = 0 Then

ToggleNodeState()

End If

End Sub

Private Sub fg_KeyPress(ByVal sender As Object, _

ByVal e As KeyPressEventArgs) Handles fg.KeyPress

If e.KeyChar = vbCr Then

ToggleNodeState()

End If

End Sub

Private Sub ToggleNodeState()

' if the current row is not a node, no work

Dim r As Row = fg.Rows(fg.Row)

If Not r.IsNode Then Exit Sub

' toggle collapsed state

r.Node.Collapsed = Not r.Node.Collapsed

End Sub


Outline Tutorial - Visual Basic6

Visual Basic

Private Sub fg_BeforeEdit(ByVal sender As Object, _

ByVal e As RowColEventArgs) Handles fg.BeforeEdit

' if the current row is a node, don't edit it

Dim r As Row = fg.Rows(fg.Row)

If r.IsNode Then e.Cancel = True

End Sub


Outline Tutorial - Visual Basic7

Visual Basic

Private Sub fg_MouseMove(ByVal sender As Object, _

ByVal e As MouseEventArgs) Handles fg.MouseMove

' check tooltip for this cell

Dim tip As String

If fg.MouseCol = 0 And fg.MouseRow > 0 Then

tip = fg.Rows(fg.MouseRow).UserData

End If

' set it if different from current

If tip <> ToolTip1.GetToolTip(fg) Then

ToolTip1.SetToolTip(fg, tip)

End If

End Sub


OwnerDrawCell Event - C#

C#

// use owner-draw to add gradients

fg.DrawMode = DrawModeEnum.OwnerDraw;

private void fg_OwnerDrawCell( object sender, OwnerDrawCellEventArgs e) fg.OwnerDrawCell {

// draw selected cell background using gradient brush

if ( fg.Selection.Contains(e.Row, e.Col) ) {

e.Graphics.FillRectangle(m_GradientBrush, e.Bounds); // draw background

e.DrawCell(DrawCellFlags.Content); // let the grid draw the content

e.Handled = true; // we're done drawing this cell

}

}


OwnerDrawCell Event - C#2

C#

private void _flex_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)

{

// highlight all but the first two characters

string txt = _flex.GetDataDisplay(e.Row, e.Col);

if (txt.Length < 2) return;

txt = txt.Substring(2);

// measure the width of the highlight

Graphics g = e.Graphics;

int wid = (int)g.MeasureString(txt, e.Style.Font).Width;

wid += e.Style.Margins.Right;

wid += e.Style.Border.Width - 1;

// build the highlight rect

Rectangle rc = e.Bounds;

rc.X = rc.Right - wid;

rc.Width = wid;

// draw background, highlight, draw content

e.DrawCell(DrawCellFlags.Background);

g.FillRectangle(Brushes.LightYellow, rc);

e.DrawCell(DrawCellFlags.Border | DrawCellFlags.Content);

}


OwnerDrawCell Event - Delphi

Delphi

' use owner-draw to add gradients

fg.DrawMode := DrawModeEnum.OwnerDraw;

procedure fg_OwnerDrawCell(sender: System.Object;

e: OwnerDrawCellEventArgs);

begin

// draw selected cell background using gradient brush

If fg.Selection.Contains(e.Row, e.Col) Then

begin

e.Graphics.FillRectangle(m_GradientBrush, e.Bounds); // draw background

e.DrawCell(DrawCellFlags.Content); // let the grid draw the content

e.Handled := True; // we're done drawing this cell

end;

end;


OwnerDrawCell Event - Delphi2

Delphi

procedure_flex_OwnerDrawCell(sender: System.Object; e: OwnerDrawCellEventArgs)

var

txt: string;

g: Graphics;

wid: Integer;

rc: Rectangle;

begin

// highlight all but the first two characters

txt := _flex.GetDataDisplay(e.Row, e.Col);

If txt.Length < 2 Then

exit;

txt := txt.Substring(2);

// measure the width of the highlight

g := e.Graphics;

wid := Round(g.MeasureString(txt, e.Style.Font).Width);

wid := wid + e.Style.Margins.Right;

wid := wid + e.Style.Border.Width – 1;

// build the highlight rect

rc := e.Bounds;

rc.X := rc.Right – wid;

rc.Width := wid;

// draw background, highlight, draw content

e.DrawCell(DrawCellFlags.Background);

g.FillRectangle(Brushes.LightYellow, rc);

e.DrawCell(DrawCellFlags.Border Or DrawCellFlags.Content);

end;


OwnerDrawCell Event - Visual Basic

Visual Basic

' use owner-draw to add gradients

fg.DrawMode = DrawModeEnum.OwnerDraw

Private Sub fg_OwnerDrawCell(ByVal sender As Object, _

ByVal e As OwnerDrawCellEventArgs) Handles fg.OwnerDrawCell

' draw selected cell background using gradient brush

If fg.Selection.Contains(e.Row, e.Col) Then

e.Graphics.FillRectangle(m_GradientBrush, e.Bounds) ' draw background

e.DrawCell(DrawCellFlags.Content) ' let the grid draw the content

e.Handled = True ' we're done drawing this cell

End If

End Sub


OwnerDrawCell Event - Visual Basic2

Visual Basic

Private Sub _flex_OwnerDrawCell(sender As Object, e As OwnerDrawCellEventArgs)

' highlight all but the first two characters

Dim txt As String = _flex.GetDataDisplay(e.Row, e.Col)

If txt.Length < 2 Then

Return

End If

txt = txt.Substring(2)

' measure the width of the highlight

Dim g As Graphics = e.Graphics

Dim wid As Integer = CInt(g.MeasureString(txt, e.Style.Font).Width)

wid += e.Style.Margins.Right

wid += e.Style.Border.Width - 1

' build the highlight rect

Dim rc As Rectangle = e.Bounds

rc.X = rc.Right - wid

rc.Width = wid

' draw background, highlight, draw content

e.DrawCell(DrawCellFlags.Background)

g.FillRectangle(Brushes.LightYellow, rc)

e.DrawCell((DrawCellFlags.Border Or DrawCellFlags.Content))

End Sub


Owner-draw cells - C#

C#

// use owner-draw to add gradients

fg.DrawMode = DrawModeEnum.OwnerDraw;

// brush to use with owner-draw cells

LinearGradientBrush m_GradientBrush;

private void fg_Resize( object sender, System.EventArgs e) fg.Resize {

// update gradient brush when the control is resized

m_GradientBrush = new LinearGradientBrush(ClientRectangle,,

Color.SteelBlue, Color.White, 45);

}


Owner-draw cells - C#2

C#

private void fg_OwnerDrawCell( object sender, OwnerDrawCellEventArgs e) fg.OwnerDrawCell {

// draw selected cell background using gradient brush

if (fg.Selection.Contains(e.Row, e.Col))

{

e.Graphics.FillRectangle(m_GradientBrush, e.Bounds); // draw background

e.DrawCell(DrawCellFlags.Content); // let the grid draw the content

e.Handled = true; // we're done drawing this cell

}

}


Owner-draw cells - Delphi

Delphi

// brush to use with owner-draw cells

m_GradientBrush: LinearGradientBrush;

// use owner-draw to add gradients

fg.DrawMode := DrawModeEnum.OwnerDraw;

procedure fg_Resize(sender: System.Object; e: System.EventArgs);

begin

m_GradientBrush := new LinearGradientBrush(ClientRectangle, Color.SteelBlue, Color.White, 45);

end;


Owner-draw cells - Delphi2

Delphi

procedure fg_OwnerDrawCell(sender: System.Object; _

e: OwnerDrawCellEventArgs);

begin

// draw selected cell background using gradient brush

If fg.Selection.Contains(e.Row, e.Col) Then

begin

e.Graphics.FillRectangle(m_GradientBrush, e.Bounds); // draw background

e.DrawCell(DrawCellFlags.Content); // let the grid draw the content

e.Handled := True // we're done drawing this cell

end;

end;


Owner-draw cells - Visual Basic

Visual Basic

' use owner-draw to add gradients

fg.DrawMode = DrawModeEnum.OwnerDraw

' brush to use with owner-draw cells
Dim m_GradientBrush As LinearGradientBrush

Private Sub fg_Resize(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles fg.Resize

' update gradient brush when the control is resized
m_GradientBrush = New LinearGradientBrush(ClientRectangle, _
Color.SteelBlue, Color.White, 45)
End Sub


Owner-draw cells - Visual Basic2

Visual Basic

Private Sub fg_OwnerDrawCell(ByVal sender As Object, _

ByVal e As OwnerDrawCellEventArgs) Handles fg.OwnerDrawCell

' draw selected cell background using gradient brush

If fg.Selection.Contains(e.Row, e.Col) Then

e.Graphics.FillRectangle(m_GradientBrush, e.Bounds) ' draw background

e.DrawCell(DrawCellFlags.Content) ' let the grid draw the content

e.Handled = True ' we're done drawing this cell

End If

End Sub


PrintDocument Property - C#

C#

GridPrinter gp = flex.PrinterSettings;

gp.DefaultPageSettings.Landscape = true;

flex.PrintGrid("my grid");


PrintDocument Property - Delphi

Delphi

var

gp: GridPrinter;

begin

gp := flex.PrinterSettings;

gp.DefaultPageSettings.Landscape := True;

flex.PrintGrid('my grid');

end;


PrintDocument Property - Visual Basic

Visual Basic

Dim gp As GridPrinter = flex.PrinterSettings

gp.DefaultPageSettings.Landscape = True

flex.PrintGrid("my grid")


PrintGrid Method - C#

C#

flex.PrintGrid("My Grid", PrintGridFlags.FitPageWidth,

"", "\tPage {0} of {1}");


PrintGrid Method - Delphi

Delphi

flex.PrintGrid('My Grid', PrintGridFlags.FitPageWidth, '', #9'Page {0} of {1}');


PrintGrid Method - Visual Basic

Visual Basic

flex.PrintGrid("My Grid", PrintGridFlags.FitPageWidth, _
"", vbTab + "Page {0} of {1}")


Printing Grids - C#

C#

// get grid's PrintDocument object

PrintDocument pd = fg.PrintParameters.PrintDocument();

// set up the page (landscape, 1.5" left margin)

pd.DefaultPageSettings;

.Landscape = true;

.Margins.Left = 150;

} With

// set up header and footer fonts

fg.PrintParameters.HeaderFont = new Font("Arial Black", 14, FontStyle.Bold);

fg.PrintParameters.FooterFont = new Font("Arial Narrow", 8, FontStyle.Italic);

// preview the grid

fg.PrintGrid("VB Tutorial",

PrintGridFlags.FitToPageWidth | PrintGridFlags.ShowPreviewDialog,

"VB Tutorial\t\t" + Format(DateTime.Now, "d"),

"\t\tPage {0} of {1}");


Printing Grids - Delphi

Delphi

var

pd: PrintDocument;

begin

// get grid's PrintDocument object

pd := flex.PrintParameters.PrintDocument;

// set up the page (landscape, 1.5" left margin)

With pd.DefaultPageSettings do

begin

Landscape := True;

Margins.Left := 150;

End;

// set up header and footer fonts

flex.PrintParameters.HeaderFont := System.Drawing.Font.Create('Arial Black', 14, FontStyle.Bold);

flex.PrintParameters.FooterFont := System.Drawing.Font.Create('Arial Narrow', 8, FontStyle.Italic);

// preview the grid

flex.PrintGrid('VB Tutorial',

PrintGridFlags.FitToPageWidth or PrintGridFlags.ShowPreviewDialog,

'VB Tutorial'#9#9 + Format(DateTime.Now, 'd'),

#9#9 + 'Page {0} of {1}');

end;


Printing Grids - Visual Basic

Visual Basic

' get grid's PrintDocument object

Dim pd As PrintDocument

pd = fg.PrintParameters.PrintDocument()

' set up the page (landscape, 1.5" left margin)

With pd.DefaultPageSettings

.Landscape = True

.Margins.Left = 150

End With

' set up header and footer fonts

fg.PrintParameters.HeaderFont = New Font("Arial Black", 14, FontStyle.Bold)

fg.PrintParameters.FooterFont = New Font("Arial Narrow", 8, FontStyle.Italic)

' preview the grid

fg.PrintGrid("VB Tutorial", _

PrintGridFlags.FitToPageWidth + PrintGridFlags.ShowPreviewDialog, _

"VB Tutorial" + Chr(9) + Chr(9) + Format(DateTime.Now, "d"), _

Chr(9) + Chr(9) + "Page {0} of {1}")


PrintPreviewDialog Property - C#

C#

PrintPreviewDialog dlg = _flex.PrintParameters.PrintPreviewDialog;

dlg.Text = "Custom Caption in Preview Dialog";

dlg.ClientSize = new Size(500,500);


PrintPreviewDialog Property - Delphi

Delphi

var

dlg: PrintPreviewDialog;

begin

dlg := _flex.PrintParameters.PrintPreviewDialog;

dlg.Text := 'Custom Caption in Preview Dialog';

dlg.ClientSize := Size.Create(500, 500);

end;


PrintPreviewDialog Property - Visual Basic

Visual Basic

Dim dlg As PrintPreviewDialog = _flex.PrintParameters.PrintPreviewDialog

dlg.Text = "Custom Caption in Preview Dialog"

dlg.ClientSize = New Size(500, 500)


Redraw Property - C#

C#

private function UpdateGrid(c1FlexGrid flex)

{

flex.Redraw = false; // suspend painting to avoid flicker

flex.Rows.Count = 1;

for (int i = 1; i < 10000; i++)

flex.AddItem("Row " + i.ToString());

flex.Redraw = true; // resume painting

}


Redraw Property - Delphi

Delphi

function Class1.UpdateGrid(flex: c1FlexGrid): &function;

var

i: Integer;

begin

flex.Redraw := False;

flex.Rows.Count := 1;

for I := 1 to 9999 do

flex.AddItem('Row ' + System.Object(i).ToString);

flex.Redraw := True;

end;


Redraw Property - Visual Basic

Visual Basic

Private Function UpdateGrid(flex As c1FlexGrid) As function

flex.Redraw = False ' suspend painting to avoid flicker

flex.Rows.Count = 1

Dim i As Integer

For i = 1 To 9999

flex.AddItem(("Row " + i.ToString()))

Next i

flex.Redraw = True ' resume painting

End Function


RowData Property - C#

C#

Collection coll = new Collection;

coll.Add "Hello";

coll.Add "World";

fg.set_RowData(1, 212); // store a number

fg.set_RowData(2, "Hello"); // store a string

fg.set_RowData(3, coll); // store a pointer to an object

fg.set_RowData(4, this); // store a pointer to a form

Console.WriteLine(TypeName(fg.get_RowData(1)), fg.get_RowData(1));

Console.WriteLine(TypeName(fg.get_RowData(2)), fg.get_RowData(2));

 Console.WriteLine(TypeName(fg.get_RowData(3)),
fg.get_RowData(3).Item(2))Console.WriteLine(TypeName(fg.get_RowData(4)),
fg.get_RowData(4).Caption);


RowData Property - Delphi

Delphi

var

coll: Collection;

begin

coll := Collection.Create;

  coll.Add('Hello');
coll.Add('World');

fg.set_RowData(1, 212); // store a number
fg.set_RowData(2,
'Hello'); // store a string
fg.set_RowData(3, coll); // store a pointer to an
object
fg.set_RowData(4, Me); //
store a pointer to a form

Debug.WriteLine(TypeName(fg.get_RowData(1)), fg.get_RowData(1));
Debug.WriteLine(TypeName(fg.get_RowData(2)), fg.get_RowData(2));
Debug.WriteLine(TypeName(fg.get_RowData(3)),
fg.get_RowData(3).Item(2))Debug.WriteLine(TypeName(fg.get_RowData(4)),
fg.get_RowData(4).Caption);


RowData Property - Visual Basic

Visual Basic

Dim coll As New Collection

coll.Add "Hello"
coll.Add "World"

fg.set_RowData(1, 212) ' store a number
fg.set_RowData(2, "Hello") ' store a string
fg.set_RowData(3, coll) ' store a pointer to an object
fg.set_RowData(4, Me) ' store a pointer to a form

Debug.WriteLine(TypeName(fg.get_RowData(1)), fg.get_RowData(1))
Debug.WriteLine(TypeName(fg.get_RowData(2)), fg.get_RowData(2))
Debug.WriteLine(TypeName(fg.get_RowData(3)), fg.get_RowData(3).Item(2))Debug.WriteLine(TypeName(fg.get_RowData(4)), fg.get_RowData(4).Caption)


SaveExcel Method - C#

C#

DataSet ds = GetDataSet();

foreach (DataTable dt in ds.Tables)

{

_flex.DataSource = dt;

_flex.SaveExcel(xlsFileName, dt.TableName);

}


SaveExcel Method - Delphi

Delphi

var ds: DataSet;

dt: DataTable;

i: Integer;

ds := GetDataSet;

for i := 0 to ds.Tables.Count-1 do

begin

dt := ds.Tables[i];

_flex.DataSource := dt;

_flex.SaveExcel(xlsFileName, dt.TableName);

end;


SaveExcel Method - Visual Basic

Visual Basic

Dim ds As DataSet = GetDataSet()

Dim dt As DataTable

For Each dt In ds.Tables

_flex.DataSource = dt

_flex.SaveExcel(xlsFileName, dt.TableName)

Next


Saving and Loading Grids - C#

C#

private void _btnData_Click(object sender, System.EventArgs e)

{

// prepare DataReader

string strConn = "data source=MYMACHINE;initial catalog=Northwind;";

SqlConnection myConn = new SqlConnection(strConn);

SqlCommand myCMD = new SqlCommand("SELECT * FROM Employees", myConn);

myConn.Open();

SqlDataReader myReader = myCMD.ExecuteReader();

// build grid structure from DB schema

DataTable dt = myReader.GetSchemaTable();

_flex.Cols.Count = 1;

foreach (DataRow dr in dt.Rows)

{

Column c = _flex.Cols.Add();

c.Caption = c.Name = (string)dr["ColumnName"];

c.DataType = (Type)dr["DataType"];

}

// populate grid

_flex.Rows.Count = 1;

int row = 1;

int cols = dt.Columns.Count;

object[] v = (object[])Array.CreateInstance(typeof(object), cols);

while (myReader.Read())

{

myReader.GetValues(v);

_flex.AddItem(v, row++, 1);

}

// cleanup

_flex.AutoSizeCols();

myReader.Close();

myConn.Close();

}


Saving and Loading Grids - Delphi

Delphi

var

v: System.Array;

cols: Integer;

row: Integer;

dt: DataTable;

dr: DataRow;

myReader: SqlDataReader;

myCMD: SqlCommand;

myConn: SqlConnection;

strConn: string;

c: Column;

begin

// prepare DataReader

strConn := 'data source=MYMACHINE;initial catalog=Northwind;';

myConn := SqlConnection.Create(strConn);

myCMD := SqlCommand.Create('SELECT * FROM Employees', myConn);

myConn.Open;

myReader := myCMD.ExecuteReader;

// build grid structure from DB schema

dt := myReader.GetSchemaTable;

_flex.Cols.Count = 1

for I := 0 to dt.Rows.Count – 1 do

begin

dr := dt.Rows[I];

c := flex.Cols.Add;

c.Caption := string(dr['ColumnName']);

c.Name := string(dr['ColumnName']);

c.DataType := System.Type(dr['DataType']);

end;

// populate grid

flex.Rows.Count := 1;

row := 1;

cols := dt.Columns.Count;

v := _ System.Array.CreateInstance(typeof(System.Object), cols), cols);

While myReader.Read() do

begin

myReader.GetValues(v);

_flex.AddItem(v, row, 1);

row := row + 1;

end;

// cleanup

_flex.AutoSizeCols;

myReader.Close;

myConn.Close;

end; //_btnData_Click


Saving and Loading Grids - Visual Basic

Visual Basic

Private Sub _btnData_Click(sender As Object, e As System.EventArgs)

' prepare DataReader

Dim strConn As String = "data source=MYMACHINE;initial catalog=Northwind;"

Dim myConn As New SqlConnection(strConn)

Dim myCMD As New SqlCommand("SELECT * FROM Employees", myConn)

myConn.Open()

Dim myReader As SqlDataReader = myCMD.ExecuteReader()

' build grid structure from DB schema

Dim dt As DataTable = myReader.GetSchemaTable()

_flex.Cols.Count = 1

Dim dr As DataRow

For Each dr In dt.Rows

Dim c As Column = _flex.Cols.Add()

c.Caption =(c.Name <<= CStr(dr("ColumnName")))

c.DataType = CType(dr("DataType"), Type)

Next dr

' populate grid

_flex.Rows.Count = 1

Dim row As Integer = 1

Dim cols As Integer = dt.Columns.Count

Dim v As Object() = _

CType(Array.CreateInstance(GetType(Object), cols), Object())

While myReader.Read()

myReader.GetValues(v)

_flex.AddItem(v, row ++, 1)

End While

' cleanup

_flex.AutoSizeCols()

myReader.Close()

myConn.Close()

End Sub '_btnData_Click


Scaling an Image2 - C#

C#

flex.Cols[3].StyleNew.ImageAlign = ImageAlignEnum.Scale;


Scaling an Image2 - Delphi

Delphi

flex.Cols[3].StyleNew.ImageAlign := ImageAlignEnum.Scale;


Scaling an Image2 - Visual Basic

Visual Basic

flex.Cols(3).StyleNew.ImageAlign = ImageAlignEnum.Scale


Scaling an Image3 - C#

C#

flex.Styles.Normal.ImageAlign = ImageAlignEnum.Scale;


Scaling an Image3 - Delphi

Delphi

flex.Styles.Normal.ImageAlign := ImageAlignEnum.Scale;


Scaling an Image3 - Visual Basic

Visual Basic

flex.Styles.Normal.ImageAlign = ImageAlignEnum.Scale


Scaling an Image - C#

C#

flex.Rows[1].Height = 2 * flex.Rows.DefaultSize;

flex.Rows[2].Height = 2 * flex.Rows.DefaultSize;


Scaling an Image - Delphi

Delphi

flex.Rows[1].Height := 2 * flex.Rows.DefaultSize;

flex.Rows[2].Height := 2 * flex.Rows.DefaultSize;


Scaling an Image - Visual Basic

Visual Basic

flex.Rows(1).Height = 2 * flex.Rows.DefaultSize

flex.Rows(2).Height = 2 * flex.Rows.DefaultSize


ScrollBars Property - C#

C#

ScrollBars CheckScrollBars(C1.Win.C1FlexGrid.C1FlexGrid fg)

{

int SBWID = SystemInformation.VerticalScrollBarWidth;

int SBHEI = SystemInformation.HorizontalScrollBarHeight;

Rectangle rcCtl = fg.Bounds;

Rectangle rcClient = fg.ClientRectangle;

bool vbar = (rcCtl.Width - rcClient.Width >=SBWID);

bool hbar = (rcCtl.Height - rcClient.Height >= SBHEI);

if (vbar && hbar) return ScrollBars.Both;

if (vbar) return ScrollBars.Vertical;

if (hbar) return ScrollBars.Horizontal;

return ScrollBars.None;

}


ScrollBars Property - Delphi

Delphi

function CheckScrollBars(fg: C1.Win.C1FlexGrid.C1FlexGrid): ScrollBars;

var

hbar: Boolean;

vbar: Boolean;

rcClient: Rectangle;

rcCtl: Rectangle;

SBHEI: Integer;

SBWID: Integer;

CheckScrollBars: ScrollBars;

begin

SBWID := SystemInformation.VerticalScrollBarWidth;

SBHEI := SystemInformation.HorizontalScrollBarHeight;

rcCtl := fg.Bounds;

rcClient := fg.ClientRectangle;

vbar := rcCtl.Width - rcClient.Width >= SBWID;

hbar := rcCtl.Height - rcClient.Height >= SBHEI;

if vbar And hbar then

begin

Result := ScrollBars.Both;

exit;

end;

if vbar then

begin

Result := ScrollBars.Vertical;

exit;

end;

if hbar then

begin

Result := ScrollBars.Horizontal;

exit;

end;

Result := ScrollBars.None;

end;


ScrollBars Property - Visual Basic

Visual Basic

Function CheckScrollBars(fg As C1.Win.C1FlexGrid.C1FlexGrid) As ScrollBars

Dim SBWID As Integer = SystemInformation.VerticalScrollBarWidth

Dim SBHEI As Integer = SystemInformation.HorizontalScrollBarHeight

Dim rcCtl As Rectangle = fg.Bounds

Dim rcClient As Rectangle = fg.ClientRectangle

Dim vbar As Boolean = rcCtl.Width - rcClient.Width >= SBWID

Dim hbar As Boolean = rcCtl.Height - rcClient.Height >= SBHEI

If vbar And hbar Then

Return ScrollBars.Both

End If

If vbar Then

Return ScrollBars.Vertical

End If

If hbar Then

Return ScrollBars.Horizontal

End If

Return ScrollBars.None

End Function


ScrollPosition Property - C#

C#

// bind grids together

fgRight.DataSource = fgLeft;

fgLeft.ScrollBars = ScrollBars.Horizontal;

// synchronize vertical scrolling

private void flex_AfterScroll(object sender, C1.Win.C1FlexGrid.RangeEventArgs e)

{

// update sender grid (could be fgLeft or fgRight)

C1FlexGrid.C1FlexGrid fg = ((C1FlexGrid)sender);

fg.Update();

// get new vertical position from sender grid

int y = fg.ScrollPosition.Y;

// apply new vertical position to the other grid

if (fg == fgLeft)

fgRight.ScrollPosition = new Point(fgRight.ScrollPosition.X, y);

else

fgLeft.ScrollPosition = new Point(fgLeft.ScrollPosition.X, y);

}


ScrollPosition Property - Delphi

Delphi

// bind grids together

fgRight.DataSource := fgLeft;

fgLeft.ScrollBars := ScrollBars.Horizontal;

// synchronize vertical scrolling

procedure flex_AfterScroll(sender: System.Object;

e: C1.Win.C1FlexGrid.RangeEventArgs);

var

fg: C1FlexGrid;

begin

// update sender grid (could be fgLeft or fgRight)

fg := C1FlexGrid (sender);

fg.Update;

// get new vertical position from sender grid

y := fg.ScrollPosition.Y;

// apply new vertical position to the other grid

if fg = fgLeft then

fgRight.ScrollPosition := Point.Create(fgRight.ScrollPosition.X, y)

else

fgLeft.ScrollPosition := Point.Create(fgLeft.ScrollPosition.X, y);

end;


ScrollPosition Property - Visual Basic

Visual Basic

' bind grids together

fgRight.DataSource = fgLeft

fgLeft.ScrollBars = ScrollBars.Horizontal

' synchronize vertical scrolling

Private Sub flex_AfterScroll(sender As Object, _

e As C1.Win.C1FlexGrid.RangeEventArgs)

' update sender grid (could be fgLeft or fgRight)

Dim fg As C1FlexGrid.C1FlexGrid = CType(sender, C1FlexGrid) '

fg.Update()

' get new vertical position from sender grid

Dim y As Integer = fg.ScrollPosition.Y

' apply new vertical position to the other grid

If fg = fgLeft Then

fgRight.ScrollPosition = New Point(fgRight.ScrollPosition.X, y)

Else

fgLeft.ScrollPosition = New Point(fgLeft.ScrollPosition.X, y)

End If

End Sub


ScrollTips Property - C#

C#

flex.ScrollTips = true;

flex.ScrollTrack = false;

private void flex_BeforeScrollTip(object sender, RowColEventArgs e)

{

string tip = string.Format("Row {0}\n{1}", e.Row, flex[e.Row,1]);

flex.ScrollTipText = tip;

}


ScrollTips Property - C#2

C#

private ToolTip ttip = new ToolTip(this.components);

private void flex_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)

{

string str = string.Format("This is cell {0}, {1}",

flex.MouseRow, flex.MouseCol);

if (str != ttip.GetToolTip(flex))

ttip.SetToolTip(flex, str);

}


ScrollTips Property - Delphi

Delphi

flex.ScrollTips := True;

flex.ScrollTrack := False;

procedure Class1.flex_BeforeScrollTip(sender: System.Object; e: RowColEventArgs);

var

tip: string;

begin

tip := Format('Row {0}'#10'{1}', e.Row, flex[e.Row]);

flex.ScrollTipText := tip;

end;


ScrollTips Property - Delphi2

Delphi

private

ttip: ToolTip;

procedure flex_MouseMove(sender: System.Object; e: System.Windows.Forms.MouseEventArgs);

var

str: string;

begin

str := System.String.Format('This is cell {0}, {1}', _

flex.MouseRow, flex.MouseCol);

if str <> ttip.GetToolTip(flex) then

ttip.SetToolTip(flex, str);

end;


ScrollTips Property - Visual Basic

Visual Basic

flex.ScrollTips = True

flex.ScrollTrack = False

Private Sub flex_BeforeScrollTip(sender As Object, e As RowColEventArgs)

Dim tip As String

tip = String.Format("Row {0}" + ControlChars.Lf + "{1}", _

e.Row, flex(e.Row, 1))

flex.ScrollTipText = tip

End Sub


ScrollTips Property - Visual Basic2

Visual Basic

Private ttip As New ToolTip(Me.components)

Private Sub flex_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs)

Dim str As String

str = String.Format("This is cell {0}, {1}", _

flex.MouseRow, flex.MouseCol)

If str <> ttip.GetToolTip(flex) Then

ttip.SetToolTip(flex, str)

End If

End Sub


Selected Property (RowCollection) - C#

C#

fg.SelectionMode = SelectionModeEnum.ListBox;

foreach (Row row in fg.Rows.Selection)

Console.WriteLine(row.Index);


Selected Property (RowCollection) - Delphi

Delphi

var

r: Row;

i: Integer;

begin

fg.SelectionMode := SelectionModeEnum.ListBox;

for I := 0 to fg.Rows.Count do

begin

r := fg.Rows[i];

Console.WriteLine(r.Index);

end;

end;


Selected Property (RowCollection) - Visual Basic

Visual Basic

fg.SelectionMode = SelectionModeEnum.ListBox

Dim r As Row

For Each r In fg.Rows.Selected

Console.WriteLine(r.Index)

Next


SelectedRow Property - C#

C#

int i;

for ( i = 0 to fg.SelectedRows – 1

Console.WriteLine("Row" + fg.SelectedRow(i) + " is selected");

}


SelectedRow Property - C#2

C#

int i;

for ( i = 0 to fg.Rows

if ( fg.get_IsSelected(i) ) { Console.Writeline ("Row "; i; " is selected")

}


SelectedRow Property - Delphi

Delphi

var

i: Integer;

begin

for I := 0 to fg.Rows.Selected.Count – 1 do

Console.WriteLine('Row' + fg. fg.Rows.Selected[i] + ' is selected');

end;


SelectedRow Property - Delphi2

Delphi

var

I: Integer;

begin

For i = 0 to fg.Rows.Count – 1 do

If fg.Rows[i].Selected Then

Debug.Writeline('Row ' + I + ' is selected');
end;


SelectedRow Property - Visual Basic

Visual Basic

Dim i As Integer

For i = 0 to fg.SelectedRows – 1

Debug.WriteLine("Row" & fg.SelectedRow(i) & " is selected")
Next


SelectedRow Property - Visual Basic2

Visual Basic

Dim i As Integer

For i = 0 to fg.Rows

If fg.get_IsSelected(i) Then Debug.Writeline ("Row "; i; " is selected")
Next


SelectedRows Property - C#

C#

private void Form1_Load( System.object sender, System.EventArgs e)

{

fg.SelectionMode = SelModeSettings.flexSelectionListBox;

}

private void fg_SelChange( object sender, System.EventArgs e)

{

Console.WriteLine (fg.SelectedRows);

}


SelectedRows Property - Delphi

Delphi

procedure Form1_Load(sender: System.Object;
e: System.EventArgs);

begin

fg.SelectionMode := SelModeSettings.flexSelectionListBox;

end;

procedure fg_SelChange(sender: System.Object; e: System.EventArgs);

begin

Debug.WriteLine(fg.SelectedRows);

end;


SelectedRows Property - Visual Basic

Visual Basic

Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs)

fg.SelectionMode = SelModeSettings.flexSelectionListBox

End Sub

Private Sub fg_SelChange(ByVal sender As Object, ByVal e As System.EventArgs)

Debug.WriteLine (fg.SelectedRows)

End Sub


Selection - C#

C#

fg.SelectionMode = SelectionModeEnum.ListBox;

for (int index = fg.Rows.Fixed ; index < fg.Rows.Count; index++)
{

if ( Val(fg(index, "Sales")) > 80000 ) {

fg.Rows(index).Selected = true;

}

}

Console.WriteLine("There are now {0} rows selected", fg.Rows.Selected.Count);


Selection - Delphi

Delphi

var

index: Integer;

begin

fg.SelectionMode := SelectionModeEnum.ListBox;

while (index <= fg.Rows.Count) do

begin

if (Val(fg(index, 'Sales')) > 80000) then

fg.Rows(index).Selected := True;

Inc(index);

end;

Console.WriteLine('There are now {0} rows selected', fg.Rows.Selected.Count);

end;


Selection Property - C#

C#

// select a range, show it

flex.Select(1, 1, 5, 5);

Console.WriteLine("Cursor {0}, Selection {1}", flex.CursorCell, flex.Selection);

// select another range, show it

flex.Select(5, 5, 1, 1);

Console.WriteLine("Cursor {0}, Selection {1}", flex.CursorCell, flex.Selection);


Selection Property - Delphi

Delphi

// select a range, show it

flex.Select(1, 1, 5, 5)

Console.WriteLine('Cursor {0}, Selection {1}', flex.CursorCell, flex.Selection);

// select another range, show it

flex.Select(5, 5, 1, 1);

Console.WriteLine('Cursor {0}, Selection {1}', flex.CursorCell, flex.Selection);


Selection Property - Visual Basic

Visual Basic

' select a range, show it

flex.Select(1, 1, 5, 5)

Console.WriteLine("Cursor {0}, Selection {1}", flex.CursorCell, flex.Selection)

' select another range, show it

flex.Select(5, 5, 1, 1)

Console.WriteLine("Cursor {0}, Selection {1}", flex.CursorCell, flex.Selection)


Selection - Visual Basic

Visual Basic

fg.SelectionMode = SelectionModeEnum.ListBox

Dim index As Integer

For index = fg.Rows.Fixed To fg.Rows.Count – 1
If Val(fg(index, "Sales")) > 80000 Then
fg.Rows(index).Selected = True
End If
Next

Console.WriteLine("There are now {0} rows selected", _
fg.Rows.Selected.Count)


SetCellCheck Method - C#

C#

fg.Cols["bools"].Format = "Yes;No";


SetCellCheck Method - C#2

C#

fg.SetCellCheck(3, 3, CheckEnum.Unchecked); // boolean

fg.SetCellCheck(4, 3, CheckEnum.TSUnchecked); // tri-state


SetCellCheck Method - Delphi

Delphi

fg.Cols['bools'].Format := 'Yes;No';


SetCellCheck Method - Delphi2

Delphi

fg.SetCellCheck(3, 3, CheckEnum.Unchecked); // boolean

fg.SetCellCheck(4, 3, CheckEnum.TSUnchecked); // tri-state


SetCellCheck Method - Visual Basic

Visual Basic

fg.Cols("bools").Format = "Yes;No"


SetCellCheck Method - Visual Basic2

Visual Basic

fg.SetCellCheck(3, 3, CheckEnum.Unchecked) ' boolean

fg.SetCellCheck(4, 3, CheckEnum.TSUnchecked) ' tri-state


SetCellStyle Method - C#

C#

CellRange rg = fg.GetCellRange(3, 3, 10, 10);

rg.Data = null;

rg.Style = fg.Styles["MyRangeStyle"];


SetCellStyle Method - Delphi

Delphi

var

rg: CellRange;

begin

rg := fg.GetCellRange(3, 3, 10, 10);

rg.Data := nil;

rg.Style := fg.Styles['MyRangeStyle'];

end;


SetCellStyle Method - Visual Basic

Visual Basic

Dim rg As CellRange = fg.GetCellRange(3, 3, 10, 10)

rg.Data = Nothing

rg.Style = fg.Styles("MyRangeStyle")


SetData Method - C#

C#

fg.SetData(row, col, 12); // is equivalent to

fg[row, col] = 12;


SetData Method - Delphi

Delphi

fg.SetData(row, col, 12);

fg[row, col] := 12;


SetData Method - Visual Basic

Visual Basic

fg.SetData(row, col, 12) ' is equivalent to

fg(row, col) = 12


SetupEditor Event - C#

C#

private void flex_SetupEditor(object sender, RowColEventArgs e)

{

Control ctl = flex.Editor;

ctl.Font = new Font(ctl.Font, FontStyle.Bold);

ctl.BackColor = Color.Yellow;

if (ctl is TextBox) ((TextBox)ctl).MaxLength = 4;

}


SetupEditor Event - C#2

C#

// ** initialize and hook up event handlers for the grid editors

private void flex_SetupEditor(object sender, RowColEventArgs e)

{

// set up the grid's combo box

ComboBox cb = flex.Editor as ComboBox;

if (cb != null)

{

// make this a real combo, even if we're using a DataMap

cb.DropDownStyle = ComboBoxStyle.DropDown;

// hook up combo event

cb.SelectedIndexChanged -= new System.EventHandler(fe_SelectedValueChanged);

cb.SelectedIndexChanged += new System.EventHandler(fe_SelectedValueChanged);

// hook up textbox event

cb.TextChanged -= new System.EventHandler(fe_SelectedValueChanged);

cb.TextChanged += new System.EventHandler(fe_SelectedValueChanged);

}

// set up the grid's text box

TextBox tb = flex.Editor as TextBox;

if (tb != null)

{

tb.TextChanged -= new System.EventHandler(fe_SelectedValueChanged);

tb.TextChanged += new System.EventHandler(fe_SelectedValueChanged);

}

}

// ** event handlers for the grid editors

private void fe_SelectedValueChanged(object sender, System.EventArgs e)

{

Console.WriteLine("editor value changed to " + _flex.Editor.Text);

}


SetupEditor Event - Delphi

Delphi

procedure Class1.flex_SetupEditor(sender: System.Object; e: RowColEventArgs);

var

ctl: Control;

begin

ctl := flex.Editor;

ctl.Font := Font.Create(ctl.Font, FontStyle.Bold);

ctl.BackColor := Color.Yellow;

if (ctl is TextBox) then TextBox(tl).MaxLength := 4;

end;


SetupEditor Event - Delphi2

Delphi

// ** initialize and hook up event handlers for the grid editors

procedure flex_SetupEditor(sender: System.Object; e: RowColEventArgs);

var

cb: ComboBox;

tb: TextBox;

begin

// set up the grid's combo box

If cb Is ComboBox Then

begin

cb := ComboBox(flex.Editor);

// make this a real combo, even if we're using a DataMap

cb.DropDownStyle := ComboBoxStyle.DropDown;

// hook up combo event

Exclude(cb.SelectedIndexChanged, fe_SelectedValueChanged);

Include(cb.SelectedIndexChanged, fe_SelectedValueChanged);

// hook up textbox event

Exclude(cb.TextChanged, fe_SelectedValueChanged);

Include(cb.TextChanged, fe_SelectedValueChanged);

End;

// set up the grid's text box

If tb Is TextBox Then

begin

tb := TextBox(flex.Editor);

Exclude(tb.TextChanged, fe_SelectedValueChanged);

Include(tb.TextChanged, fe_SelectedValueChanged);

end;

end;

// ** event handlers for the grid editors

procedure fe_SelectedValueChanged(sender: System.Object; e: System.EventArgs);

Console.WriteLine('editor value changed to ' + _flex.Editor.Text);

end;


SetupEditor Event - Visual Basic

Visual Basic

Private Sub flex_SetupEditor(sender As Object, e As RowColEventArgs)

Dim ctl As Control = flex.Editor

ctl.Font = New Font(ctl.Font, FontStyle.Bold)

ctl.BackColor = Color.Yellow

If TypeOf ctl Is TextBox Then

CType(ctl, TextBox).MaxLength = 4

End If

End Sub


SetupEditor Event - Visual Basic2

Visual Basic

' ** initialize and hook up event handlers for the grid editors

Private Sub flex_SetupEditor(sender As Object, e As RowColEventArgs)

' set up the grid's combo box

Dim cb As ComboBox = flex.Editor '

If Not (cb Is Nothing) Then

' make this a real combo, even if we're using a DataMap

cb.DropDownStyle = ComboBoxStyle.DropDown

' hook up combo event

cb.SelectedIndexChanged -= New System.EventHandler(fe_SelectedValueChanged)

AddHandler cb.SelectedIndexChanged, AddressOf fe_SelectedValueChanged

' hook up textbox event

cb.TextChanged -= New System.EventHandler(fe_SelectedValueChanged)

AddHandler cb.TextChanged, AddressOf fe_SelectedValueChanged

End If

' set up the grid's text box

Dim tb As TextBox = flex.Editor '

If Not (tb Is Nothing) Then

tb.TextChanged -= New System.EventHandler(fe_SelectedValueChanged)

AddHandler tb.TextChanged, AddressOf fe_SelectedValueChanged

End If

End Sub

' ** event handlers for the grid editors

Private Sub fe_SelectedValueChanged(sender As Object, e As System.EventArgs)

Console.WriteLine(("editor value changed to " + _flex.Editor.Text))

End Sub


ShowErrors Property - C#

C#

this._flex.ShowErrors = true;

dt.Rows[3].SetColumnError(_dt.Columns[0], "row 3, col 0 is bad");

dt.Rows[4].SetColumnError(_dt.Columns[1], "this cell is bad too");

dt.Rows[5].RowError = "This whole row is bad";


ShowErrors Property - Delphi

Delphi

Self._flex.ShowErrors := True;

dt.Rows[3].SetColumnError(_dt.Columns[0], 'row 3, col 0 is bad');

dt.Rows[4].SetColumnError(_dt.Columns[1], 'this cell is bad too');

dt.Rows[5].RowError := 'This whole row is bad';


ShowErrors Property - Visual Basic

Visual Basic

Me._flex.ShowErrors = True

dt.Rows(3).SetColumnError(_dt.Columns(0), "row 3, col 0 is bad") '

dt.Rows(4).SetColumnError(_dt.Columns(1), "this cell is bad too") '

dt.Rows(5).RowError = "This whole row is bad" '


Sort Method (GridTree) - C#

C#

private void SortTree(SortFlags sf)

{

int col = flex.Cols["Sales"].SafeIndex;

flex.Tree.Sort(0, sf, col, col); // << sort level 0 nodes

flex.Tree.Sort(1, sf, col, col); // << sort level 1 nodes

flex.Tree.Show(0); // << show levels 0 and 1

}


Sort Method (GridTree) - Delphi

Delphi

procedure Class1.SortTree(sf: SortFlags);

var

col: Integer;

begin

col := flex.Cols['Sales'].SafeIndex;

flex.Tree.Sort(0, sf, col, col);

flex.Tree.Sort(1, sf, col, col);

flex.Tree.Show(0);

end;


Sort Method (GridTree) - Visual Basic

Visual Basic

Private Sub SortTree(sf As SortFlags)

Dim col As Integer = flex.Cols("Sales").SafeIndex

flex.Tree.Sort(0, sf, col, col) ' << sort level 0 nodes

flex.Tree.Sort(1, sf, col, col) ' << sort level 1 nodes

flex.Tree.Show(0) ' << show levels 0 and 1

End Sub 'SortTree


StartEditing Method - C#

C#

private void _flex_KeyDown(object sender, KeyEventArgs e)

{

if (e.KeyCode == Keys.Return)

{

e.Handled = true; // ignore the event, we'll handle it ourselves

_flex.StartEditing(); // put the grid in edit mode

TextBox tb = _flex.Editor as TextBox; // if we got a textbox, then

if (tb != null) tb.Select(tb.Text.Length, 0); // move cursor to end

}

}

private void _flex_KeyPress(object sender, KeyPressEventArgs e)

{

if (e.KeyChar == (char)13) // ignore enter key

e.Handled = true; // (don't move the cursor)

}


StartEditing Method - Delphi

Delphi

procedure Class1._flex_KeyDown(sender: System.Object; e: KeyEventArgs);

var

tb: TextBox;

begin

if (e.KeyCode = Keys.Return) then

begin

e.Handled := True;

_flex.StartEditing;

if (flex.Editor is TextBox) then

TextBox(tb).Select(tb.Text.Length, 0);

end;

end;

procedure Class1._flex_KeyPress(sender: System.Object; e: KeyPressEventArgs);

begin

if (e.KeyChar = (WideChar(13))) then

e.Handled := True;

end;


StartEditing Method - Visual Basic

Visual Basic

Private Sub _flex_KeyDown(sender As Object, e As KeyEventArgs)

If e.KeyCode = Keys.Return Then

e.Handled = True ' ignore the event, we'll handle it ourselves

_flex.StartEditing() ' put the grid in edit mode

Dim tb As TextBox = _flex.Editor

' if we got a textbox, then

If Not (tb Is Nothing) Then

tb.Select(tb.Text.Length, 0) ' move cursor to end

End If

End If

End Sub

Private Sub _flex_KeyPress(sender As Object, e As KeyPressEventArgs)

If e.KeyChar = CChar(13) Then ' ignore enter key

e.Handled = True ' (don't move the cursor)

End If

End Sub


Storing and Retrieving Data - C#

C#

Row[2].Selected = true;


Storing and Retrieving Data - C#2

C#

int r;

for ( r = fg.Rows.Fixed ; r <= fg.Rows.Count – 1) {

fg[r, 0] = r;

}


Storing and Retrieving Data - Delphi

Delphi

Row[2].Selected := true;


Storing and Retrieving Data - Delphi2

Delphi

var

r: Integer;

begin

r := fg.Rows.Fixed;

while (r < fg.Rows.Count) do

begin

fg[r, 0] := r;

r := r + 1;

end;

end;


Storing and Retrieving Data - Visual Basic

Visual Basic

Row(2).Selected = True


Storing and Retrieving Data - Visual Basic2

Visual Basic

Dim r As Integer

For r = fg.Rows.Fixed To fg.Rows.Count – 1

fg(r, 0) = r

Next


Subtotal Method - C#

C#

private void flex_AfterDragColumn(object sender, DragRowColEventArgs e)

{

updateTreeReport(true);

}

void updateTreeReport(bool setCaption)

{

// avoid flicker

flex.Redraw = false;

// clear old totals

flex.Subtotal(AggregateEnum.Clear);

// sort grid to organize into groups

flex.Sort(SortFlags.Ascending, flex.Cols.Fixed, flex.Cols.Count-1);

// update subtotals

flex.Tree.Column = 1;

string caption = (setCaption)? "Total {0}": "";

// total on Sales, group on first three columns

int totalOn = flex.Cols["Sales"].SafeIndex;

flex.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption);

flex.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption);

flex.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption);

// total on Credits, group on first three columns

totalOn = flex.Cols["Credits"].SafeIndex;

flex.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption);

flex.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption);

flex.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption);

// ready to show the grid again

flex.Redraw = true;

}


Subtotal Method - C#2

C#

flex.Subtotal(AggregateEnum.Clear);

flex.Subtotal(AggregateEnum.Count, 0, 1, 1, 1, "Count is {0}");

for (int c = 2; c < flex.Cols.Count; c++)

flex.Subtotal(AggregateEnum.Sum, 0, 1, 1, c, "Sum is {0}");


Subtotal Method - Delphi

Delphi

procedure flex_AfterDragColumn(sender: System.Object; e: DragRowColEventArgs);

updateTreeReport(True);

end;

procedure updateTreeReport(setCaption: Boolean);

var

caption: string;

totalOn: Integer;

begin

// avoid flicker

flex.Redraw := False;

// clear old totals

flex.Subtotal(AggregateEnum.Clear);

// sort grid to organize into groups

flex.Sort(SortFlags.Ascending, flex.Cols.Fixed, flex.Cols.Count - 1);

// update subtotals

flex.Tree.Column := 1;

If setCaption Then

caption := 'Total {0}';

// total on Sales, group on first three columns

totalOn := flex.Cols['Sales'].SafeIndex;

flex.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption);

flex.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption);

flex.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption);

// total on Credits, group on first three columns

totalOn := flex.Cols['Credits'].SafeIndex;

flex.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption);

flex.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption);

flex.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption);

// ready to show the grid again

flex.Redraw := True;

end;


Subtotal Method - Delphi2

Delphi

var

c: Integer;

begin

flex.Subtotal(AggregateEnum.Clear);

flex.Subtotal(AggregateEnum.Count, 0, 1, 1, 1, 'Count is {0}');

c := 2;

while (c < flex.Cols.Count) do

begin

flex.Subtotal(AggregateEnum.Sum, 0, 1, 1, c, 'Sum is {0}');

c := c + 1;

end;

end;


Subtotal Method - Visual Basic

Visual Basic

Private Sub flex_AfterDragColumn(sender As Object, e As DragRowColEventArgs)

updateTreeReport(True)

End Sub

Sub updateTreeReport(setCaption As Boolean)

' avoid flicker

flex.Redraw = False

' clear old totals

flex.Subtotal(AggregateEnum.Clear)

' sort grid to organize into groups

flex.Sort(SortFlags.Ascending, flex.Cols.Fixed, flex.Cols.Count - 1)

' update subtotals

flex.Tree.Column = 1

Dim caption As String

If setCaption Then caption = "Total {0}"

' total on Sales, group on first three columns

Dim totalOn As Integer = flex.Cols("Sales").SafeIndex

flex.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption)

flex.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption)

flex.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption)

' total on Credits, group on first three columns

totalOn = flex.Cols("Credits").SafeIndex

flex.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption)

flex.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption)

flex.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption)

' ready to show the grid again

flex.Redraw = True

End Sub


Subtotal Method - Visual Basic2

Visual Basic

flex.Subtotal(AggregateEnum.Clear)

flex.Subtotal(AggregateEnum.Count, 0, 1, 1, 1, "Count is {0}")

Dim c As Integer

For c = 2 To flex.Cols.Count - 1

flex.Subtotal(AggregateEnum.Sum, 0, 1, 1, c, "Sum is {0}")

Next c


TabBehavior Property - C#

C#

private void fg_Focus( object sender, System.event e Args)

{

fg.Select (fg.FixedRows, fg.FixedCols);

}

private void fg_EnterCell( object sender, System.EventArgs e)

{

if ( fg.Col = fg.Cols - 1 && fg.Row = fg.Rows - 1 )

{

fg.TabBehavior = TabBehaviorSettings.flexTabControls;

} else {

fg.TabBehavior = TabBehaviorSettings.flexTabCells;

}

}


TabBehavior Property - Delphi

Delphi

procedure fg_Focus(sender: System.Object; e: System.Event Args);

begin

fg.Select(fg.FixedRows, fg.FixedCols);
end;

procedure fg_EnterCell(sender: System.Object; e: System.EventArgs);
begin

If (fg.Col = fg.Cols.Count – 1) And (fg.Row = fg.Rows.Count – 1) Then
fg.TabBehavior := TabBehaviorSettings.flexTabControls
Else
fg.TabBehavior := TabBehaviorSettings.flexTabCells;
end;


TabBehavior Property - Visual Basic

Visual Basic

Private Sub fg_Focus(ByVal sender As Object, ByVal e As System.Event Args)

fg.Select (fg.FixedRows, fg.FixedCols)
End Sub

Private Sub fg_EnterCell(ByVal sender As Object, ByVal e As System.EventArgs)
If fg.Col = fg.Cols - 1 And fg.Row = fg.Rows - 1 Then
fg.TabBehavior = TabBehaviorSettings.flexTabControls
Else
fg.TabBehavior = TabBehaviorSettings.flexTabCells
End If
End Sub


TextAlignFixed Property - C#

C#

flex.Cols[1].TextAlign = TextAlignEnum.RightTop;

Console.WriteLine(flex.Cols[1].StyleFixed.TextAlign);

TextAlignEnum.RightTop


TextAlignFixed Property - Delphi

Delphi

flex.Cols[1].TextAlign := TextAlignEnum.RightTop;

Console.WriteLine(flex.Cols[1].StyleFixed.TextAlign);

TextAlignEnum.RightTop;


TextAlignFixed Property - Visual Basic

Visual Basic

flex.Cols(1).TextAlign = TextAlignEnum.RightTop

Console.WriteLine(flex.Cols(1).StyleFixed.TextAlign)


TextAlign Property (Column) - C#

C#

flex.Cols[1].TextAlign = TextAlignEnum.RightTop;

Console.WriteLine(flex.Cols[1].Style.TextAlign);

TextAlignEnum.RightTop


TextAlign Property (Column) - Delphi

Delphi

flex.Cols[1].TextAlign := TextAlignEnum.RightTop;

Console.WriteLine(flex.Cols[1].Style.TextAlign);

TextAlignEnum.RightTop;


TextAlign Property (Column) - Visual Basic

Visual Basic

flex.Cols(1).TextAlign = TextAlignEnum.RightTop

Console.WriteLine(flex.Cols(1).Style.TextAlign)


TextMatrix Property - C#

C#

fg.set_TextMatrix(1, 1, "Apple");


TextMatrix Property - Delphi

Delphi

fg.set_TextMatrix(1, 1, 'Apple');


TextMatrix Property - Visual Basic

Visual Basic

fg.set_TextMatrix(1, 1, "Apple")


Text Property - C#

C#

fg.Select 3, 3;

fg.Text = "Apple";


Text Property - Delphi

Delphi

fg.Select(3, 3);

fg.Text := 'Apple';


Text Property - Visual Basic

Visual Basic

fg.Select 3, 3

fg.Text = "Apple"


TextStyleFixed Property - C#

C#

fg.TextStyleFixed = TextStyleSettings.flexTextRaised;


TextStyleFixed Property - Delphi

Delphi

fg.TextStyleFixed := TextStyleSettings.flexTextRaised;


TextStyleFixed Property - Visual Basic

Visual Basic

fg.TextStyleFixed = TextStyleSettings.flexTextRaised


TextStyle Property - C#

C#

fg.TextStyle = TextStyleSettings.flexTextInset;


TextStyle Property - Delphi

Delphi

fg.TextStyle := TextStyleSettings.flexTextInset;


TextStyle Property - Visual Basic

Visual Basic

fg.TextStyle = TextStyleSettings.flexTextInset


Undoing a Sort2 - C#

C#

private void Button1_Click(object sender, System.EventArgs e)

{

CustTable.DefaultView.Sort = "";

}


Undoing a Sort2 - Delphi

Delphi

procedure Button1_Click(sender: System.Object; e: System.EventArgs)

begin

CustTable.DefaultView.Sort := ‘’;

end;


Undoing a Sort2 - Visual Basic

Visual Basic

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

CustTable.DefaultView.Sort = ""

End Sub


Undoing a Sort - C#

C#

// create a DataTable

DataTable CustTable = new DataTable("Customers");

// add columns to the DataTable

DataColumn CustCol = CustTable.Columns.Add("Customer ID", Type.GetType("System.Int32"));

CustTable.Columns.Add("Last Name", Type.GetType("System.String"));

CustTable.Columns.Add("First Name", Type.GetType("System.String"));

CustTable.Columns.Add("Orders", Type.GetType("System.Double"));

// add rows to the DataTable

DataRow CustRow;

int I;

for (int I = 1; I <= 9; I++) {

CustRow = CustTable.NewRow();

CustRow(0) = I;

CustRow(1) = "Last Name" + I.ToString();

CustTable.Rows.Add(CustRow);

}

// bind C1FlexGrid to the DataTable

flex.DataSource = CustTable;


Undoing a Sort - Delphi

Delphi

var

CustTable: DataTable;

CustCol: DataColumn;

CustRow: DataRow;

I: Integer;

begin

CustTable := DataTable.Create(‘Customers’);

// add columns to the DataTable

CustCol := CustTable.Columns.Add(‘Customer ID’, typeof(Integer));

CustTable.Columns.Add(‘Last Name’, typeof(string));

CustTable.Columns.Add(‘First Name’, typeof(string));

CustTable.Columns.Add(‘Orders’, typeof(string));

for I := 1to 9 do

begin

CustRow := CustTable.NewRow;

CustRow(0) := I;

CustRow(1) := ‘Last Name’ + I.ToString();

CustTable.Rows.Add(CustRow);

end;

// bind C1FlexGrid to the DataTable

flex.DataSource := CustTable;

end;


Undoing a Sort - Visual Basic

Visual Basic

' create a DataTable

Dim CustTable As DataTable = New DataTable("Customers")

' add columns to the DataTable

Dim CustCol As DataColumn = CustTable.Columns.Add("Customer ID", Type.GetType("System.Int32"))

CustTable.Columns.Add("Last Name", Type.GetType("System.String"))

CustTable.Columns.Add("First Name", Type.GetType("System.String"))

CustTable.Columns.Add("Orders", Type.GetType("System.Double"))

' add rows to the DataTable

Dim CustRow As DataRow

Dim I As Integer

For I = 1 To 9

CustRow = CustTable.NewRow()

CustRow(0) = I

CustRow(1) = "Last Name" & I.ToString()

CustTable.Rows.Add(CustRow)

Next

' bind C1FlexGrid to the DataTable

flex.DataSource = CustTable


UserData Property (Row) - C#

C#

private int FindRow(C1FlexGrid fg, object data)

{

// look for data in Row.UserData

foreach (Row row in fg.Rows)

if (data.Equals(row.UserData))

return row.Index;

// not found

return -1;

}


UserData Property (Row) - Delphi

Delphi

function Class1.FindRow(fg: C1FlexGrid; data: System.Object): Integer;

var

I: Integer;

r: Row;

begin

// look for data in Row.UserData

for I := 0 to fg.Rows.Count – 1 do

if (data.Equals(fg.Rows[I].UserData))

begin

Result := fg.Rows[I].Index;

exit;

end;

// not found

Result := -1;

end;


UserData Property (Row) - Visual Basic

Visual Basic

Private Function FindRow(fg As C1FlexGrid, data As Object) As Integer

' look for data in Row.UserData

Dim row As Row

For Each row In fg.Rows

If data.Equals(row.UserData) Then

Return row.Index

End If

Next row ' not found

Return - 1

End Function


Using Custom Editors - C#

C#

private void Form_Load(EventArgs e)
{

// create custom editor

NumericUpDown editor = new NumericUpDown();

editor.BorderStyle = BorderStyle.None;

// assign custom editor to the grid

fg.Cols[1].Editor = editor;

}


Using Custom Editors - Delphi

Delphi

procedure TWinForm.Form_Load(object sender; e: System.EventArgs);

var editor: NumericUpDown;

begin

// create custom editor

editor := NumericUpDown.Create;

editor.BorderStyle := BorderStyle.None;

// assign custom editor to the grid

fg.Cols[1].Editor := editor;

end;


Using Custom Editors - Visual Basic

Visual Basic

Private Sub Form_Load(EventArgs e)

' create custom editor

Dim editor as New NuumericUpDown()

editor.BorderStyle = BorderStyle.None

' assign custom editor to the grid

fg.Cols(1).Editor = editor

End Sub


Using Password Entries in C1FlexGrid2 - C#

C#

private void flex_SetupEditor(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)

{

TextBox tb = _flex.Editor as TextBox;

if (tb != null)

{

if (_flex.Cols[e.Col].Name == "Password")

tb.PasswordChar = '*';

else

tb.PasswordChar = (char)0;

}

}


Using Password Entries in C1FlexGrid2 - Delphi

Delphi

procedure flex_SetupEditor(sender: System.Object; e: C1.Win.C1FlexGrid.RowColEventArgs);

var

tb: TextBox;

begin

tb := _flex.Editor as TextBox;

if (tb <> nil)

begin

If (_flex.Cols[e.Col].Name = ‘Password’)

tb.PasswordChar := ‘*’

else

tb.PasswordChar := #0;

end;

end;


Using Password Entries in C1FlexGrid2 - Visual Basic

Visual Basic

Private Sub flex_SetupEditor(sender As Object, e As C1.Win.C1FlexGrid.RowColEventArgs)

Dim tb As TextBox = _flex.Editor

If Not (tb Is Nothing) Then

If _flex.Cols(e.Col).Name = "Password" Then

tb.PasswordChar = "*"c

Else

tb.PasswordChar = CChar(0)

End If

End If

End Sub


Using Password Entries in C1FlexGrid3 - C#

C#

private void flex_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)

{

if (e.Row >= flex.Rows.Fixed && flex.Cols[e.Col].Name == "Password")

{

e.Text = new string('*', e.Text.Length);

}

}


Using Password Entries in C1FlexGrid3 - Delphi

Delphi

procedure flex_OwnerDrawCell(sender: System.Object; e: C1.Win.C1FlexGrid.OwnerDrawCellEventArgs)

begin

if (e.Row >= flex.Rows.Fixed) and (flex.Cols[e.Col].Name = ‘Password’) then

begin

e.Text := string.Create('*', e.Text.Length);

end;

end;


Using Password Entries in C1FlexGrid3 - Visual Basic

Visual Basic

Private Sub flex_OwnerDrawCell(sender As Object, e As C1.Win.C1FlexGrid.OwnerDrawCellEventArgs)

If e.Row >= flex.Rows.Fixed And flex.Cols(e.Col).Name = "Password" Then

e.Text = New String("*"c, e.Text.Length)

End If

End Sub


Using Password Entries in C1FlexGrid4 - C#

C#

flex[1,1] = "123456";


Using Password Entries in C1FlexGrid4 - Delphi

Delphi

flex[1,1] := "123456";


Using Password Entries in C1FlexGrid4 - Visual Basic

Visual Basic

flex(1, 1) = "123456"


Using Password Entries in C1FlexGrid - C#

C#

private void Form1_Load(object sender, System.EventArgs e)

{

flex.Cols[0].Width = flex.Rows[0].HeightDisplay;

flex.ShowCursor = true;

flex.Cols[1].Caption = flex.Cols[1].Name = "Password";

flex.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw;

}


Using Password Entries in C1FlexGrid - Delphi

Delphi

procedure Form1_Load(sender: System.Object; e: System.EventArgs);

begin

flex.Cols[0].Width := flex.Rows[0].HeightDisplay;

flex.ShowCursor := true;

flex.Cols[1].Caption := 'Password';

flex.Cols[1].Name = 'Password';

flex.DrawMode := C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw;

end;


Using Password Entries in C1FlexGrid - Visual Basic

Visual Basic

Private Sub Form1_Load(sender As Object, e As System.EventArgs)

flex.Cols(0).Width = flex.Rows(0).HeightDisplay

flex.ShowCursor = True

flex.Cols(1).Caption =((flex.Cols(1).Name) = "Password")

flex.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw

End Sub


ValidateEdit Event - C#

C#

private void fg_ValidateEdit( object sender, ValidateEditEventArgs e)

{

// validate amounts

if ( fg.Cols[e.Col].DataType == typeof(Decimal) ) {

try {

Decimal dec = Decimal.Parse(fg.Editor.Text());

if ( dec < 1000 || dec > 10000 ) {

MessageBox.Show("value must be between 1,000 and 10,000");

e.Cancel = true;

}

} catch {

MessageBox.Show("value not recognized as a Currency");

e.Cancel = true;

}

}

}


ValidateEdit Event - Delphi

Delphi

procedure fg_ValidateEdit(sender: System.Object;

e: ValidateEditEventArgs);

var

dec: Decimal;

begin

// validate amounts

If fg.Cols(e.Col).DataType Is Decimal Then

Try

dec := System.Decimal.Parse(fg.Editor.Text());

If (dec < 1000) Or (dec > 10000) Then

begin

MessageBox.Show('Value must be between 1,000 and 10,000');

e.Cancel := True;

end;

except

MessageBox.Show('Value not recognized as a Currency');

e.Cancel = True;

end;

end;


ValidateEdit Event - Visual Basic

Visual Basic

Private Sub fg_ValidateEdit(ByVal sender As Object, _

ByVal e As ValidateEditEventArgs) Handles fg.ValidateEdit

' validate amounts

If fg.Cols(e.Col).DataType Is GetType(Decimal) Then

Try

Dim dec As Decimal = Decimal.Parse(fg.Editor.Text())

If dec < 1000 Or dec > 10000 Then

MessageBox.Show("Value must be between 1,000 and 10,000")

e.Cancel = True

End If

Catch

MessageBox.Show("Value not recognized as a Currency")

e.Cancel = True

End Try

End If

End Sub


Validation - C#

C#

private void fg_ValidateEdit( object sender, ValidateEditEventArgs e)

{

// validate amounts

if (fg.Cols[e.Col].DataType is (Decimal))

{

try {

Decimal dec = Decimal.Parse(fg.Editor.Text);

if ( dec < 1000 || dec > 10000 ) {

MessageBox.Show("value must be between 1,000 and 10,000");

e.Cancel = true;

}

} catch{

MessageBox.Show("value not recognized as a Currency");

e.Cancel = true;

}

}

}


Validation - Delphi

Delphi

Private Sub fg_ValidateEdit(sender: System.Object; _

e: ValidateEditEventArgs);

var

dec: Decimal;

begin

// validate amounts

If fg.Cols(e.Col).DataType Is Decimal Then

Try

dec := Decimal.Parse(fg.Editor.Text())

If (dec < 1000) Or (dec > 10000) Then

begin

MessageBox.Show('Value must be between 1,000 and 10,000');

e.Cancel := True;

end;

except

MessageBox.Show('Value not recognized as a Currency');

e.Cancel := True

end;

end;


Validation - Visual Basic

Visual Basic

Private Sub fg_ValidateEdit(ByVal sender As Object, _

ByVal e As ValidateEditEventArgs) Handles fg.ValidateEdit

' validate amounts

If fg.Cols(e.Col).DataType Is GetType(Decimal) Then

Try

Dim dec As Decimal = Decimal.Parse(fg.Editor.Text())

If dec < 1000 Or dec > 10000 Then

MessageBox.Show("Value must be between 1,000 and 10,000")

e.Cancel = True

End If

Catch

MessageBox.Show("Value not recognized as a Currency")

e.Cancel = True

End Try

End If

End Sub


Value-Mapped Lists - C#

C#

Hashtable Hashtable dtMap = new Hashtable();

dtMap.Add(Color.Red, "Apple");

dtMap.Add(Color.Green, "Forest");

dtMap.Add(Color.Blue, "Sky");

dtMap.Add(Color.Black, "Coal");

dtMap.Add(Color.White, "Snow");

fg.Cols[1].DataType = typeof(Color);

fg.Cols[1].DataMap = dtMap;


Value-Mapped Lists - C#2

C#

private void Form1_Load(object sender, System.EventArgs e);

{;

SortedList sl = new SortedList(); // << sorts by key

sl.Add("0", "Zero");

sl.Add("1", "One");

sl.Add("2", "Two");

sl.Add("3", "Three");

ListDictionary ld = new ListDictionary(); // << keeps Add order

ld.Add(0, "Zero");

ld.Add(1, "One");

ld.Add(2, "Two");

ld.Add(3, "Three");

Hashtable ht = new Hashtable(); // << arbitrary order

ht.Add(0, "Zero");

ht.Add(1, "One");

ht.Add(2, "Two");

ht.Add(3, "Three");

flex.Cols[1].DataMap = sl; flex.Cols[1].Caption = "SortedList";

flex.Cols[2].DataMap = ld; flex.Cols[2].Caption = "ListDictionary";

flex.Cols[3].DataMap = ht; flex.Cols[3].Caption = "HashTable";

}


Value-Mapped Lists - C#3

C#

private enum Countries

{

NewYork;

Chicago;

NewOrleans;

London;

Paris;

};

fg.Cols(1).DataType = typeof(Countries);


Value-Mapped Lists - Delphi

Delphi

var

Hashtable: Hashtable;

begin

dtMap := Hashtable.Create;

dtMap.Add(Color.Red, 'Apple');

dtMap.Add(Color.Green, 'Forest');

dtMap.Add(Color.Blue, 'Sky');

dtMap.Add(Color.Black, 'Coal');

dtMap.Add(Color.White, 'Snow');

fg.Cols[1].DataType := TypeOf(Color);

fg.Cols[1].DataMap := dtMap;

end;


Value-Mapped Lists - Delphi2

Delphi

procedure Form1_Load(sender: System.Object; e: System.EventArgs);

var

sl: SortedList;

ld: ListDictionary;

ht: Hashtable;

begin

sl := SortedList.Create; // << sorts by key

sl.Add('0', 'Zero');

sl.Add('1', 'One');

sl.Add('2', 'Two');

sl.Add('3', 'Three');

ld := ListDictionary.Create; // << keeps Add order

ld.Add(System.Object(0), 'Zero');

ld.Add(System.Object(1), 'One');

ld.Add(System.Object(2), 'Two');

ld.Add(System.Object(3), 'Three');

ht := Hashtable.Create; // << arbitrary order

ht.Add(System.Object(0), 'Zero');

ht.Add(System.Object(1), 'One');

ht.Add(System.Object(2), 'Two');

ht.Add(System.Object(3), 'Three');

flex.Cols[1].DataMap := sl;

flex.Cols[1].Caption := 'SortedList';

flex.Cols[2].DataMap := ld;

flex.Cols[2].Caption := 'ListDictionary';

flex.Cols[3].DataMap := ht;

flex.Cols[3].Caption := 'HashTable';

end;


Value-Mapped Lists - Delphi3

Delphi

type

Countries = (NewYork, Chicago, NewOrleans, London, Paris);

fg.Cols[1].DataType := TypeOf(Countries);


Value-Mapped Lists - Visual Basic

Visual Basic

Dim dtMap As Hashtable = New Hashtable()

dtMap.Add(Color.Red, "Apple")

dtMap.Add(Color.Green, "Forest")

dtMap.Add(Color.Blue, "Sky")

dtMap.Add(Color.Black, "Coal")

dtMap.Add(Color.White, "Snow")

fg.Cols(1).DataType = GetType(Color)

fg.Cols(1).DataMap = dtMap


Value-Mapped Lists - Visual Basic2

Visual Basic

Private Sub Form1_Load(sender As Object, e As System.EventArgs)

Dim sl As New SortedList() ' << sorts by key

sl.Add("0", "Zero")

sl.Add("1", "One")

sl.Add("2", "Two")

sl.Add("3", "Three")

Dim ld As New ListDictionary() ' << keeps Add order

ld.Add(0, "Zero")

ld.Add(1, "One")

ld.Add(2, "Two")

ld.Add(3, "Three")

Dim ht As New Hashtable() ' << arbitrary order

ht.Add(0, "Zero")

ht.Add(1, "One")

ht.Add(2, "Two")

ht.Add(3, "Three")

flex.Cols(1).DataMap = sl

flex.Cols(1).Caption = "SortedList"

flex.Cols(2).DataMap = ld

flex.Cols(2).Caption = "ListDictionary"

flex.Cols(3).DataMap = ht

flex.Cols(3).Caption = "HashTable"

End Sub


Value-Mapped Lists - Visual Basic3

Visual Basic

Private Enum Countries

NewYork

Chicago

NewOrleans

London

Paris

End Enum

fg.Cols(1).DataType = GetType(Countries)


Value Property - C#

C#

private void Button1_Click( System.object sender, System.EventArgs e) Button1.Click

{

Debug. WriteLine (fg.value);

}


Value Property - Delphi

Delphi

procedure Button1_Click(sender: System.Object;

e: System.EventArgs);

begin
Debug. WriteLine(fg.Value);
end;


Value Property - Visual Basic

Visual Basic

Private Sub Button1_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles Button1.Click
Debug. WriteLine (fg.Value)
End Sub


Word Wrapping in a Header or Fixed Row2 - C#

C#

flex.Rows[0].Height = 2 * flex.Rows.DefaultSize;


Word Wrapping in a Header or Fixed Row2 - Delphi

Delphi

flex.Rows[0].Height := 2 * flex.Rows.DefaultSize;


Word Wrapping in a Header or Fixed Row2 - Visual Basic

Visual Basic

flex.Rows(0).Height = 2 * flex.Rows.DefaultSize


Word Wrapping in a Header or Fixed Row3 - C#

C#

flex.Styles.Fixed.WordWrap = true;


Word Wrapping in a Header or Fixed Row3 - Delphi

Delphi

flex.Styles.Fixed.WordWrap := true;


Word Wrapping in a Header or Fixed Row3 - Visual Basic

Visual Basic

flex.Styles.Fixed.WordWrap = True


Word Wrapping in a Header or Fixed Row - C#

C#

flex.Cols[1].Caption = "Word Wrapping In Header";


Word Wrapping in a Header or Fixed Row -Delphi

Delphi

flex.Cols[1].Caption := ‘Word Wrapping In Header’;


Word Wrapping in a Header or Fixed Row - Visual Basic

Visual Basic

flex.Cols(1).Caption = "Word Wrapping In Header"


Untitled Document


Untitled Document

 ComponentOne TrueDBGrid for .NET


Untitled Document

 E-mail sent to documentation@componentone.com is for documentation feedback only. We welcome any suggestions to help improve our documentation.