Sunteți pe pagina 1din 1264

ComponentOne

FlexGrid for WinForms

Copyright 1987-2013 GrapeCity, Inc. All rights reserved.


ComponentOne, a division of GrapeCity
201 South Highland Avenue, Third Floor
Pittsburgh, PA 15206 USA

Internet:

info@ComponentOne.com

Web site:

http://www.componentone.com

Sales
E-mail: sales@componentone.com
Telephone: 1.800.858.2739 or 1.412.681.4343 (Pittsburgh, PA USA Office)

Trademarks
The ComponentOne product name is a trademark and ComponentOne is a registered trademark of GrapeCity, Inc. All other
trademarks used herein are the properties of their respective owners.
Warranty
ComponentOne warrants that the original CD (or diskettes) are free from defects in material and workmanship, assuming
normal use, for a period of 90 days from the date of purchase. If a defect occurs during this time, you may return the defective
CD (or disk) to ComponentOne, along with a dated proof of purchase, and ComponentOne will replace it at no charge. After
90 days, you can obtain a replacement for a defective CD (or disk) by sending it and a check for $25 (to cover postage and
handling) to ComponentOne.
Except for the express warranty of the original CD (or disks) set forth here, ComponentOne makes no other warranties, express
or implied. Every attempt has been made to ensure that the information contained in this manual is correct as of the time it was
written. We are not responsible for any errors or omissions. ComponentOnes liability is limited to the amount you paid for the
product. ComponentOne is not liable for any special, consequential, or other damages for any reason.
Copying and Distribution
While you are welcome to make backup copies of the software for your own use and protection, you are not permitted to make
copies for the use of anyone else. We put a lot of time and effort into creating this product, and we appreciate your support in
seeing that it is used by licensed users only.

This manual was produced using ComponentOne Doc-To-Help.

Table of Contents
ComponentOne FlexGrid for WinForms Overview.......................................................................... 7
Help with ComponentOne Studio for WinForms ........................................................................ 8
Differences Between the .NET and ActiveX Versions of C1FlexGrid ............................................ 8
Differences Between the .NET and Mobile Versions of ComponentOne FlexGrid for WinForms 12
Differences Between ComponentOne FlexGrid for WinForms and ComponentOne True DBGrid
for WinForms........................................................................................................................... 16
Migrating a C1FlexGrid Project to Visual Studio 2005 ............................................................... 16
Key Features ................................................................................................................................ 17
FlexGrid for WinForms Quick Start ............................................................................................... 19
Step 1 of 3: Creating the FlexGrid for WinForms Application .................................................... 19
Step 2 of 3: Binding C1FlexGrid to a Data Source ...................................................................... 20
Step 3 of 3: Customizing C1FlexGrid Settings............................................................................ 21
Design-Time Support ................................................................................................................... 23
C1FlexGrid Editors ................................................................................................................... 24
C1FlexGrid Column Editor .................................................................................................... 24
C1FlexGrid Style Editor......................................................................................................... 28
Caption Style and Column Style............................................................................................ 30
C1FlexGrid Smart Tag ............................................................................................................... 35
C1FlexGrid Tasks Menu ........................................................................................................ 35
Column Tasks Menu ............................................................................................................. 39
Using the C1FlexGrid Control ....................................................................................................... 41
Rows and Columns................................................................................................................... 44
Column Sizing ...................................................................................................................... 46
Cell Selection ........................................................................................................................... 47
Cell Ranges .............................................................................................................................. 50
Cell Images .............................................................................................................................. 51
Formatting Cells....................................................................................................................... 51
Cell Content ......................................................................................................................... 51
Cell Appearance ................................................................................................................... 53

Conditional Formatting ........................................................................................................ 56


Owner-Drawn Cells .............................................................................................................. 58
Editing Cells ............................................................................................................................. 61
Lists and Combos ................................................................................................................. 62
Checkboxes.......................................................................................................................... 64
Value-Mapped Lists ............................................................................................................. 65
Cell Buttons ......................................................................................................................... 69
Masks .................................................................................................................................. 71
Validation ............................................................................................................................ 73
Custom Editors .................................................................................................................... 75
Creating Custom Editors ................................................................................................... 77
Edit Mode ............................................................................................................................ 78
Merging Cells ........................................................................................................................... 79
Merged Table Headers ......................................................................................................... 80
Merged Data Views.............................................................................................................. 82
Spilling Text ......................................................................................................................... 84
Custom Merging .................................................................................................................. 85
Outlining and Summarizing Data .............................................................................................. 86
Creating Subtotals................................................................................................................ 86
Creating Custom Trees ......................................................................................................... 90
Creating Outlines and Trees with the C1FlexGrid Control ..................................................... 95
Loading the Data .............................................................................................................. 97
Outline Tree ....................................................................................................................... 102
Adding Subtotals ................................................................................................................ 104
Using the Subtotal Method ................................................................................................ 109
Outline Maintenance ......................................................................................................... 111
Using the Node class .......................................................................................................... 111
Saving, Loading, and Printing ................................................................................................. 112
Saving and Loading Grids to Text Files ................................................................................ 113
Saving and Loading Microsoft Excel Files ............................................................................ 113
Loading Grids from Databases ............................................................................................ 113
Printing Grids ..................................................................................................................... 116
2

C1FlexGrid Filtering................................................................................................................ 117


AllowFiltering property ...................................................................................................... 118
Managing filters programmatically..................................................................................... 121
Applying filters programmatically....................................................................................... 122
Customizing filter behavior ................................................................................................ 124
Customizing the Filtering UI ............................................................................................... 126
C1FlexGrid Property Groups................................................................................................... 128
Data Binding .............................................................................................................................. 129
Binding to a Data Source ........................................................................................................ 130
Storing and Retrieving Data ................................................................................................... 133
FlexGrid for WinForms Samples ................................................................................................. 135
FlexGrid for WinForms Tutorials ................................................................................................ 150
Edit Tutorial ........................................................................................................................... 151
Step 1 of 6: Create the C1FlexGrid Control for the Edit Tutorial .......................................... 152
Step 2 of 6: Set Column Types and Formats ........................................................................ 156
Step 3 of 6: Incorporate Drop-Down Lists ........................................................................... 158
Step 4 of 6: Add Data Validation......................................................................................... 162
Step 5 of 6: Add Clipboard Support .................................................................................... 164
Step 6 of 6: Include Custom Editors .................................................................................... 165
Outline Tutorial ..................................................................................................................... 169
Step 1 of 5: Create the Controls ......................................................................................... 170
Step 2 of 5: Read the Data and Build the Outline ................................................................ 175
Step 3 of 5: Add Custom Mouse and Keyboard Handling .................................................... 181
Step 4 of 5: Allow/Prevent Editing ...................................................................................... 183
Step 5 of 5: Implement ToolTips ......................................................................................... 184
Data Analysis Tutorial ............................................................................................................ 186
Step 1 of 4: Create the C1FlexGrid Control for the Data Analysis Tutorial ........................... 187
Step 2 of 4: Initialize and Populate the Grid ........................................................................ 187
Step 3 of 4: Allow Automatic Sorting .................................................................................. 196
Step 4 of 4: Include Subtotals and Outline Tree .................................................................. 198
FlexGrid for WinForms Task-Based Help .................................................................................... 201
Accessing the C1FlexGrid Editors ........................................................................................... 202
3

Accessing the C1FlexGrid Column Editor ............................................................................ 203


Accessing the C1FlexGrid Style Editor ................................................................................. 203
Adding Pictures and Text to a Cell .......................................................................................... 203
Adding Row Numbers in a Fixed Column ................................................................................ 206
Adding Three-Dimensional Text to a Header Row .................................................................. 208
Adding Three-Dimensional Text to a Header Row Using Built-In Styles ............................... 210
Adding ToolTips That Display UserData .................................................................................. 212
UserData ToolTips for a Column ......................................................................................... 212
UserData ToolTips for a Cell Range..................................................................................... 214
UserData ToolTips for a Cell Style ....................................................................................... 216
UserData ToolTips for a Row .............................................................................................. 219
UserData ToolTips for a Single Cell ..................................................................................... 221
Applying a Gradient Background to a CellRange ..................................................................... 223
Changing the Column Order in the Grid ................................................................................. 227
Filtering by Value ................................................................................................................... 229
Filtering by Condition............................................................................................................. 230
Changing the Filter Language ................................................................................................. 231
Clearing a Tree View .............................................................................................................. 233
Clearing C1FlexGrid................................................................................................................ 234
Clearing Content ................................................................................................................ 235
Clearing Styles ................................................................................................................... 236
Clearing UserData .............................................................................................................. 237
Clearing Content, Styles, and UserData .............................................................................. 238
Converting Column Letters to Uppercase ............................................................................... 239
Customizing Appearance Using Visual Styles .......................................................................... 239
Entering Only Numbers in a Cell ............................................................................................. 243
Formatting Cells..................................................................................................................... 245
Formatting a Cell as Read-Only .......................................................................................... 245
Formatting a Cell with Decimal Content ............................................................................. 247
Formatting Cells Based on the Contents ............................................................................. 249
Formatting the Border Style ................................................................................................... 251
Formatting the Border Style of the Control ........................................................................ 252
4

Formatting the Border Style of the Grid ............................................................................. 255


Freezing Rows and Columns................................................................................................... 261
Getting the Width of a Partially Visible Column ...................................................................... 263
Loading and Saving Open XML Files ....................................................................................... 264
Populating an Unbound Grid with Data .................................................................................. 267
Populating a Column with Data .......................................................................................... 268
Populating a Range of Cells with Data ................................................................................ 268
Populating a Row with Data ............................................................................................... 269
Populating a Single Cell with Data ...................................................................................... 270
Restricting Grid Editing .......................................................................................................... 270
Disable Editing for the Entire Grid ...................................................................................... 271
Disable Editing for a Specific Column.................................................................................. 271
Disable Editing for a Specific Row ....................................................................................... 272
Restricting Sorting for a Specific Column ................................................................................ 273
Scaling an Image .................................................................................................................... 274
Scaling Images in the Entire Grid ........................................................................................ 275
Searching for Entries in a Column .......................................................................................... 276
Setting a Cell's Value to Zero When Users Press the Delete Key ............................................. 277
Setting Rows As Headers........................................................................................................ 278
Setting the Background Color of Columns and Rows .............................................................. 282
Setting the Background Color of Rows and Columns in a Single Statement ......................... 286
Setting the Font of a Single Cell.............................................................................................. 287
Setting the Text Delimiting Character in C1FlexGrid ............................................................... 290
Sorting Multiple Columns....................................................................................................... 291
Undoing a Sort ....................................................................................................................... 293
Using Password Entries in C1FlexGrid..................................................................................... 294
Hiding Characters Already Entered ..................................................................................... 297
Word Wrapping in a Header or Fixed Row ............................................................................. 298
FlexGrid for WinForms Top Tips ................................................................................................. 300
C1FlexGridClassic Control .......................................................................................................... 313
C1.Win.C1FlexGrid.4 Assembly .................................................................................................. 313
Overview ............................................................................................................................... 313
5

Namespaces .......................................................................................................................... 314


C1.Win.C1FlexGrid Namespace .......................................................................................... 314
Overview ....................................................................................................................... 314
Classes ........................................................................................................................... 325
Enumerations................................................................................................................. 927
Structures ...................................................................................................................... 995
Interfaces ..................................................................................................................... 1028
Delegates ..................................................................................................................... 1053
C1.Win.C1FlexGrid.Util.BaseControls Namespace ............................................................ 1069
Overview ..................................................................................................................... 1069
Enumerations............................................................................................................... 1069
C1.Win.C1FlexGrid.Classic.4 Assembly ..................................................................................... 1070
Overview ............................................................................................................................. 1070
Namespaces ........................................................................................................................ 1071
C1.Win.C1FlexGrid.Classic Namespace ............................................................................. 1071
Overview ..................................................................................................................... 1071
Classes ......................................................................................................................... 1072
Enumerations............................................................................................................... 1238

ComponentOne FlexGrid for WinForms Overview


ComponentOne FlexGrid for WinForms incorporates the latest in databinding technology and integrates seamlessly with the Microsoft.NET

Getting Started

Framework. As a result, you get an easy-to-use, flexible grid control for


creating user-friendly interfaces that display, edit, format, organize,

To get started,

summarize, and print tabular data.

review the following

The ComponentOne FlexGrid for WinForms package consists of two


controls:

topics:

Key
Features

C1FlexGrid Control

WinForms

The C1FlexGrid control is a powerful, full-featured grid. It will read and

Quick Start

write grids from and to compressed binary files or text files (compatible
with Microsoft Access and Excel). C1FlexGrid provides all the basics

FlexGrid for
WinForms

plus advanced features such as outline trees, sorting, cell merging, masked

Samples

editing, translated combo and image lists, and automatic data

aggregation.

FlexGrid for

FlexGrid for
WinForms

C1FlexGrid can be used in bound mode, where it displays data from any

Top Tips

.NET data source, including ADO.NET and ComponentOne DataObjects


for WinForms, or in unbound mode, where the grid itself manages the
data.

C1FlexGridClassic Control

The C1FlexGridClassic control 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.

See Also

Help with ComponentOne Studio for WinForms


Differences Between the .NET and ActiveX Versions of C1FlexGrid
Differences Between the .NET and Mobile Versions of ComponentOne FlexGrid for WinForms
Differences Between ComponentOne FlexGrid for WinForms and ComponentOne True DBGrid for
WinForms
Migrating a C1FlexGrid Project to Visual Studio 2005

Help with ComponentOne Studio for WinForms

Getting Started
For information on installing ComponentOne Studio for WinForms, licensing, technical support,
namespaces and creating a project with the control, please visit Getting Started with Studio for
WinForms.

What's New
For a list of the latest features added to ComponentOne Studio for WinForms, visit What's New in
Studio for WinForms.

Differences Between the .NET and ActiveX Versions of C1FlexGrid


In the ActiveX product, we supplied several versions of the FlexGrid control (ADO, DAO, unbound,
Unicode, and so on). 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 control and want to change as little code as
possible, then use the C1FlexGridClassic control.

The following table lists the differences between the .NET and ActiveX versions of C1FlexGrid:
VSFlexGrid (ActiveX)

C1FlexGrid (.NET)

Rows, Cols

The ActiveX control has Rows and

Using the C1FlexGrid control, this becomes:

Collections

Cols properties that are used to get


or set the number of rows and

Dim r%, c%

columns on the grid. In the

c = 1

C1FlexGrid control, these properties

For r = _flex.Rows.Fixed To

return row and column collections.

_flex.Rows.Count - 1
Debug.Print _flex(r,c)

The collections have read/write


properties that return the number of

Next

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 = _flex.FixedRows To
_flex.Rows - 1
Debug.Print
_flex.TextMatrix(r,c)
Next

Styles

Uses the TextMatrix property.

Uses indexers.

In the ActiveX control, you can

The C1FlexGrid control uses a CellStyle object

customize the appearance of

to customize cell appearance. To make the

individual cells or cell ranges using

second row red, you would write:

the Cell property. For example, to


give the second row a red

Dim redStyle As CellStyle =

background, you would write:

_flex.Styles.Add("Red")
redStyle.BackColor = Color.Red

VSFlexGrid (ActiveX)

C1FlexGrid (.NET)
_flex.Rows(2).Style = redStyle

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

But this requires three lines of code instead

vbRed

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:

_flex.Styles("Red").ForeColor =
Color.White
_flex.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 The C1FlexGrid replaces the Cell property
powerful elements of the

with a CellRange object that exposes type-

VSFlexGrid object model. It allows

safe properties and methods used to access

you to get or set any property of

the properties of a cell range. For example,

any cell or cell range with a single

instead of writing:

command. However, handling

10

VSFlexGrid (ActiveX)

C1FlexGrid (.NET)

colors, text, values, and so on. Using _flex.Cell(flexcpPicture, 5, 5,


10, 10) = theImage
a single property means using
You would write:

Variants, and this prevents the


compiler from catching many subtle
problems in case you make

Dim rg As CellRange

mistakes.

rg =
_flex.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

In the ActiveX version, the

The .NET version has a Cols[i].DataType

columns

ColDataType allowed you to set the property that determines the type of data the
type of data that each column

column holds. By default, the DataType for all

contained. This information was

columns is "object", which means you can

used mainly for sorting columns that store anything in any column. You can set the
contained dates or numbers.

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:

_flex.Cols[2].DataType =
typeof(int);
// Value will be set to 12.
_flex[1, 2] = "12";

11

VSFlexGrid (ActiveX)

C1FlexGrid (.NET)
// Bad value. Fire the GridError
event and ignore.
_flex[2, 2] = "hello";
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.

Set 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.

Differences Between the .NET and Mobile Versions of ComponentOne


FlexGrid for WinForms
The mobile version of ComponentOne FlexGrid for WinForms allows you to quickly develop
Microsoft.NET Compact Framework-based applications for your mobile devices, such as personal
digital assistants (PDAs), mobile phones and more. It provides the C1FlexGrid control, a fullfeatured grid to display, edit, format, organize, summarize, and print tabular data, but with a
compacted version of the FlexGrid for WinForms object model and feature set.
The following table lists the differences between the .NET and .NET Compact Framework versions of
C1FlexGrid:

C1Flex

C1FlexGrid (.NET)

C1FlexGrid (Mobile)

C1FlexGrid Column Editor

N/A

C1FlexGrid Style Editor

N/A

Grid

12

Editors

C1Flex

C1FlexGrid (.NET)

C1FlexGrid (Mobile)

Caption Style

N/A

Column Style

N/A

C1FlexGrid Tasks Menu

About C1FlexGrid is the

Grid

only option available on

Smart

this menu.

Tag
Column Tasks Menu

N/A

Column At design time, columns can be resized using the Width


Sizing

Data

At design time, columns

property which can be set directly in the grid by clicking and can be resized using the
dragging the horizontal double arrow that appears at the

Width property in the

right edge of a column's header, through the C1FlexGrid

Properties window or

Column Editor, or programmatically.

programmatically.

You can access the Data Source Configuration Wizard to

You can access the Data

Binding bind to a data source either through the Properties window


or the C1FlexGrid Tasks menu.

Source Configuration
Wizard to bind to a data
source through the
Properties window.

You can bind to a data source using any data provider

When binding to a data

supported by the .NET Framework.

source, you must use a


data provider that is
supported by the .NET
Compact Framework. For
example, you can use the
.NET Framework Data
Provider for SQL Server
Mobile Edition. See Binding
to a Data Source for more

13

C1FlexGrid (.NET)

C1FlexGrid (Mobile)
information.

Image

The DataSource property can be set at design time or run

The DataSource property

time.

can be set at run time only.

Use the SetCellImage method to add an image to a cell. For

Use the SetCellImage

Suppor example:

method to add an image

to a cell Image.FromFile is
To write code in Visual Basic
Visual Basic

not supported by the .NET


Copy Code

Compact Framework, but


you can load and set the
image as in the following

C1FlexGrid1.SetCellImage(1,1,Image.FromFile(c:\
myimage.bmp"))

To write code in Visual


Basic

To write code in C#
C#

example: Visual Basic

Visual Basic

Copy Code

Copy Code

c1FlexGrid1.SetCellImage(1,1,Image.FromFile(@"c

Dim myimage As New

:\myimage.bmp"));

Bitmap("c:\myimage.b
mp")
C1FlexGrid1.SetCellI
mage(1, 1, myimage)
To write code in C#
C#

Copy Code

{ Bitmap myimage =
new
Bitmap("c:\\myimage.
bmp");

14

C1FlexGrid (.NET)

C1FlexGrid (Mobile)
c1FlexGrid1.SetCellI
mage(1, 1, myimage);
}
Note:The Image
class is unrelated to
C1FlexGrid. Please
see Microsoft's
documentation for
more information.

Custom You can use the Custom option in the AllowMerging

The Custom option is not

Mergin property. More information is available on custom merging

available in the

AllowMerging property,

in the Custom Merging topic.

but custom merging can


still be performed in the
mobile version of
C1FlexGrid. You can create
a new class that derives
from the C1FlexGrid and
override the
GetMergedRange virtual
method, providing your
own custom merging logic.
See the CustomMerge
samples provided with
C1FlexGrid and on
ComponentOne
HelpCentral.

15

Differences Between ComponentOne FlexGrid for WinForms and


ComponentOne True DBGrid for WinForms
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 WinForms 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, True DBGrid for WinForms 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 WinForms and
ComponentOne True DBGrid for WinForms, please visit our Web site at
http://www.componentone.com.

Migrating a C1FlexGrid Project to Visual Studio 2005


To migrate a project using ComponentOne components to Visual Studio 2005, there are two main
steps that must be performed. First, you must convert your project to Visual Studio 2005, which
includes removing any references to a previous assembly and adding a reference to the new
assembly. Secondly, the .licx file, or licensing file, must be updated in order for the project to run
correctly.

To convert the project:


1.
2.
3.
4.
5.
6.
7.
8.

Open Visual Studio 2005 and select File, Open Project.


Locate the .sln file for the project that you wish to convert to Visual Studio 2005. Select it
and click Open. The Visual Studio Conversion Wizard appears.
Click Next.
Select Yes, create a backup before converting to create a backup of your current project
and click Next.
Click Finish to convert your project to Visual Studio 2005. The Conversion Complete
window appears.
Click Show the conversion log when the wizard is closed if you want to view the
conversion log.
Click Close. The project opens. Now you must remove references to any of the previous
ComponentOne .dlls and add references to the new ones.
Go to the Solution Explorer (View | Solution Explorer) and click the Show All Files button.

16

Note: The Show All Files button does not appear in the Solution Explorer toolbar if the
Solution project node is selected.

9.

Expand the References node, right-click C1.Common and select Remove. Also remove
C1.Win.C1FlexGrid the same way.
10. Right-click the References node and select Add Reference.
11. Locate and select C1.Win.C1FlexGrid.2.dll. Click OK to add it to the project.

To update the .licx file:


1.
2.
3.
4.

In the Solution Explorer, right-click the licenses.licx file and select Delete.
Click OK to permanently delete licenses.licx. The project must be rebuilt to create a new,
updated version of the .licx file.
Click the Start Debugging button to compile and run the project. The new .licx file may not
be visible in the Solution Explorer.
Select File, Close to close the form and then double-click the Form.vb or Form.cs file in
the Solution Explorer to reopen it. The new licenses.licx file appears in the list of files. The
migration process is complete.

Key Features
Some of the key features of ComponentOne FlexGrid for WinForms that you may find useful
include:

Code-free Development
Set up columns and styles at design time with easy-to-use editors accessible from the
SmartTag. The column editor allows you to insert and remove columns, reorder columns,
adjust column widths, and more. Modify existing styles and add custom styles with the style
editor. Completely manage your grid without writing any code!

Enhanced Cell Editing


Use simple text editing, drop-down lists and combo lists, cell buttons, masks, and advanced
data validation to control the editing process. For example, you can use an input mask to
provide a template that automatically validates data as your users type, or choose to
prevent users from editing specific columns altogether.

Integrated Printing
Print your grid with a single statement! You have control over paper orientation, margins,
and footer text, or you can show a dialog box to let your users select and set up the printer.

17

Printing events allow you to control page breaks, add repeating header rows, or add
custom elements to each page.

Hierarchical Styles
View data the way that's best for you and your users with powerful properties and
methods. For example, you can summarize data and add aggregate values with the
C1FlexGrid.Subtotal method or use the Tree property to display hierarchical views of the
data.

Flexible Data Binding


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

Enhance Your UI with Microsoft Office 2007 and 2010 Styling


FlexGrid supports Visual Styles that mimic the styles available in Office 2007 and 2010,
including Blue, Silver, and Black.

Child Tables for Displaying Hierarchical Data


When FlexGrid is bound to a hierarchical data source, each master record can be
expanded/collapsed to show/hide the details in child grids, which may in turn contain more
details. The result is a "data tree" similar to the type of grid presented by Microsoft Access
when displaying hierarchical data. This is accomplished by deriving a control
(C1FlexDataTree) from the C1FlexGrid control. When bound, the control detects
subordinate data sources and creates additional instances of itself to display child tables.

Make it a Tree
By setting the IsNode property for certain rows you can transform FlexGrid into a TreeView.
You get a TreeView that has all the features of a rich datagrid.

Display Images and Data in Cells


Each grid cell can display images in addition to data. You can even bind grid columns to
image lists, an easy and efficient way to display database information graphically.

Add Special Drawing Effects


Make the grid look the way you want it to by painting special effects such as lines, bitmaps,
and icons in appropriate grid cells. You can also scale images and add transparency.

18

Assign Field Names to Columns


Refer to columns by name instead of position, if desired. Column keys are automatically
assigned to field names when the grid is data-bound, or you may assign them with code.
You can later refer to a column using a ColIndex(ColKey) syntax, which will retrieve the
column you want even if your user has moved it to a different position on the grid.

Merged Cells
Merge contiguous like-valued cells, making them span multiple rows or columns to
enhance appearance or clarity.

Range Aggregates
Calculate totals, averages, and other statistics for ranges of cells with a single statement!

Multiple File Formats for Saving/Loading Data


Load from and save grid contents to text, .xls, .xlsx (OpenXml format) files, or Open XML
files with other extensions. You can also load grid data from a database using DataReader
objects.

Built-in Data Filtering


Allow users to apply filters to each column on the grid by setting the AllowFiltering
property.

FlexGrid for WinForms Quick Start


In this section you will learn how to use the basic C1FlexGrid functionality to create a simple grid
application. This section is not supposed to be a comprehensive tutorial on all features of
C1FlexGrid, but rather provide a quick start and highlight some general approaches to using the
product. For more in-depth tutorials, see the FlexGrid for WinForms Tutorials. Visual Studio 2010
was used in this example; the steps may be slightly different in other versions of Visual Studio.

See Also
Step 1 of 3: Creating the FlexGrid for WinForms Application
Step 2 of 3: Binding C1FlexGrid to a Data Source
Step 3 of 3: Customizing C1FlexGrid Settings

Step 1 of 3: Creating the FlexGrid for WinForms Application


The following steps will walk you through creating a simple grid application.

19

1.
2.
3.
4.
5.

Create a new project.


Add a C1FlexGrid control to the form.
Open the C1FlexGrid Tasks menu. For more information on accessing the C1FlexGrid
Tasks menu, see C1FlexGrid Tasks Menu.
In the C1FlexGrid Tasks menu, click Dock in parent container. This sets the grid's Dock
property to Fill so the grid will fill the form.
Run the program. A simple grid application will appear.

Congratulations! You have successfully created a simple grid application. In the next topic, you will
learn how to bind the C1FlexGrid control to a data source.

Step 2 of 3: Binding C1FlexGrid to a Data Source


The following steps will walk you through binding a data source to the grid application you created
in the Step 1 of 3: Creating the FlexGrid for WinForms Application topic.
1.
2.
3.
4.
5.
6.
7.

8.
9.
10.

11.
12.

13.

Open the C1FlexGrid Tasks menu. For more information on accessing the C1FlexGrid
Tasks menu, see C1FlexGrid Tasks Menu.
In the C1FlexGrid Tasks menu, click the Choose Data Source drop-down arrow and select
the Add Project Data Source link from the drop-down box.
The Data Source Configuration Wizard appears. Leave the default setting, Database,
selected on the Choose a Data Source Type page, and click Next.
On the Choose a Database Model page, leave Dataset selected and click Next.
Click the New Connection button to create a new connection or choose one from the
drop-down list. When you click New Connection, the Add Connection dialog box appears.
Leave Microsoft Access Database File as the Data source.
Click the Browse button under Database file name. In the Select Microsoft Access
Database File dialog box, browse to the NWind.mdb database in the C:\Documents and
Settings\<username>\My Documents\ComponentOne Samples\Common (Windows XP) or
C:\Users\<username>\Documents\ComponentOne Samples\Common (Vista) directory.
Select the NWind.mdb file and click Open.
In the Add Connection dialog box, click the Test Connection button to make sure that
you have successfully connected to the database or server and click OK.
Click OK again to close the Add Connection dialog box.
Click the Next button to continue. A dialog box will appear asking if you would like to add
the data file to your project and modify the connection string. Since it is not necessary to
copy the database to your project, click No.
Save the connection string in the application configuration file by checking the Yes, save
the connection as box and entering a name. Click the Next button to continue.
On the Choose Your Database Objects page, expand the Tables node, and select the
Products table. Enter ProductsDS in the DataSet name box and click Finish to exit the
wizard.
A DataSet and connection string are added to your project. Additionally, Visual Studio
automatically creates the following code to fill the DataSet:
To write code in Visual Basic

20

Visual Basic

Copy Code

Me.ProductsTableAdapter.Fill(Me.ProductsDS.Products)
To write code in C#
C#

Copy Code

this.productsTableAdapter.Fill(this.productsDS.Products);

Run the program and observe the following:


Notice that the data from the Products table is reflected in the grid.

Congratulations! You have successfully bound the grid application to a data source. In the next
topic, you will learn how to customize format strings, Visual Styles, and built-in styles.

Step 3 of 3: Customizing C1FlexGrid Settings


The following steps will walk you through setting a format string, Visual Style, and built-in styles for
the grid.

21

1.

Resize the first column in the grid by dragging the horizontal double arrow that appears at
the right edge of the first column's header to the left until the UnitPrice column is visible:

2.

Click the UnitPricecolumn to open the Column Tasks menu.

3.

Click the ellipsis button next to the Format String text box to open the Format String
dialog box.
In the Format String dialog box, select Currency under Format type and click OK.
In the Properties window, locate the VisualStyle property and set it to Office2007Blue.
Open the C1FlexGrid Tasks menu. The Column Tasks menu will appear since we last
edited a column using the Tasks menu. Select C1FlexGrid Tasks to return to the
C1FlexGrid Tasks menu.
On the C1FlexGrid Tasks menu, select Styles to open the C1FlexGrid Style Editor.

4.
5.
6.

7.

22

8. In the C1FlexGrid Style Editor under Built-In Styles, select Fixed.


9. Expand the Font node in the right pane and set the Bold property to True.
10. Set the ForeColor property to CornflowerBlue on the Web tab and click OK to close the
dialog box.

Run the program and observe the following:


The grid application displays a the Products table using a format string, Visual Style, and built-in
styles.

You have successfully set the format string, Visual Style, and built-in styles for the grid. This
concludes the Quick Start.

Design-Time Support
You can easily configure ComponentOne FlexGrid for WinForms at design time using the
property grid, menus, and designers in Visual Studio. The following sections describe how to use
C1FlexGrid's design-time environment to configure the C1FlexGrid control.

See Also
C1FlexGrid Editors
C1FlexGrid Smart Tag

23

C1FlexGrid Editors
There two are design-time editors that allow you to control the layout and appearance of
C1FlexGrid, C1FlexGrid Column Editor and C1FlexGrid Style Editor. Additionally, Caption Style
and Column Style are two design-time editors that allow you to change the appearance of a
specific caption or column.

See Also
C1FlexGrid Column Editor
C1FlexGrid Style Editor
Caption Style and Column Style

C1FlexGrid Column Editor


If you prefer, you can set up the grid columns at design time instead of writing code to do it. The
designer can be accessed in one of three ways:

Select the grid in Design view, go to the Properties window and click the ellipsis button
() next to the Cols property.
Right-click the control and select Designer from the context menu.
Click on the smart tag ( ) in the upper right corner of the grid and select Designer from
the C1FlexGrid Tasks menu.

This will bring up the Column Editor shown below:

24

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:

Button

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:
Description
Font: Sets the selected font in the drop-down list.

25

Button

Description

Font Size: Sets the selected font size in the drop-down


list.

Font Formatting: Applies bold, italics or underline to


the font.

Justification: Sets the font alignment to left, center,


right or general.

Alignment: Aligns column content to the top, center, or


bottom. 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.
BackColor: Sets the backcolor of the selected column.

ForeColor: Sets the forecolor of the selected column.

Apply to Fixed Rows: Applies the settings to fixed


rows.

Help: Displays or hides the description for the selected


property.

Undo: Cancels all changes and reverts the grid columns


to their original state.

26

Button

Description

AutoResize: 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.
Selected Column: Selects the current column from the
drop-down list.

Insert Column: Inserts columns to the left or right of


the selection.

Delete Column: Removes the selected column.

Column Width: Sets the column width of all selected


columns to the same width, wider or narrower.

Toggle Visibility: Displays or hides a column.

Unhide All Columns: Makes all columns visible.

Show Hidden Columns: Shows hidden columns. If you

27

Button

Description
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 hidden
columns so you can select and edit them.
Determines whether the properties for the selected
columns should be displayed in categorized or
alphabetical order.

C1FlexGrid Style Editor


If you prefer, you can set up styles at design time instead of writing code to do it. The C1FlexGrid
Style Editor can be accessed in one of three ways:

Select the grid, go to the Properties window and click the ellipsis button next to the Styles
property.
Right-click the grid and select Styles from the context menu.
Click on the smart tag ( ) in the upper right corner of the grid and select Styles from the
C1FlexGrid Tasks menu.

The grid will display the C1FlexGrid Style Editor dialog box.
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.

28

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 box that allows you to select a complete set
of predefined styles. Here's what the AutoFormat dialog box looks like:

29

Caption Style and Column Style


The Caption Style editor and the Column Style editor for a selected column allow you to specify
the properties for the caption text and column text, respectively, as well as alignment, background,
and borders.
The Caption Style and Column Style editors can only be accessed in the Column Tasks menu. For
more information on the Column Tasks menu, see Column Tasks Menu.
The Caption Style and Column Style editors have four tabs: Text, Alignment, Background, and
Borders. The Preview area allows you to view your settings before applying them to the grid.

Text
The Text tab sets the font and formatting of the caption.

30

The following options are available in the Font area:

Name: Choose a font name.


Size: Choose a font size.
Color: Choose a font color.
Direction: Choose from Normal, Up or Down.
Font Effects: Use the buttons to toggle bold, italic, and underline on or off.

The following options are available in the Formatting area:

Format: Click the ellipsis button to open the Format String dialog box. For more details
on the Format String dialog box, see Cell Content.
Input Mask: Click the ellipsis button to open the Input Mask dialog box. For more details
on the Input Mask dialog box, see Masks.
Effect: Choose from Flat, Raised, or Inset. For more details on the text effect options, see
the TextEffectEnum Enumeration.

31

Trimming: Choose from None, Character, Word, EllipsisCharacter, EllipsisWord, or


EllipsisPath to set how long strings are trimmed to fit the cell.
Word Wrap: Check the box to enable word wrapping for the caption.

Alignment
The Alignment tab sets the alignment of both text and images in the caption.

The following options are available in the Text Alignment area:

Horizontal: Click the buttons to toggle between Align Left, Align Center, Align Right,
and Align General.
Vertical: Click the buttons to toggle between Align Top, Align Middle, and Align Bottom.
The following options are available in the Image Alignment area:
Clip: Click the buttons to toggle between image alignment in the cell or Scale, Tile,
Stretch, TileStretch, or Hide the image. For more details on the image alignment options,
see the ImageAlignEnum Enumeration.

32

Show Sample Image: Check the Show Sample Image box to display a sample image in
the Preview area.
The following options are available in the Display area:
Text/Image Spacing: Increase or decrease this value to increase or decrease the amount of
space between the text and the image.
Display: Choose from TextOnly, ImageOnly, Overlay, Stack, or None. For more details on
the display options, see the DisplayEnum Enumeration.

Background
The Background tab sets the background color and background image.

The following option is available in the Background Color area:

Color: Choose a color for the background of the cell.

The following options are available in the Background Image area:

33

Image: Click the Select button to select an image or the Clear button to remove an image.
Layout: Toggle between Scale, Tile, Stretch, TileStretch, or Hide.

Borders
The Background tab sets the borders and margins.

The following options are available in the Borders area:

Style: Choose from None, Flat, Double, Raised, Inset, Groove, Fillet, or Dotted. For
details on the different border style options, see the C1.Win.C1FlexGrid.BorderStyleEnum
Enumeration.
Width: Increase or decrease the value to increase or decrease the width of the border.
Color: Choose a color for the border.
Direction: Choose from Both, Horizontal, or Vertical. For details on the different border
direction options, see the BorderDirEnum Enumeration.

34

The following options are available in the Margins area:

Left: Increase or decrease the value to increase or decrease the left margin.
Top: Increase or decrease the value to increase or decrease the top margin.
Right: Increase or decrease the value to increase or decrease the right margin.
Bottom: Increase or decrease the value to increase or decrease the bottom margin.

C1FlexGrid Smart Tag


A smart tag ( ) represents a short-cut Tasks menu that provides the most commonly used
properties in each control.
There are two Tasks menus available through the smart tag in C1FlexGrid: C1FlexGrid Tasks Menu
and Column Tasks Menu.

See Also
C1FlexGrid Tasks Menu
Column Tasks Menu

C1FlexGrid Tasks Menu


In the C1FlexGrid Tasks menu, you can quickly access the C1FlexGrid Column Editor and the
C1FlexGrid Style Editor, as well as set the following properties: AllowAddNew, AllowDelete,
AllowEditing, and AllowDragging.
To access the C1FlexGrid Tasks menu, click on the smart tag (
grid. This will open the C1FlexGrid Tasks menu.

35

) in the upper right corner of the

Choose Data Source


Clicking the drop-down arrow in the Choose Data Source box opens a list of available data sources
and allows you to add a new data source. To add a new data source to the project, click Add
Project Data Source to open the Data Source Configuration Wizard.
For more information on how to add a new data source to the project, see Binding to a Data
Source.

Enable Adding Rows


Selecting the Enable Adding Rows check box sets the AllowAddNew property to True, and allows
adding new rows to the grid. The default is unchecked.

Enable Deleting Rows


Selecting the Enable Deleting Rows check box sets the AllowDelete property to True, and allows
deleting rows in the grid. The default is unchecked.

Enable Editing
Selecting the Enable Editing check box sets the AllowEditing property to True, and allows editing
in the grid. The default is checked.

Enable Column Reordering


Selecting the Enable Column Reordering check box sets the AllowDragging property to Columns,
and allows dragging of columns in the grid. The default is checked.

Display Hidden Columns


Selecting the Display Hidden Columns check box sets the Visible property to True for hidden
columns and displays them. The default is unchecked.

Designer
Clicking Designer opens the C1FlexGrid Column Editor.

36

For more information on how to edit columns with the C1FlexGrid Column Editor, see C1FlexGrid
Column Editor.

Styles
Clicking Styles opens the C1FlexGrid Style Editor.

37

For more information on how to customize cell appearance with the C1FlexGrid Style Editor, see
C1FlexGrid Style Editor.

Column Tasks
Clicking Column Tasks opens the Column Tasks menu. For details on the Column Tasks menu,
see Column Tasks Menu.

About C1FlexGrid
Clicking About C1FlexGrid displays the About ComponentOne C1FlexGrid dialog box, which is
helpful in finding the version number of C1FlexGrid.

Dock in parent container/Undock in parent container

38

Clicking Dock in parent container sets the Dock property for C1FlexGrid to Fill.
If C1FlexGrid is docked in the parent container, the option to undock C1FlexGrid from the parent
container will be available. Clicking Undock in parent container sets the Dock property for
C1FlexGrid to None.

Column Tasks Menu


The Column Tasks menu allows you to set the column caption, data field, data type, edit mask,
format string, and combo list for a column, as well as set the following properties: AllowSorting,
AllowEditing, AllowResizing, AllowDragging, AllowMerging, and Visible.
To access the Column Tasks menu, either click on a column in the grid or select Column Tasks
from the C1FlexGrid Tasks menu.

Column Caption
Entering a caption into the Column Caption box set the Caption property for the column.

Data Field
Clicking the drop-down arrow in the Data Field box opens a list of available fields in the data
source.

Data Type
Clicking the drop-down arrow in the Data Type box opens a list of available data types.

Edit Mask
Clicking the ellipsis button in the Edit Mask box opens the Input Mask dialog box.

Format String
Clicking the ellipsis button in the Format String box opens the Format String dialog box.

Combo List
Clicking the ellipsis button in the Combo List box opens the Combo List dialog box.

Allow Sorting
Selecting the Allow Sorting check box sets the AllowSorting property to True, and allows sorting in
the column. The default is checked.

39

Allow Editing
Selecting the Allow Editing check box sets the AllowEditing property to True, and allows editing in
the column. The default is checked.

Allow Resizing
Selecting the Allow Resizing check box sets the AllowResizing property to True, and allows
resizing the column. The default is checked.

Allow Dragging
Selecting the Allow Dragging check box sets the AllowDragging property to True, and allows
dragging columns in the grid. The default is checked.

Allow Merging
Selecting the Allow Merging check box sets the AllowMerging property to True, and allows
merging in the column. The default is unchecked.

Visible
Selecting the Visible check box sets the Visible property to True, and allows the column to be
visible in the grid. The default is checked.

Caption Style
Clicking Caption Style opens the Caption Style editor for the selected column, which allows you to
specify the properties for the caption text, including alignment, background, and borders.

Column Style
Clicking Column Style opens the Column Style editor for the selected column, which allows you to
specify properties for the column, including text, alignment, background, and borders.

C1FlexGrid Tasks
Clicking C1FlexGrid Tasks returns you to the C1FlexGrid Tasks menu. For details on the
C1FlexGrid Tasks menu, see C1FlexGrid Tasks Menu.

Dock in parent container/Undock in parent container


Clicking Dock in parent container sets the Dock property for C1FlexGrid to Fill.

40

If C1FlexGrid is docked in the parent container, the option to undock C1FlexGrid from the parent
container will be available. Clicking Undock in parent container sets the Dock property for
C1FlexGrid to None.

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:

41

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

42

Rows and Columns


Describes how to set up the grid dimensions and layout.
Cell Selection
Describes the concepts of "current cell" and "selection".
Cell Ranges
Describes how to work with a group of cells as a single unit.
Cell Images
Describes how to display images in a cell.
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.
Editing Cells
Describes how to implement simple text editing, drop-down lists and combo lists, cell buttons,
editing masks, and data validation.
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 Data
Describes how to add subtotals to grids and how to build outline trees.
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.
C1FlexGrid Property Groups
Presents a map of the main C1FlexGrid properties cross-referenced by function.

See Also
Rows and Columns

43

Cell Selection
Cell Ranges
Cell Images
Formatting Cells
Editing Cells
Merging Cells
Outlining and Summarizing Data
Saving, Loading, and Printing
C1FlexGrid Filtering
C1FlexGrid Property Groups

Rows and Columns


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:
To write code in Visual Basic
Visual Basic

Copy Code

_flex.Rows.Count = 500
_flex.Cols.Count = 10
To write code in C#
C#

Copy Code

_flex.Rows.Count = 500;
_flex.Cols.Count = 10;

44

There are two basic types of rows and columns: fixed and scrollable. (The counts returned by the
Count property include fixed and scrollable cells.) 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.

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:
To write code in Visual Basic
Visual Basic

Copy Code

_flex.Rows.Fixed = 1
_flex.Cols.Fixed = 0
To write code in C#
C#

Copy Code

_flex.Rows.Fixed = 1;

45

_flex.Cols.Fixed = 0;
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.
If you prefer, you can set up the grid columns at design time instead of writing code to do it using
the C1FlexGrid Column Editor. For details on editing columns using the C1FlexGrid Column
Editor, see C1FlexGrid Column Editor.

See Also
Column Sizing

Column Sizing
The width of a column is determined by its Width property. At design time, the Width property can
be set directly in the grid or through the C1FlexGrid Column Editor. In the grid, clicking and
dragging the horizontal double arrow that appears at the right edge of a column's header allows
the column to be resized.

The dotted vertical line indicates how the grid will be resized. Dragging the pointer to the left
makes the column smaller; dragging it to the right makes the column larger. The column's Width
property will be adjusted when the resize operation is complete.
In the C1FlexGrid Column Editor or in code, specify the value of the Width property for a column.
For details on the C1FlexGrid Column Editor, see C1FlexGrid Column Editor. The following code
sets the Width property of Column1 to 10:

46

To write code in Visual Basic


Visual Basic

Copy Code

_flex.Cols(1).Width = 10
To write code in C#
C#

Copy Code

_flex.Cols(1).Width = 10
To prevent resizing a specific column, set the AllowResizing property for the column to False either
in the Column Tasks menu or C1FlexGrid Column Editor, or in code. For details on the Column
Tasks menu, see Column Tasks Menu. The following code sets the AllowResizing property for
Column1 to False:
To write code in Visual Basic
Visual Basic

Copy Code

_flex.Cols(1).AllowResizing = False
To write code in C#
C#

Copy Code

_flex.Cols(1).AllowResizing = False

Cell 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.

47

Notice that the Office Visual Styles also indicate the location of the cursor cell by highlighting the
row and column headers of the cursor cell's position. For more information about setting the Visual
Style, see Customizing Appearance Using Visual Styles.
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.

Notice that the Office Visual Styles also indicate the location of the extended selection by
highlighting the row and column headers of the selected cells. For more information about setting
the Visual Style, see Customizing Appearance Using Visual Styles.
You can get or set the selection cell in code using the RowSel and ColSel properties, or by 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:

FocusRect determines the type of focus rectangle that is drawn to indicate the cursor cell.
HighLight determines when the selection should be highlighted (always, when the control
has the focus, or never).
HighLight and Focus are cell styles that determine the appearance of the selection (font,
color, and border).

48

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 the Selected 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:
To write code in Visual Basic
Visual Basic

Copy Code

'Selects all rows with more than 8000 sales in the Sales column.
_flex.SelectionMode = C1.Win.C1FlexGrid.SelectionModeEnum.ListBox
Dim index As Integer
For index = _flex.Rows.Fixed To _flex.Rows.Count - 1
If Val(_flex(index, "Sales")) > 80000 Then
_flex.Rows(index).Selected = True
End If
Next
Console.WriteLine("There are now {0} rows selected", _flex.Rows.Selected.Count)
To write code in C#
C#

Copy Code

// Selects all rows with more than 8000 sales in the Sales column.
_flex.SelectionMode = SelectionModeEnum.ListBox;
for (int index = _flex.Rows.Fixed ; index < _flex.Rows.Count; index++)
{
if
(Microsoft.VisualBasic.Conversion.Val(System.Runtime.CompilerServices.RuntimeHel
pers.GetObjectValue(_flex[index, "Sales"])) > 80000)
{
_flex.Rows[index].Selected = true;
}
}

49

Console.WriteLine("There are now {0} rows selected", _flex.Rows.Selected.Count);

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:
To write code in Visual Basic
Visual Basic

Copy Code

Dim rg As CellRange = _flex.GetCellRange(3, 3, 10, 10)


rg.Data = Nothing
rg.Style = _flex.Styles("MyRangeStyle")
To write code in C#
C#

Copy Code

CellRange rg = _flex.GetCellRange(3, 3, 10, 10);


rg.Data = null;
rg.Style = _flex.Styles["MyRangeStyle"];
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:
To write code in Visual Basic
Visual Basic

Copy Code

Dim rg As CellRange = _flex.GetCellRange(3, 3, 10, 10)


rg.StyleNew.BackColor = Color.Red
To write code in C#

50

C#

Copy Code

CellRange rg = _flex.GetCellRange(3, 3, 10, 10);


rg.StyleNew.BackColor = Color.Red;

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

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.
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.

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.

See Also
Cell Content
Cell Appearance
Conditional Formatting
Owner-Drawn Cells

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:
To write code in Visual Basic
Visual Basic

Copy Code

51

' Short date.


_flex.Cols(1).Format = "d"
' Currency.
_flex.Cols(2).Format = "c"
To write code in C#
C#

Copy Code

// Short date.
_flex.Cols[1].Format = "d";
// Currency.
_flex.Cols[2].Format = "c";
The formatting of cell content can also be set at design time using the Format String dialog box.
The Format String dialog box can be accessed through the Column Tasks menu or through the
C1FlexGrid Column Editor.

In the Column Tasks menu, click the ellipsis button in the Format String box.
In the C1FlexGrid Column Editor, locate the Format property in the left pane, and click the
ellipsis button next to it.

Note: The Format String dialog box is column specific and will only change the Format
property of the selected column.
You can also use custom formats like the ones used in the Visual Basic Format function (for
example, "#,###", and so on).

Retrieving Cell Data


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:
To write code in Visual Basic
Visual Basic

Copy Code

52

' Short date.


_flex.Cols(1).Format = "d"
' Currency.
_flex.Cols(2).Format = "c"
_flex(1, 2) = 10000
Console.WriteLine("Raw value: {0}", _flex(1, 2))
Console.WriteLine("Display value: {0}", _flex.GetDataDisplay(1, 2))
' Raw value: 10000
' Display value: $10,000.00
To write code in C#
C#

Copy Code

// Short date.
_flex.Cols[1].Format = "d";
// Currency.
_flex.Cols[2].Format = "c";
_flex[1, 2] = 10000;
Console.WriteLine("Raw value: {0}", _flex[1, 2]);
Console.WriteLine("Display value: {0}", _flex.GetDataDisplay(1, 2));
// Raw value: 10000
// Display value: $10,000.00

Cell Appearance
The appearance of the cells (alignment, font, colors, borders, and so on) 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, and so on. 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.

53

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:
To write code in Visual Basic
Visual Basic

Copy Code

Dim cs As CellStyle = _flex.Styles.Highlight


cs.Font = New Font(_flex.Font, FontStyle.Bold)
cs.ForeColor = Color.Green
cs.BackColor = Color.Red
To write code in C#
C#

Copy Code

CellStyle cs = _flex.Styles.Highlight;
cs.Font = new Font(_flex.Font, FontStyle.Bold);
cs.ForeColor = Color.Green;
cs.BackColor = Color.Red;
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:
To write code in Visual Basic
Visual Basic

Copy Code

Dim cs As CellStyle = _flex.Styles.Add("Fifth")


cs.BackColor = Color.Gray
Dim idex%
For idex = _flex.Rows.Fixed To _flex.Rows.Count - 1 Step 5
_flex.Rows(idex).Style = cs
Next
To write code in C#

54

C#

Copy Code

CellStyle cs = _flex.Styles.Add("Fifth");
cs.BackColor = Color.Gray;
for (int index = _flex.Rows.Fixed ; index <= _flex.Rows.Count - 1; index += 5)
{
_flex.Rows[index].Style = cs;
}
Here's an example that shows how you can create custom styles and assign them to columns, rows,
and cell ranges:
To write code in Visual Basic
Visual Basic

Copy Code

' Create a new custom style


Dim s As CellStyle = _flex.Styles.Add("MyStyle")
s.BackColor = Color.Red
s.ForeColor = Color.White
' Assign the new style to a column.
_flex.Cols(3).Style = _flex.Styles("MyStyle")
' Assign the new style to a row.
_flex.Rows(3).Style = _flex.Styles("MyStyle")
' Assign the new style to a cell range.
Dim rg As CellRange = _flex.GetCellRange(4, 4, 6, 6)
rg.Style = _flex.Styles("MyStyle")
To write code in C#
C#

Copy Code

// Create a new custom style.


CellStyle s = _flex.Styles.Add("MyStyle");

55

s.BackColor = Color.Red;
s.ForeColor = Color.White;
// Assign the new style to a column.
_flex.Cols[3].Style = _flex.Styles["MyStyle"];
// Assign the new style to a row.
_flex.Rows[3].Style = _flex.Styles["MyStyle"];
// Assign the new style to a cell range.
CellRange rg = _flex.GetCellRange(4,4,6,6);
rg.Style = _flex.Styles["MyStyle"];
If you prefer, you can set up styles at design time using the C1FlexGrid Style Editor instead of
writing code to do it. For details on customizing cell appearance with the C1FlexGrid Style Editor,
see C1FlexGrid Style Editor.

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:
To write code in Visual Basic
Visual Basic

Copy Code

Dim cs As C1.Win.C1FlexGrid.CellStyle
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' 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
' Format cells based on their content.
Private Sub _flex_CellChanged(ByVal sender As Object, ByVal e As
RowColEventArgs) Handles _flex.CellChanged

56

' Mark currency values > 50,000 as LargeValues (reset others by setting
their Style to Nothing).
Dim cs As CellStyle
If _flex(e.Row, e.Col).ToString >= 50000 Then
cs = _flex.Styles("LargeValue")
_flex.SetCellStyle(e.Row, e.Col, cs)
End If
End Sub
To write code in C#
C#

Copy Code

CellStyle cs;
private void Form1_Load(object sender, EventArgs e)
{
// Create a custom style for large values.
cs = _flex.Styles.Add("LargeValue");
cs.Font = new Font(Font, FontStyle.Italic);
cs.BackColor = Color.Gold;
}
// 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 null).
if (Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(_flex[e.Row,
e.Col].ToString()) >= 50000)
{
cs = _flex.Styles["LargeValue"];
_flex.SetCellStyle(e.Row, e.Col, cs);
}
}

57

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, and so on), 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.
Note:For an example of advanced Owner-Draw Cells, see the RtfGrid sample on
ComponentOne HelpCentral.
The code below shows an example. It uses a gradient brush to paint 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:
To write code in Visual Basic
Visual Basic

Copy Code

Dim m_GradientBrush As System.Drawing.Drawing2D.LinearGradientBrush


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

58

'

Brush to use with owner-draw cells.

m_GradientBrush = New
System.Drawing.Drawing2D.LinearGradientBrush(ClientRectangle, Color.SteelBlue,
Color.White, 45)
'

Use owner-draw to add gradients.

_flex.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw
End Sub
Private Sub _flex_Resize(ByVal sender As Object, ByVal e As System.EventArgs)
Handles _flex.Resize
'

Update gradient brush when the control is resized.

m_GradientBrush = New
System.Drawing.Drawing2D.LinearGradientBrush(ClientRectangle, Color.SteelBlue,
Color.White, 45)
End Sub
To write code in C#
C#

Copy Code

System.Drawing.Drawing2D.LinearGradientBrush m_GradientBrush;
private void Form1_Load(object sender, EventArgs e)
{
// Brush to use with owner-draw cells.
m_GradientBrush = new
System.Drawing.Drawing2D.LinearGradientBrush(ClientRectangle, Color.SteelBlue,
Color.White, 45);
// Use owner-draw to add gradients.
_flex.DrawMode = DrawModeEnum.OwnerDraw;
}
private void _flex_Resize( object sender, System.EventArgs e)

59

{
// Update gradient brush when the control is resized.
m_GradientBrush = new
System.Drawing.Drawing2D.LinearGradientBrush(ClientRectangle, Color.SteelBlue,
Color.White, 45);
}
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:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub _flex_OwnerDrawCell(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles _flex.OwnerDrawCell
'

Draw the selected cell background using gradient brush.

If _flex.Selection.Contains(e.Row, e.Col) Then


'

Draw the background.

e.Graphics.FillRectangle(m_GradientBrush, e.Bounds)
'

Let the grid draw the content.

e.DrawCell(C1.Win.C1FlexGrid.DrawCellFlags.Content)
'

We're done drawing this cell.

e.Handled = True
End If
End Sub
To write code in C#
C#

Copy Code

private void _flex_OwnerDrawCell( object sender, OwnerDrawCellEventArgs e)

60

{
// Draw the selected cell background using gradient brush.
if (_flex.Selection.Contains(e.Row, e.Col))
{
// Draw the background.
e.Graphics.FillRectangle(m_GradientBrush, e.Bounds);
// Let the grid draw the content.
e.DrawCell(DrawCellFlags.Content);
// We' re done drawing this cell.
e.Handled = true;
}
}

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 the cursor appears where
the cell is clicked.

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).

61

These features are described in the following topics.

See Also
Lists and Combos
Checkboxes
Value-Mapped Lists
Cell Buttons
Masks
Validation
Custom Editors
Edit Mode

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 (for example, "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 (for
example "|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:
To write code in Visual Basic
Visual Basic

Copy Code

' Drop-down list.


_flex.Cols(1).ComboList = "Red|Green|Blue|Red|White"

62

' Drop-down combo.


_flex.Cols(2).ComboList = "|Red|Green|Blue|Red|White"
To write code in C#
C#

Copy Code

// Drop-down list.
_flex.Cols[1].ComboList = "Red|Green|Blue|Red|White";
// Drop-down combo.
_flex.Cols[2].ComboList = "|Red|Green|Blue|Red|White";
The ComboList property can also be set at design time using the Combo List dialog box. The
Combo List dialog box allows you to choose if you want the list to appear as a Dropdown List,
Dropdown Combo, Ellipsis Button, or TextBox and Ellipsis Button.

The Combo List dialog box can be accessed through the Column Tasks menu or through the
C1FlexGrid Column Editor.

In the Column Tasks menu, click the ellipsis button in the Combo List box.
In the C1FlexGrid Column Editor, locate the ComboList property in the left pane, and click
the ellipsis button next to it.

63

Note: The Combo List dialog box is column specific and will only change the ComboList
property of the selected column.
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 Properties
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.

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:
To write code in Visual Basic
Visual Basic

Copy Code

_flex.Cols["bools"].Format = "Yes;No"
To write code in C#
C#

Copy Code

_flex.Cols["bools"].Format = "Yes;No";
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.

64

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 bar 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.

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 userfriendly 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:
To write code in Visual Basic
Visual Basic

Copy Code

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")
_flex.Cols(1).DataType = GetType(Color)
_flex.Cols(1).DataMap = dtMap
To write code in C#

65

C#

Copy Code

System.Collections.Hashtable dtMap = new System.Collections.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");
_flex.Cols[1].DataType = typeof(Color);
_flex.Cols[1].DataMap = dtMap;
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:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
' Sorts by key.
Dim sl As New SortedList()
sl.Add("0", "Zero")
sl.Add("1", "One")
sl.Add("2", "Two")
sl.Add("3", "Three")
' Keeps Add order.

66

Dim ld As New Specialized.ListDictionary()


ld.Add(0, "Zero")
ld.Add(1, "One")
ld.Add(2, "Two")
ld.Add(3, "Three")
' Arbitrary order.
Dim ht As New Hashtable()
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
To write code in C#
C#

Copy Code

private void Form1_Load(object sender, System.EventArgs e);


{
// Sorts by key.
System.Collections.SortedList sl = new System.Collections.SortedList();
sl.Add("0", "Zero");
sl.Add("1", "One");
sl.Add("2", "Two");
sl.Add("3", "Three");
// Keeps Add order.
System.Collections.Specialized.ListDictionary ld = new
System.Collections.Specialized.ListDictionary();
ld.Add(0, "Zero");

67

ld.Add(1, "One");
ld.Add(2, "Two");
ld.Add(3, "Three");
// Arbitrary order.
System.Collections.Hashtable ht = new System.Collections.Hashtable();
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";
}
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:
To write code in Visual Basic
Visual Basic

Copy Code

Private Enum Countries


NewYork
Chicago
NewOrleans
London
Paris
End Enum
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
_flex.Cols(1).DataType = GetType(Countries)

68

End Sub
To write code in C#
C#

Copy Code

private enum Countries


{
NewYork,
Chicago,
NewOrleans,
London,
Paris
}
private void Form1_Load(object sender, EventArgs e)
{
_flex.Cols[1].DataType = typeof(Countries);
}

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 box, 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 color picker dialog box for
choosing a color in a column.
To write code in Visual Basic

69

Visual Basic

'

Copy Code

Set up color column.

Dim c As C1.Win.C1FlexGrid.Column = _flex.Cols(1)


c.DataType = GetType(Color)
'

Show cell button.

c.ComboList = "..."
To write code in C#
C#

Copy Code

// Set up color column.


Column c = _flex.Cols[1];
c.DataType = typeof(Color);
// Show cell button.
c.ComboList = "...";
This code sets up the column so the user can click a button and select a color from a dialog box.
The next step is the code that handles clicks on the cell button:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub _flex_CellButtonClick(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.RowColEventArgs) Handles _flex.CellButtonClick
'

Create color picker dialog.

Dim clrDlg As New ColorDialog()


'

Initialize the dialog.

If _flex(e.Row, e.Col) Is GetType(Color) Then


clrDlg.Color = _flex(e.Row, e.Col)
End If

70

'

Get new color from dialog and assign it to the cell.

If clrDlg.ShowDialog() = Windows.Forms.DialogResult.OK Then


_flex(e.Row, e.Col) = clrDlg.Color
End If
End Sub
To write code in C#
C#

Copy Code

private void _flex_CellButtonClick( object sender, RowColEventArgs e)


{
// Create color picker dialog.
ColorDialog clrDlg = new ColorDialog();
// Initialize the dialog.
if (_flex[e.Row, e.Col] == typeof(Color))
{
clrDlg.Color = (Color)_flex[e.Row, e.Col];
}
// Get new color from dialog and assign it to the cell.
if (clrDlg.ShowDialog() == DialogResult.OK)
{
_flex[e.Row, e.Col] = clrDlg.Color;
}
}

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 (for
example, digits or alphabetic). For example, the code below assigns a "(999) 999-9999" editing

71

mask to column one, which holds phone numbers (the digit "9" is a placeholder that stands for any
digit):
To write code in Visual Basic
Visual Basic

Copy Code

' Set up a phone number edit mask.


_flex.Cols(1).EditMask = "(999) 999-9999"
To write code in C#
C#

Copy Code

// Set up a phone number edit mask.


_flex.Cols[1].EditMask = "(999) 999-9999";
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:
To write code in Visual Basic
Visual Basic

Copy Code

_flex.Cols(1).DataType = GetType(DateTime)
_flex.Cols(1).Format = "hh:mm tt"
_flex.Cols(1).EditMask = "99:99 LL"
To write code in C#
C#

Copy Code

_flex.Cols[1].DataType = typeof(DateTime);
_flex.Cols[1].Format = "hh:mm tt";

72

_flex.Cols[1].EditMask = "99:99 LL";


The EditMask property can also be set at design time using the Input Mask dialog box.

The Input Mask dialog box can be accessed through the Column Tasks menu or through the
C1FlexGrid Column Editor.

In the Column Tasks menu, click the ellipsis button in the Edit Mask box.
In the C1FlexGrid Column Editor, locate the EditMask property in the left pane, and click
the ellipsis button next to it.

Note: The Input Mask dialog box is column specific and will only change the EditMask
property of the selected column.
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.

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.

73

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:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub _flex_ValidateEdit(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.ValidateEditEventArgs) Handles _flex.ValidateEdit
' Validate amounts.
If _flex.Cols(e.Col).DataType Is GetType(Decimal) Then
Try
Dim dec As Decimal = Decimal.Parse(_flex.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
To write code in C#
C#

Copy Code

private void _flex_ValidateEdit( object sender, ValidateEditEventArgs e)


{
// Validate amounts.

74

if (_flex.Cols[e.Col].DataType == typeof(Decimal))
{
try
{
Decimal dec = Decimal.Parse(_flex.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;
}
}
}

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 in the designer (using the Column
Editor) or in code. 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
select Designer from the C1FlexGrid Tasks menu to open the C1FlexGrid Column Editor. 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:

75

1.
2.
3.
4.

Add a C1FlexGrid control to the form.


Add a NumericUpDown control to the form and set its BorderStyle property to None.
Select Designer from the C1FlexGrid Tasks menu. For more information on accessing the
C1FlexGrid Column Editor, see Accessing the C1FlexGrid Column Editor.
In the C1FlexGrid 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 using code:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
' Create the custom editor.
Dim editor as New NumericUpDown()
editor.BorderStyle = BorderStyle.None
' Assign the custom editor to the grid.
_flex.Cols(1).Editor = editor
End Sub
To write code in C#
C#

Copy Code

private void Form1_Load(object sender, System.EventArgs e)


{
// Create the custom editor.
NumericUpDown editor = new NumericUpDown();
editor.BorderStyle = BorderStyle.None;

76

// Assign the custom editor to the grid.


_flex.Cols[1].Editor = editor;
}

See Also
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.
2.
3.

Derives from Control (UITypeEditor doesn't).


Implements the IC1EmbeddedEditor interface.
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, and so on. You can also write
your own UITypeEditors, in some cases that is easier than writing a control.
Note: For an example of using built-in, custom, and UITypeEditor editors with C1FlexGrid, see
the CustomEditors sample on ComponentOne HelpCentral.

77

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:
Event

Description

BeforeEdit

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

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.

SetupEditor

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.

78

Event

Description

ValidateEdit

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
(for example, 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

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).

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.
2.

Set the grid's AllowMerging property to a value other than None. (The effect of each
setting is explained in the reference section.)
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.

79

See Also
Merged Table Headers
Merged Data Views
Spilling Text
Custom Merging

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:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Dim i%
'

Initialize the control.

_flex.Styles.Normal.WordWrap = True
_flex.Cols.Count = 9
_flex.Rows.Fixed = 2
_flex.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.FixedOnly
'

Create row headers.

_flex.Rows(0).AllowMerging = True
'

Merge the four cells with same contents.

Dim rng As C1.Win.C1FlexGrid.CellRange = _flex.GetCellRange(0, 1, 0, 4)


rng.Data = "North"
'

Merge the four cells with same contents.

rng = _flex.GetCellRange(0, 5, 0, 8)

80

rng.Data = "South"
For i = 1 To 4
_flex(1, i) = "Qtr " & i
_flex(1, i + 4) = "Qtr " & i
Next
'

Create the column header.

_flex.Cols(0).AllowMerging = True
'

Merge the two cells with same contents.

rng = _flex.GetCellRange(0, 0, 1, 0)
rng.Data = "Sales by Product"
'

Align and autosize the cells.

_flex.Styles.Fixed.TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.CenterCenter
_flex.AutoSizeCols(1, _flex.Cols.Count - 1, 10)
End Sub
To write code in C#
C#

Copy Code

private void Form1_Load(System.object sender, System.EventArgs e)


{
int i;
// Initialize the control.
_flex.Styles.Normal.WordWrap = true;
_flex.Cols.Count = 9;
_flex.Rows.Fixed = 2;
_flex.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.FixedOnly;
// Create row headers.
_flex.Rows[0].AllowMerging = true;
// Merge the four cells with same contents.
C1.Win.C1FlexGrid.CellRange rng = _flex.GetCellRange(0, 1, 0, 4);
rng.Data = "North";

81

// Merge the four cells with same contents.


rng = _flex.GetCellRange(0, 5, 0, 8);
rng.Data = "South";
for ( i = 1 ; i <= 4; i++)
{
_flex[1, i] = "Qtr " + i;
_flex[1, i + 4] = "Qtr " + i;
}
// Create the column header.
_flex.Cols[0].AllowMerging = true;
// Merge the two cells with same contents.
rng = _flex.GetCellRange(0, 0, 1, 0);
rng.Data = "Sales by Product";
// Align and autosize the cells.
_flex.Styles.Fixed.TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.CenterCenter;
_flex.AutoSizeCols(1, _flex.Cols.Count - 1, 10);
}
This is the result:

Merged Data Views


Cell merging works the same way when the grid is bound to a data source. The code below shows
an example for a grid bound to a data source at design time. For more information on binding to a
data source, see Binding to a Data Source.
To write code in Visual Basic
Visual Basic

Copy Code

82

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Dim i%
' Set up cell merging.
_flex.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.RestrictCols
For i = _flex.Cols.Fixed To _flex.Cols.Count - 1
_flex.Cols(i).AllowMerging = True
Next
End Sub
To write code in C#
C#

Copy Code

private void Form1_Load( System.object sender,

System.EventArgs e)

{
int i;
// Set up cell merging.
_flex.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.RestrictCols;
for (int i = _flex.Cols.Fixed; i <= _flex.Cols.Count - 1; i++)
{
_flex.Cols(i).AllowMerging = true;
}
}
This is the result:

83

Notice how merging the cells has the effect of visually grouping the data and making the
information on the table easier to understand.
Note: For an example of displaying merged data views with C1FlexGrid, see the CellMerging
sample on ComponentOne HelpCentral.

Spilling Text
The AllowMerging property has two settings that operate differently from the others that do not
require you to set the AllowMerging property on specific rows and columns.

Spill Setting
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:

84

Nodes Setting
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 C1FlexGridBase.Subtotal method, and then AllowMerging is set to Nodes:

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

Custom Merging

Assign a custom IComparer class to the CustomComparer property.

85

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.

Write a new class that derives from the C1FlexGrid and override the GetMergedRange
virtual method, providing your own custom merging logic.
Note: For samples that show how to implement custom merging logic, see the
CustomMerge, CustomMerge2, CustomMerge3, and CustomMerge4 samples on
ComponentOne HelpCentral.

Outlining and Summarizing Data


The C1FlexGrid 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
C1FlexGrid.Subtotal method. To display hierarchical views of the data, use the Tree property.

See Also
Creating Subtotals
Creating Custom Trees
Creating Outlines and Trees with the C1FlexGrid Control
Outline Tree
Adding Subtotals
Using the Subtotal Method
Outline Maintenance
Using the Node class

Creating Subtotals
The C1FlexGrid.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:

86

To write code in Visual Basic


Visual Basic

Copy Code

Private Sub ShowTotals()


'

Show OutlineBar on column 0.

_flex.Tree.Column = 0
_flex.Tree.Style = TreeStyleFlags.Simple
'

Clear existing subtotals.

_flex.Subtotal(AggregateEnum.Clear)
'

Get a Grand total (use -1 instead of column index).

_flex.Subtotal(AggregateEnum.Sum, -1, -1, 3, "Grand Total")


'

Total per Product (column 0).

_flex.Subtotal(AggregateEnum.Sum, 0, 0, 3, "Total {0}")


'

Total per Region (column 1).

_flex.Subtotal(AggregateEnum.Sum, 1, 1, 3, "Total {0}")


'

Size column widths based on content.

_flex.AutoSizeCols()
End Sub
To write code in C#
C#

Copy Code

private void ShowTotals()


{
// Show OutlineBar on column 0.
_flex.Tree.Column = 0;
_flex.Tree.Style = TreeStyleFlags.Simple;
// Clear existing subtotals.

87

_flex.Subtotal(AggregateEnum.Clear);
// Get a Grand total (use -1 instead of column index).
_flex.Subtotal(AggregateEnum.Sum, -1, -1, 3, "Grand Total");
// Total per Product (column 0).
_flex.Subtotal(AggregateEnum.Sum, 0, 0, 3, "Total {0}");
// Total per Region (column 1).
_flex.Subtotal(AggregateEnum.Sum, 1, 1, 3, "Total {0}");
// Size column widths based on content.
_flex.AutoSizeCols();
}
When the C1FlexGrid.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 in
the designer with the Style Editor or with code. For example:
To write code in Visual Basic
Visual Basic

'

Copy Code

Set styles for subtotals.

Dim cs As C1.Win.C1FlexGrid.CellStyle
cs = _flex.Styles(C1.Win.C1FlexGrid.CellStyleEnum.GrandTotal)
cs.BackColor = Color.Black
cs.ForeColor = Color.White
cs.Font = New Font(Font, FontStyle.Bold)
cs = _flex.Styles(C1.Win.C1FlexGrid.CellStyleEnum.Subtotal0)
cs.BackColor = Color.DarkRed
cs.ForeColor = Color.White
cs.Font = New Font(Font, FontStyle.Bold)
cs = _flex.Styles(C1.Win.C1FlexGrid.CellStyleEnum.Subtotal1)
cs.BackColor = Color.DarkBlue
cs.ForeColor = Color.White

88

To write code in C#
C#

Copy Code

// Set styles for subtotals.


CellStyle cs;
cs = _flex.Styles[CellStyleEnum.GrandTotal];
cs.BackColor = Color.Black;
cs.ForeColor = Color.White;
cs.Font = new Font(Font, FontStyle.Bold);
cs = _flex.Styles[CellStyleEnum.Subtotal0];
cs.BackColor = Color.DarkRed;
cs.ForeColor = Color.White;
cs.Font = new Font(Font, FontStyle.Bold);
cs = _flex.Styles[CellStyleEnum.Subtotal1];
cs.BackColor = Color.DarkBlue;
cs.ForeColor = Color.White;
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 C1FlexGrid.Subtotal method. The

89

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 (for example, averages or percentages), and
calculate several aggregates for each row (for example, gross and net sales).
Subtotal rows created by the Subtotal method differ from regular rows in three aspects:
1.

2.

3.
4.

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.
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.
Subtotal rows can be treated as nodes in a tree. You can get a Node object for any subtotal
row through the Node property.
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.

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.

Creating Custom Trees


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

Add rows to the grid.


Turn some rows into outline nodes by setting their IsNode property to True.
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:


To write code in Visual Basic
Visual Basic

'

Copy Code

add these Imports statements at the top of the for.

Imports System.IO
Imports C1.Win.C1FlexGrid
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As

90

System.EventArgs) Handles MyBase.Load


'

Initialize grid layout.

_flex.Cols.Fixed = 0
_flex.Cols.Count = 1
_flex.Rows.Count = 1
_flex.ExtendLastCol = True
_flex.Styles.Normal.TextAlign = TextAlignEnum.LeftCenter
_flex.Styles.Normal.Border.Style = BorderStyleEnum.None
'

Show outline tree.

_flex.Tree.Column = 0
_flex.Tree.Style = TreeStyleFlags.SimpleLeaf
_flex.Tree.LineColor = Color.DarkBlue
'

Populate the grid.

AddDirectory("c:\", 0)
End Sub
To write code in C#
C#

Copy Code

// add these using statements at the top of the for.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using C1.Win.C1FlexGrid;
private void Form1_Load(object sender, EventArgs e)
{
// Initialize grid layout.

91

_flex.Cols.Fixed = 0;
_flex.Cols.Count = 1;
_flex.Rows.Count = 1;
_flex.ExtendLastCol = true;
_flex.Styles.Normal.TextAlign = TextAlignEnum.LeftCenter;
_flex.Styles.Normal.Border.Style = BorderStyleEnum.None;
// Initialize outline tree.
_flex.Tree.Column = 0;
_flex.Tree.Style = TreeStyleFlags.SimpleLeaf;
_flex.Tree.LineColor = Color.DarkBlue;
// Populate the grid.
AddDirectory(@"c:\\", 0);
}
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:
To write code in Visual Basic
Visual Basic

Copy Code

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
_flex.AddItem(thisDir)
'

Make this new row a node.

Dim row As Row


row = _flex.Rows(_flex.Rows.Count - 1)
row.IsNode = True
'

Set the node level.

Dim nd As Node
nd = row.Node

92

nd.Level = level
'

Add files in this directory.

Dim file As String, cnt As Integer, r As Row


cnt = 0
For Each file In Directory.GetFiles(dir)
_flex.AddItem(Path.GetFileName(file).ToLower())
r = _flex.Rows(_flex.Rows.Count 1)
r.IsNode = True
r.Node.Level = level + 1
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
To write code in C#
C#

Copy Code

private void AddDirectory(string dir, int level)


{
// add this director.
string thisDir = Path.GetFileName(dir);
if (thisDir.Length == 0) { thisDir = dir; }
_flex.AddItem(thisDir);
//make this new row a node
Row row = _flex.Rows[_flex.Rows.Count - 1];

93

row.IsNode = true;
//set node level
Node nd = row.Node;
nd.Level = level;
// add files in this director.
int cnt = 0;
Row r;
foreach (string file in Directory.GetFiles(dir))
{
_flex.AddItem(Path.GetFileName(file).ToLower());
//mark the row without child row as node
r = _flex.Rows[_flex.Rows.Count - 1];
r.IsNode = true;
r.Node.Level = level + 1;
cnt = cnt + 1;
if (cnt > 10) break;
}
// add subdirectories (up to level 4.
if (level <= 4)
{
cnt = 0;
foreach (string subdir in Directory.GetDirectories(dir))
{
AddDirectory(subdir, level + 1);
cnt = cnt + 1;
if (cnt > 10) break;
}
}
}
AddDirectory is a recursive routine that traverses the current directory and all its subdirectories. In
this example, 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 for WinForms Tutorials).
This code creates a grid that looks like this:

94

Creating Outlines and Trees with the C1FlexGrid Control


One of the unique and popular features of the C1FlexGrid control is the ability to add hierarchical
grouping to regular unstructured data.
To achieve this, the C1FlexGrid introduces the concept of Node rows. Node rows do not contain
regular data. Instead, they act as headers under which similar data is grouped, exactly like nodes in
a regular TreeView control. Like nodes in a TreeView control, node rows can be collapsed and
expanded, hiding or showing the data they contain. Also like nodes in a TreeView control, node
rows have a Level property that defines the node hierarchy. Lower level nodes contain higher level
nodes.
For example, suppose you had a grid showing customer name, country, city, and sales amounts.
This typical grid would normally look like this:

95

All the information is there, but it's hard to see the total sales for each country or customer. You
could use the C1FlexGrid's outlining features to group the data by country (level 0), then by city
within each country (level 1), then by customer within each city (level 2). Here is the same grid with
after adding the outline:

This grid shows the same information as the previous one (it is bound to the same data source), but
it adds a tree where each node contains a summary of the data below it. Nodes can be collapsed to
show only the summary, or expanded to show the detail. Note that each node row can show
summaries for more than one column (in this case, total units sold and total amount).
In this article, we will walk you through the process of turning a regular grid into a richer outline
grid.

See Also
Loading the Data

96

Loading the Data


Loading data into an outline grid is exactly the same as loading it into a regular grid. If your data
source is available at design time, you can use the Visual Studio Property Window to set the grid's
DataSource property and bind the grid to the data without writing any code.
If the data source is not available at design time, you can set the grid's DataSource property in
code. The data binding code typically looks like this:
To write code in C#
C#

Copy Code

public Form1()
{
InitializeComponent();
// get data
var fields = @"
Country,
City,
SalesPerson,
Quantity,
ExtendedPrice";
var sql = string.Format("SELECT {0} FROM Invoices ORDER BY {0}", fields);
var da = new OleDbDataAdapter(sql, GetConnectionString());
da.Fill(_dt);
// bind grid to data
this._flex.DataSource = _dt;
// format ExtendedPrice column
_flex.Cols["ExtendedPrice"].Format = "n2";
}
The code uses an OleDbDataAdapter to fill a DataTable with data, thenand then assigns the
DataTable to the grid's DataSource property.
After running this code, you would get the "regular grid" shown in the first image. To turn this
regular grid into the outline grid shown in the second image, we need to insert the node rows that
make up the outline.

97

See Also
Creating Node Rows

Creating Node Rows


Node rows are almost identical to regular rows, except for the following:

Node rows are not data bound. When the grid is bound to a data source, each regular row
corresponds to an item in the data source. Node rows do not. Instead, they exist to group
regular rows that contain similar data.
Node rows can be collapsed or expanded. When a node row is collapsed, all its data and
child nodes are hidden. If the outline tree is visible, users can collapse and expand nodes
using the mouse or the keyboard. If the outline tree is not visible, then nodes can only be
expanded or collapsed using code.

To determine whether a row is a node or not, you can use the IsNode property:
To write code in C#
C#

Copy Code

var row = _flex.Rows[rowIndex];


if (row.IsNode)
{
// row is a nod.
var node = row.Node;
DoSomethingWithTheNode(node);
}
else
{
// this row is not a nod.
}
Node rows can be created in three ways:
1.

2.

Use the Rows.InsertNode method. This will insert a new node row at a specified index.
Once the node row has been created, you can use it like you would any other row (set the
data for each column, apply styles, etc.). This is the 'low-level' way of inserting totals and
building outlines. It gives the most control and flexibility and is demonstrated below.
Use the C1FlexGrid.Subtotal method. This method scans the entire grid and automatically
inserts node rows with optional subtotals at locations where the grid data changes. This is
the 'high-level' way of inserting totals and building outlines. It requires very little code, but

98

3.

makes some assumptions about how the data is structured on the grid and what the
outline should look like.
If the grid is unbound, then you can turn regular rows into node rows by setting the IsNode
property to true. Note that this only works when the grid is unbound. Trying to turn a
regular data bound row into a node will cause the grid to throw an exception.

The code below shows how you could implement a GroupBy method that inserts node rows
grouping identical values on a given column.
To write code in C#
C#

Copy Code

// group on a given column inserting nodes of a given leve.


void GroupBy(string columnName, int level)
{
object current = null;
for (int r = _flex.Rows.Fixed; r < _flex.Rows.Count; r++)
{
if (!_flex.Rows[r].IsNode)
{
var value = _flex[r, columnName];
if (!object.Equals(value, current))
{
// value changed: insert nod.
_flex.Rows.InsertNode(r, level);
// show group name in first scrollable colum.
_flex[r, _flex.Cols.Fixed] = value;
// update current valu.
current = value;
}
}
}
}
The code scans all the columns, skipping existing node rows (so it can be called to add several
levels of nodes), and keeps track of the current value for the column being grouped on. When the
current value changes, a node row is inserted showing the new group name in the first scrollable
column.

99

Back to our example, you could use this method to create a two-level outline by calling:
To write code in C#
C#

Copy Code

void _btnGroupCountryCity_Click(object sender, EventArgs e)


{
GroupBy("Country", 0);
GroupBy("City", 1);
}
Very simple, but there are some caveats. First, the method assumes that the data is sorted
according to the outline structure. In this example, if the data were sorted by SalesPerson instead
of by Country, the outline would have several level-0 nodes for each country, which probably is not
what you want.
Also, the GroupBy method may insert may rows, which would cause the grid to flicker. To avoid
this, you would normally set the Redraw property to false before making the updates and set it
back to true when done.
To handle these issues, the code that creates the outline should be re-written as follows:
To write code in C#
C#

Copy Code

void _btnGroupCountryCity_Click(object sender, EventArgs e)


{
// suspend redrawing while updatin.
using (new DeferRefresh(_flex))
{
// restore original sort (by Country, City, etc..
ResetBinding();
// group by Country, Cit.
GroupBy("Country", 0);
GroupBy("City", 1);
}
}

100

The DeferRefresh class is a simple utility that sets the grid's Redraw property to false and restores
its original value when it is disposed. This ensures that Redraw is properly restored even when
exceptions happen during the updates. Here is the implementation of the DeferRefresh class:
To write code in C#
C#

Copy Code

// Utility class used to encapsulate grid lengthy operations in a Redraw block.


// This avoids flicker and ensures the Redraw property is reset properly in
case.
// an exception is thrown during the operation.
class DeferRefresh : IDisposable
{
C1FlexGrid _grid;
bool _redraw;
public DeferRefresh(C1FlexGrid grid)
{
_grid = grid;
_redraw = grid.Redraw;
grid.Redraw = false;
}
public void Dispose()
{
_grid.Redraw = _redraw;
}
}
The BindGrid method ensures that the grid is sorted in the order required by our outline structure.
In our example, the sort order is by Country, City, and SalesPerson. The code looks like this:
To write code in C#
C#

Copy Code

// unbind and re-bind grid in order to reset everythin.


void ResetBinding()
{
// unbind gri.

101

_flex.DataSource = null;
// reset any custom sortin.
_dt.DefaultView.Sort = string.Empty;
// re-bind gri.
_flex.DataSource = _dt;
// format ExtendedPrice colum.
_flex.Cols["ExtendedPrice"].Format = "n2";
// auto-size the columns to fit their conten.
_flex.AutoSizeCols();
}
If you run this code now, you will notice that the node rows are created as expected, but the outline
tree is not visible, so you can't expand and collapse the nodes. The outline tree is described in the
next section.

Outline Tree
The outline tree is very similar to the one you see in a regular TreeView control. It shows an
indented structure with collapse/expand icons next to each node row so the user can expand and
collapse the outline to see the desired level of detail.
The outline tree can be displayed in any column, defined by the Tree.Column property. By default,
this property is set to -1, which causes the tree not to be displayed at all. To show the outline tree
in the example given above, you would use this code:
To write code in C#
C#

Copy Code

void _btnTreeCountryCity_Click(object sender, EventArgs e)


{
using (new DeferRefresh(_flex))
{
// group by country and city as before
_btnGroupCountryCity_Click(this, EventArgs.Empty);
// show outline tree

102

_flex.Tree.Column = 0;
// autosize to accommodate tree
_flex.AutoSizeCol(_flex.Tree.Column);
// collapse detail nodes
_flex.Tree.Show(1);
}
}
The code calls the previous method to build the outline, thenand then sets the Tree.Column
property to zero in order to show the outline tree in the first column. It also calls the
C1FlexGrid.AutoSizeCol method to ensure that the column is wide enough to accommodate the
outline tree. Finally, it calls the Tree.Show method to display all level-0 nodes (cities in this case)
and hide all the detail.
The Tree property returns a reference to a GridTree object that exposes several methods and
properties used to customize the outline tree. The main ones are listed below:

Column: Gets or sets the index of the column that contains the outline tree. Setting this
property to -1 causes the outline tree to be hidden from the users.
Indent: Gets or sets the indent, in pixels, between adjacent node levels. Higher indent
levels cause the tree to become wider.
Style: Gets or sets the type of outline tree to display. Use this property to determine
whether the tree should include a button bar at the top to allow users to collapse/expand
the entire tree, whether lines and/or symbols should be displayed, and whether lines should
be displayed connecting the tree to data rows as well as node rows.
LineColor: Gets or sets the color of the tree's connecting lines.
LineStyle: Gets or sets the style of the tree's connecting lines.

For example, by changing the code above to include these two lines:
To write code in C#
C#

Copy Code

// show outline tree


_flex.Tree.Column = 0;
_flex.Tree.Style = TreeStyleFlags.CompleteLeaf;
_flex.Tree.LineColor = Color.White;
_flex.Tree.Indent = 30;
The outline tree would change as follows:

103

Notice the buttons labeled "1", "2", and "*" on the top left cell. Clicking these buttons would cause
the entire tree to collapse or expand to the corresponding level. Also notice the much wider
indentation and the lines connecting the tree to regular rows ("Anne Dodsworth") as well as to
node rows.

Adding Subtotals
So far we have covered the creation of node rows and outline trees. To make the outlines really
useful, however, the node rows should include summary information for the data they contain.
If you create an outline tree using the C1FlexGrid.Subtotal method, then the subtotals are added
automatically. This will be described in a later section.
If you created the outline tree using the Rows.InsertNode method as described above, then you
should use the C1FlexGrid.Aggregate method to calculate the subtotals for each group of rows and
insert the result directly into the node rows.
The C1FlexGrid.Subtotal method listed below shows how to do this:
To write code in C#
C#

Copy Code

// add subtotals to each node at a given level


void AddSubtotals(int level, string colName)
{
// get column we are going to total on
int colIndex = _flex.Cols.IndexOf(colName);
// scan rows looking for nodes at the right level
for (int r = _flex.Rows.Fixed; r < _flex.Rows.Count; r++)

104

{
if (_flex.Rows[r].IsNode)
{
var node = _flex.Rows[r].Node;
if (node.Level == level)
{
// found a node, calculate the sum of extended price
var range = node.GetCellRange();
var sum = _flex.Aggregate(AggregateEnum.Sum,
range.r1, colIndex, range.r2, colIndex,
AggregateFlags.ExcludeNodes);
// show the sum on the grid
// (will use the column format automatically)
_flex[r, colIndex] = sum;
}
}
}
}
The AddSubtotals method scans the grid rows looking for node rows. When a node row of the
desired level is found, the method uses the GetCellRange method to retrieve the node's child rows.
Then it uses the C1FlexGrid.Aggregate method to calculate the sum of the values on the target
column over the entire range. The call to Aggregate includes the ExcludeNodes flag to avoid
double-counting existing nodes. Once the subtotal has been calculated, it is assigned to the node
row's cell with the usual _flex[row, col] indexer.
Note that this does not affect the data source in any way, since node rows are not bound to the
data.
Note also that the method can be used to add multiple totals to each node row. In this example, we
will add totals for the Quantity and ExtendedPrice columns. In addition to sums, you could add
other aggregates such as average, maximum, minimum, etc.
We can now use this method to create a complete outline, with node rows, outline tree, and
subtotals:
To write code in C#
C#

Copy Code

105

void _btnTreeCountryCity_Click(object sender, EventArgs e)


{
using (new DeferRefresh(_flex))
{
// restore original sort (by Country, City, SalesPerson)
ResetBinding();
// group by Country, City
GroupBy("Country", 0); // group by country (level 0)
GroupBy("City", 1);

// group by city (level 1)

// add totals per Country, City


AddSubtotals(0, "ExtendedPrice");

// extended price per country (level

AddSubtotals(0, "Quantity");

// quantity per country (level 0)

AddSubtotals(1, "ExtendedPrice");

// extended price per city (level 1)

AddSubtotals(1, "Quantity");

// quantity per city (level 1)

0)

// show outline tree


_flex.Tree.Column = 0;
_flex.AutoSizeCol(_flex.Tree.Column);
_flex.Tree.Show(1);
}
}
If you run the project now, you will see a tree with node rows that show the total quantity and
amount sold for each country and city. This is very nice, but there is a little problem. If you expand
any of the node rows, you will see a lot of duplicate values. All rows under a given city node have
the same country and city:>

106

This is correct, but it is also a waste of screen real estate. Eliminating these duplicate values is easy;
all you have to do is set the Width of the columns that are being grouped on to zero. When you do
that, however, you should remember to set the grid's AllowMerging property to Nodes, so the text
assigned to the node rows will spill into the visible columns. (Another option would be to assign the
node text to the first visible column, but merging is usually a better solution because it allows you
to use longer text for the node rows).
Here is the revised code and the final result:
To write code in C#
C#

Copy Code

void _btnTreeCountryCity_Click(object sender, EventArgs e)


{
using (new DeferRefresh(_flex))
{
// restore original sort (by Country, City, SalesPerson)
ResetBinding();
// group by Country, City
GroupBy("Country", 0); // group by country (level 0)
GroupBy("City", 1);

// group by city (level 1)

107

// hide columns that we grouped on


// (they only have duplicate values which already appear on the tree
nodes)
// (but don't make them invisible, that would also hide the node text)
_flex.Cols["Country"].Width = 0;
_flex.Cols["City"].Width = 0;
// allow node content to spill onto next cell
_flex.AllowMerging = AllowMergingEnum.Nodes;
// add totals per Country, City
AddTotals(0, "ExtendedPrice");

// extended price per country (level 0)

AddTotals(0, "Quantity");

// quantity per country (level 0)

AddTotals(1, "ExtendedPrice");

// extended price per city (level 1)

AddTotals(1, "Quantity");

// quantity per city (level 1)

// show outline tree


_flex.Tree.Column = 0;
_flex.AutoSizeCol(_flex.Tree.Column);
_flex.Tree.Show(1);
}
}

108

The Country and City columns are now invisible, but their values still appear in the node rows.
Collapsing the tree shows totals for each country and city.

Using the Subtotal Method


We mentioned earlier that you could also create trees using the C1FlexGrid's C1FlexGrid.Subtotal
method. TheSubtotal method performs the same tasks as the GroupBy and AddSubtotals
methods described above, except it does both things in a single step and is therefore a little more
efficient.
The code below shows how you can use the Subtotal method to accomplish the same thing we did
before, only a little faster and without using any helper methods:
To write code in C#
C#

Copy Code

void _btnTreeCountryCity_Click(object sender, EventArgs e)


{
using (new DeferRefresh(_flex))
{
// restore original sort (by Country, City, SalesPerson)
ResetBinding();
// group and total by country and city
_flex.Subtotal(AggregateEnum.Sum, 0, "Country", "ExtendedPrice");
_flex.Subtotal(AggregateEnum.Sum, 0, "Country", "Quantity");
_flex.Subtotal(AggregateEnum.Sum, 1, "City", "ExtendedPrice");
_flex.Subtotal(AggregateEnum.Sum, 1, "City", "Quantity");
// hide columns that we grouped on
// (they only have duplicate values which already appear on the tree
nodes)
// (but don't make them invisible, that would also hide the node text)
_flex.Cols["Country"].Width = 0;
_flex.Cols["City"].Width = 0;
_flex.AllowMerging = AllowMergingEnum.Nodes;
// show outline tree
_flex.Tree.Column = 0;
_flex.AutoSizeCol(_flex.Tree.Column);

109

_flex.Tree.Show(1);
}
}
The Subtotal method is very convenient and flexible. It has a number of overloads that allow you to
specify which columns should be grouped on and totaled on by index or by name, whether to
include a caption in the node rows that it inserts, how to perform the grouping, and so on. The
summary below describes the overloads available:
1.

Subtotal(AggregateEnum aggType)
This version of the method takes only one aggregate type as a parameter. It is useful only
for removing existing subtotals before inserting new ones. In this case, the aggType
parameter is set to AggregateEnum.Clear.

2.

Subtotal(AggregateEnum aggType, int groupBy, int totalOn)


Subtotal(AggregateEnum aggType, string groupBy, string totalOn)
These are the most commonly used overloads. The parameters are the type of aggregate to
insert and the columns to group by and total on. The columns may be referenced by index
or by name. The latter is the one we used in the example above.

3.

Subtotal(AggregateEnum aggType, int groupBy, int totalOn, string caption)


Subtotal(AggregateEnum aggType, string groupBy, string totalOn, string caption)
These overloads add an extra caption parameter. The caption parameter determines the
text that is added to the new node rows to identify the value being grouped on. By default,
the value being grouped on is shown, so if you are grouping by country, the node rows
would show "Argentina", "Brazil", and so on. If you set the caption parameter to a string
such as "Country: {0}", then the node rows would show "Country: Argentina" instead.

4.

Subtotal(AggregateEnum aggType, int groupFrom, int groupTo, int totalOn, string


caption)
Subtotal(AggregateEnum aggType, string groupFrom, string groupTo, string totalOn,
string caption)
These overloads separate the groupBy parameter into two: groupFrom and groupTo. By
default, the Subtotal method inserts a node row whenever the value of the groupBy or any
previous column changes.
For example, if you a row has the same value in the "City" column as the previous row, but
a different value in the "Country" column, then the Subtotal method assumes the rows

110

should be in different groups and inserts a new node row even though the value of the
groupBy column is the same. These aggregates let you override that behavior and specify
the range of columns that should be considered when identifying a group.

Outline Maintenance
So far we have discussed how to create outlines with trees and totals using the high-level
C1FlexGrid.Subtotal method as well as lower-level Rows.InsertNode and Aggregate methods.
At this point, it is important to remember that the outline tree is created based on the data, but is
not bound to it in any way, and is not automatically maintained when there are changes to the grid
or to the data.
If the user modifies a value in the "ExtendedPrice" column, for example, the subtotals will not be
automatically updated. If the user sorts the grid, the data will be refreshed and the subtotals will
disappear.
There are two common ways to maintain the outlines:
1.

2.

Prevent the user from making any changes that would invalidate the outline. This is the
easiest option. You would set the grid's AllowEditing, AllowDragging, and AllowSorting
properties to false and prevent any changes that would affect the outline.
Update the outline when there are changes to the data or to the grid. You would attach
handlers to the grid's AfterDataRefresh, AfterSort, and AfterEdit events and re-generate the
outline appropriately.

Option 2 is usually more interesting since it provides a quick and simple tool for dynamic data
analysis. This approach is illustrated by the Analyze sample provided with the C1FlexGrid. The
sample creates an initial outline and allows users to reorder the columns. When the column order
changes, the sample automatically re-sorts the data and re-creates the outline. The user can easily
create simple reports showing sales by country, by product, by salesperson, and so on.

Using the Node class


The Node class provides a number of methods and properties that can be used to create and
manage outline trees. Many of these methods and properties are based on the standard TreeView
object model, so they should be familiar to most developers.
To obtain a Node object, you can either:
Use the return value of the Rows.InsertNode method:
var node = _flex.Rows.InsertNode(index, level);
Or you can retrieve the node for an existing row using the row's Node property:
var node = _flex.Rows[index].IsNode
? _flex.Rows[index].Node

111

: null;
Either way, once you have a Node object you can manipulate it using the following properties and
methods:

Level: Gets or sets the node level in the outline tree.


Data: Gets or sets the value in the cell defined by Node.Row and the Tree.Column.
Image: Gets or sets the image in the cell defined by Node.Row and the Tree.Column.
Checked: Gets or sets the check state of the cell defined by Node.Row and the
Tree.Column.
Collapsed/Expanded: Gets or sets the node's collapsed/expanded state.

You can also explore the outline structure using the following methods:

GetCellRange(): Gets a CellRange object that described the range of rows that belong to
this node.
Children: Gets the number of child nodes under this node.
Nodes: Gets a node array containing this node's child nodes.
GetNode: Gets the node that has a given relationship to this node (parent, first child, next
sibling, and so on).

The discussion above focused on bound scenarios, where the grid is attached to a data source that
provides the data. You can also create trees and outlines in unbound scenarios. Things are actually
somewhat simpler in this case, since you can turn any row into a node row by setting its IsNode
property to true.
If the grid is unbound, it owns all the data that is displayed, and you do things that are not possible
when a data source owns the data. For example, you can move nodes around the tree using the
Move method as shown by the TreeNode sample provided with the C1FlexGrid.
Using nodes in an unbound grid is very similar to using nodes in a regular TreeView control.

Saving, Loading, and Printing


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

See Also
Saving and Loading Grids to Text Files
Saving and Loading Microsoft Excel Files
Loading Grids from Databases
Printing Grids

112

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 (for example, commas, tabs, custom delimiters), whether to save the
fixed cells or only the scrollable cells, and the type of encoding to used (for example, 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).

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.

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:
To write code in Visual Basic

113

Visual Basic

Copy Code

Private Sub _btnData_Click(ByVal sender As Object, ByVal e As System.EventArgs)


Handles _btnData.Click
'

Prepare DataReader.

Dim strConn As String = "data source=MYMACHINE;initial catalog=Northwind;"


Dim myConn As New SqlClient.SqlConnection(strConn)
Dim myCMD As New SqlClient.SqlCommand("SELECT * FROM Employees", myConn)
myConn.Open()
Dim myReader As SqlClient.SqlDataReader = myCMD.ExecuteReader()
'

Build the grid structure from the 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 C1.Win.C1FlexGrid.Column = _flex.Cols.Add()


c.Caption =(c.Name <= CStr(dr("ColumnName")))
c.DataType = CType(dr("DataType"), Type)
Next dr
'

Populate the 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, 1)
End While
'

Cleanup.

_flex.AutoSizeCols()
myReader.Close()
myConn.Close()
End Sub

114

To write code in C#
C#

Copy Code

private void _btnData_Click(object sender, System.EventArgs e)


{
// Prepare DataReader.
string strConn = "data source=MYMACHINE;initial catalog=Northwind;";
System.Data.SqlClient.SqlConnection myConn = new
System.Data.SqlClient.SqlConnection(strConn);
System.Data.SqlClient.SqlCommand myCMD = new
System.Data.SqlClient.SqlCommand("SELECT * FROM Employees", myConn);
myConn.Open();
System.Data.SqlClient.SqlDataReader myReader = myCMD.ExecuteReader();
// Build the grid structure from the 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 the 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();

115

myReader.Close();
myConn.Close();
}

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 dialog boxes, set headers and
footers, and so on.
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, and so on.
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 window:
To write code in Visual Basic
Visual Basic

'

Copy Code

Get the grid's PrintDocument object.

Dim pd As Printing.PrintDocument
pd = _flex.PrintParameters.PrintDocument()
'

Set up the page (landscape, 1.5" left margin).

With pd.DefaultPageSettings
.Landscape = True
.Margins.Left = 150
End With
'

Set up the header and footer fonts.

_flex.PrintParameters.HeaderFont = New Font("Arial Black", 14, FontStyle.Bold)


_flex.PrintParameters.FooterFont = New Font("Arial Narrow", 8, FontStyle.Italic)
'

Preview the grid.

_flex.PrintGrid("C1FlexGrid", C1.Win.C1FlexGrid.PrintGridFlags.FitToPageWidth +
C1.Win.C1FlexGrid.PrintGridFlags.ShowPreviewDialog, "C1FlexGrid" + Chr(9) +
Chr(9) + Format(DateTime.Now, "d"), Chr(9) + Chr(9) + "Page {0} of {1}")

116

To write code in C#
C#

Copy Code

// Get the grid' s PrintDocument object.


System.Drawing.Printing.PrintDocument pd = _flex.PrintParameters.PrintDocument;
// Set up the page (landscape, 1.5" left margin).
pd.DefaultPageSettings.Landscape = true;
pd.DefaultPageSettings.Margins.Left = 150;
// Set up the header and footer fonts.
_flex.PrintParameters.HeaderFont = new Font("Arial Black", 14, FontStyle.Bold);
_flex.PrintParameters.FooterFont = new Font("Arial Narrow", 8,
FontStyle.Italic);
// Preview the grid.
_flex.PrintGrid("C1FlexGrid", PrintGridFlags.FitToPageWidth |
PrintGridFlags.ShowPreviewDialog, "C1FlexGrid\t\t" +
Microsoft.VisualBasic.Strings.Format(DateTime.Now, "d"), "\t\tPage {0} of {1}");

C1FlexGrid Filtering
Data filtering in grids usually comes in two flavors:

Header-based: A filter icon appears over each column that has a filter applied to it. Users
may see and edit the filters by clicking the filter icon. This is the mechanism used by
Windows 7/Vista and by the C1FlexGrid control. The main benefits of this type of filter are:
(1) the user can see which columns are being filtered, (2) the filtering does not require extra
real estate on the screen, and (3) this type of filter allows for better filter editors and easier
customization.
Filter Row: A filter row remains always visible and allows users to type values or
expressions directly into the row. The main benefit of this type of filter is that users can
always see which columns are being filtered and what the current filter criteria are. The
main disadvantage is that the filter takes up some real estate and may interfere with the
regular grid operation. Although filter rows are not built into the C1FlexGrid control,
implementing them is relatively easy. We provide a FilterRow sample that shows how to
do it.

117

The code samples presented below were mostly taken from two new samples included with the
product: ColumnFilters and CustomFilters. Please refer to the samples for complete projects that
show the features in action.

See Also
AllowFiltering property
Managing filters programmatically
Applying filters programmatically
Customizing filter behavior
Customizing the Filtering UI

AllowFiltering property
To implement the header-based filters, the C1FlexGrid control follows the same pattern used to
implement column moving and sizing. The grid has a new AllowFiltering property that controls
filtering at a control level, and the grid's Column object also has an AllowFiltering property that
controls filtering at the column level.
To enable simple filtering scenarios, users simply set the grid's AllowFiltering property to True. They
can then disable or customize the filtering behavior for specific columns by changing the value of
the column's AllowFiltering property. The column's AllowFiltering property may be set to one of the
following values:

Default: The grid automatically creates a filter of type ColumnFilter. This filter combines a
ValueFilter and a ConditionFilter, both described below.
ByValue: The grid automatically creates a filter of type ValueFilter. This filter contains a list
of values that should be displayed. Any values not present on the list are hidden from the
end user.
ByCondition: The grid automatically creates a filter of type ConditionFilter. This filter
specifies two conditions such as "greater than" or "contains". The conditions may be
combined with an AND or an OR operator.
Custom: The grid does not create a filter automatically. The developer is expected to
instantiate a filter and explicitly assign it to the column's Filter property.
None: The column cannot be filtered.

By default, the C1FlexGrid control localizes the column filter editor to use the language specified by
the CurrentUICulture setting. However, you can use the Language property to override the default
and specify the language that should be used when the grid displays the column filter editor.

Value Filter

118

The ValueFilter is conceptually very simple. It contains a list of values, and only the values listed are
displayed on the grid. If the list is set to null, the filter is de-activated and all values are displayed.
This type of filter is recommended for filtering columns that contain discrete values such as names
or enumerations.
The ValueFilter editor consists of a list of values with checkboxes. Users may check or uncheck all
values at once. Navigating long lists is easy with the advanced built-in keyboard navigation. The
editor implements a flexible search buffer that allows users to locate values by typing any part of
the value. For example, typing "Hilton" will select the next value that contains "Hilton", including
"New York Hilton", "Prince Edward Hilton", or "Paris Hilton". Also, typing ctrl+Up or ctrl+Down will
navigate to the next or previous checked item.
Values are displayed on the list using the Format currently assigned to the column.
This image shows the ValueFilter editor.

Condition Filter
The ConditionFilter is more flexible. Instead of selecting specific values, it allows users to specify up
to two conditions using operators such as "greater than", "starts with", or "contains". This type of
filter is recommended for filtering columns that contain "continuous" values such as numeric or
date/time values.
This image shows the ConditionFilter editor.

119

Columns that have filters applied display the filter icon on their headers even when the mouse is
not over them. You can see this in the images, where the ProductName and Quantity column
headers show the filter icon.
The built-in filters support automatic localization in the following languages: English, Spanish,
French, Italian, Portuguese, German, Dutch, Russian, Japanese, Greek, Danish, Finnish, Norwegian,
Swedish, Arabic, Polish, Chinese (Traditional: Tawain, Hong Kong, Macao; Simplified: PRC,
Singapore), Turkish, Persian (Farsi), Korean, and Hebrew. The localization is built-in and does not
require satellite dlls.

Custom Filters
Custom filters may be created to handle specialized values. For example, custom filters would be
recommended to filter on colors, geographic, or custom data types.
To create a custom filter, the developer must create two classes:

Filter: This class must implement the IC1ColumnFilter interface, which specifies methods
used to apply the filter to a specific value, to reset the filter, and to return an editor to be
used for viewing and editing the filter's parameters.
Filter Editor: This class must inherit from Control and must implement the
IC1ColumnFilterEditor interface, which specifies methods used to initialize the editor and to
apply changes to the filter.

120

The CustomFilters sample contains implementations of three custom filters used for filtering values
of type Color, DateTime, and string.

Managing filters programmatically


As we mentioned earlier in this document, setting the grid's AllowFiltering property to True is
enough to enable column filtering on all columns. In many cases however, you may want finer
control over filtering. This can be achieved by modifying the AllowFiltering and Filter properties on
individual columns.
For example, the code below enables filtering but restricts the filtering to columns of type string:
To write code in C#
C#

Copy Code

// bind and configure grid


_flex.DataSource = dtProducts;
_flex.Cols["UnitPrice"].Format = "#,###.00";
// enable filtering
_flex.AllowFiltering = true;
// restrict filtering to columns of type 'string'
foreach (Column c in _flex.Cols)
{
c.AllowFiltering = c.DataType == typeof(string)
? AllowFiltering.Default
: AllowFiltering.None;
}
You can customize the filtering process further by creating filters and assigning them to columns, or
by retrieving existing filters and modifying their properties. For example, the code below creates a
ConditionFilter, configures it to select all items that start with the letter "C", and then assigns the
new filter to the "ProductName" column:
To write code in C#
C#

Copy Code

// create a new ConditionFilter

121

var filter = new ConditionFilter();


// configure filter to select items that start with "C"
filter.Condition1.Operator = ConditionOperator.BeginsWith;
filter.Condition1.Parameter = "C";
// assign new filter to column "ProductName"
_flexCustom.Cols["ProductName"].Filter = filter;

Applying filters programmatically


Filters are applied when the user edits them, and also when they are applied to a column. They are
not automatically applied when the data changes. To apply the filters to the data currently loaded
on the grid, call the grid's ApplyFilters method.
For example, the code below enables an ApplyFilter button when the user edits the data on the
grid. Clicking the ApplyFilter button applies the filter and disables the button until the next
change.
To write code in C#
C#

Copy Code

public Form1()
{
InitializeComponent();
// get some data
var da = new OleDbDataAdapter("select * from products",
GetConnectionString());
var dtProducts = new DataTable();
da.Fill(dtProducts);
// bind the grid to the data
_flex.DataSource = dtProducts;
// enable filtering
_flex.AllowFiltering = true;

122

// monitor changes to enable ApplyFilter button


_flex.AfterEdit += _flex_AfterEdit;
}
The code above binds the grid to a data source, enables filtering by setting the AllowFiltering
property to True, and connects an event handler to the AfterEdit event. The event handler
implementation follows:
To write code in C#
C#

Copy Code

void _flex_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)


{
foreach (C1.Win.C1FlexGrid.Column c in _flex.Cols)
{
if (c.ActiveFilter != null)
{
_btnApplyFilters.Enabled = true;
break;
}
}
}
This code scans all columns to determine whether a filter is defined for any column. If an active
filter is detected, the code enables the button that applies the filter to the current data. When the
button is clicked, the following event handler executes:
To write code in C#
C#

Copy Code

private void _btnApplyFilters_Click(object sender, EventArgs e)


{
_flex.ApplyFilters();
_btnApplyFilters.Enabled = false;
}
The code simply applies all the active filters and disables the button until the next change.

123

If instead of requiring a button click you simply wanted to apply the filter after every edit, you could
call the ApplyFilter directly from the AfterEdit event handler, as shown below:
To write code in C#
C#

Copy Code

void _flex_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)


{
_flex.ApplyFilters();
}

Customizing filter behavior


When filters are applied, the grid hides rows by setting their Visible property to False. But the grid
also fires BeforeFilter and AfterFilter events that allow you to customize the filtering behavior. For
example, assume that instead of showing and hiding rows you wanted to apply different styles to
indicate whether the the rows pass the filter or not. This can be accomplished easily using this code:
To write code in C#
C#

Copy Code

public Form1()
{
InitializeComponent();
// configure grid
_flex.AllowFiltering = true;
_flex.DataSource = dtInvoices;
// create style for rows excluded by the filter
var cs = _flexStyles.Styles.Add("filteredOut");
cs.BackColor = Color.LightSalmon;
cs.ForeColor = Color.DarkOrange;
// connect handlers for the before and after filter events
_flex.BeforeFilter += _flex_BeforeFilter;

124

_flex.AfterFilter += _flex_AfterFilter;
}
The code creates a custom style that will be used to show rows that did not pass the filter (instead
of making them invisible). Next, the code attaches handlers for the BeforeFilter and AfterFilter
events. The event handlers are listed below:
To write code in C#
C#

Copy Code

// suspend painting before filter is applied


void _flex_BeforeFilter(object sender, CancelEventArgs e)
{
_flexStyles.BeginUpdate();
}
// apply styles after the filter has been applied
void _flexStyles_AfterFilter(object sender, EventArgs e)
{
// get style used to show filtered out rows
var cs = _flex.Styles["filteredOut"];
// apply style to all rows
for (int r = _flexStyles.Rows.Fixed; r < _flexStyles.Rows.Count; r++)
{
var row = _flexStyles.Rows[r];
if (row.Visible)
{
// normal row, reset style
row.Style = null;
}
else
{
// filtered row, make visible and apply style
row.Visible = true;
row.Style = cs;
}
}

125

// resume updates
_flexStyles.EndUpdate();
}
The BeforeFilter event handler calls the new BeginUpdate method to prevent the grid from
repainting itself until we are done applying the custom style to the rows that are filtered out. The
BeginUpdate and EndUpdate methods replace the Redraw property which has been deprecated.
The AfterFilter event handler starts by retrieving the style we created to show the rows that have
been filtered out. It then scans the rows on the grid and applies the new style to all rows that have
the Visible property set to False. These are the rows that were hidden by the filter. Once this is
done, the code calls EndUpdate to restore grid updating.

Customizing the Filtering UI


We believe the default filtering behavior and UI will address the vast majority of scenarios that
involve column filtering. However, you can use the column filter classes independently,
implementing your own custom user interface.
For example, the code below shows how you can use the ConditionFilter class to implement an
iTunes-style search box for the C1FlexGrid. This type of search allows users to type in a value and
automatically filters the grid rows to show the rows that contain the search string in any column.
To implement the iTunes-style search, we start with a text box that contains the text that will be
used as a filter parameter. We also define a timer that will apply the filter a few milliseconds after
the users stops typing into the text box:
To write code in C#
C#

Copy Code

public Form1()
{
InitializeComponent();
// configure timer to apply the filter 1/2 second after the
// user stops typing into the search box
_timer.Interval = 500;
_timer.Tick += t_Tick;
// monitor changes to the search box

126

_txtSearch.TextChanged += _txtSearch_TextChanged;
}
// re-start timer when the text in the search box changes
void _txtSearch_TextChanged(object sender, EventArgs e)
{
_timer.Stop();
_timer.Start();
}
Now that the timer is configured, all we need to do is create and apply the filter when the timer
ticks:
To write code in C#
C#

Copy Code

// apply filter when the timer ticks


void t_Tick(object sender, EventArgs e)
{
// done for now...
_timer.Stop();
// configure filter
var filter = new C1.Win.C1FlexGrid.ConditionFilter();
filter.Condition1.Operator = C1.Win.C1FlexGrid.ConditionOperator.Contains;
filter.Condition1.Parameter = _txtSearch.Text;
// apply filter
_flex.BeginUpdate();
for (int r = _flex.Rows.Fixed; r < _flex.Rows.Count; r++)
{
bool visible = false;
for (int c = _flex.Cols.Fixed; c < _flex.Cols.Count; c++)
{
if (filter.Apply(_flex[r, c]))
{
visible = true;
break;

127

}
}
_flex.Rows[r].Visible = visible;
}
_flex.EndUpdate();
}

C1FlexGrid 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. Select specific elements below for more
details.
1.

Grid Layout
Rows, Cols, AutoSizeCols, ScrollBars

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, ShowScrollTip

128

6.

Outlining and Summarizing


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

7.

Merging Cells
AllowMerging

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
11. Filtering

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 for WinForms
components such as C1ExpressTable, C1ExpressView, 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.

129

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 on ComponentOne HelpCentral
For details about creating ADO.NET data source objects, please refer to the .NET Framework
documentation.
For details about using ComponentOne DataObjects for WinForms, see the ComponentOne
DataObjects for WinForms documentation included in ComponentOne Studio Enterprise and
ComponentOne Studio for WinForms.

See Also
Binding to a Data Source
Storing and Retrieving Data

Binding to a Data Source


Without writing a line of code, you can easily bind C1FlexGrid to a data source using the Data
Source Configuration Wizard in Visual Studio. There are two ways to access the wizard, either
through the DataSource property in the Properties window or the Choose Data Source box in the
C1FlexGrid Tasks menu. For more information on the C1FlexGrid Tasks menu, see C1FlexGrid
Tasks Menu.
Clicking the drop-down arrow next to either the DataSource property in the Properties window or
the Choose Data Source box in the C1FlexGrid Tasks menu allows you to select from a list of
available data sources or to add a data source to your project. To add a data source to your project,
click Add Project Data Source to open the Data Source Configuration Wizard.

130

The Data Source Configuration Wizard walks you through adding a data source step by step. The
Choose a Data Source Type page allows you to choose which type of application you would like to
gather information from. The default selection is Database.
On the Choose Your Data Connection page, you can specify the location of the database. If you
have not already connected to the database, you can specify a new connection by clicking the New
Connection button. Clicking the New Connection button opens the Add Connection dialog box
where you can browse to the location of your database and test the connection.
Mobile device users click here for additional information.
If you are using the Mobile edition of ComponentOne FlexGrid for WinForms, in the Add
Connection dialog box, change the Data source to one that is supported by the Compact
Framework, such as the .NET Framework Data Provider for SQL Server Mobile Edition.

131

Then you can use a supported database, for example, a SQL Server Mobile Edition Database.
Microsoft provides a Northwind.sdf, by default, in the C:\Program Files\Microsoft Visual Studio
8\SmartDevices\SDK\SQL Server\Mobile\v3.0 folder for Microsoft Visual Studio 2005.
The wizard saves and names your connection on the Save the Connection String to the
Application Configuration File page. On this page you can specify a name or use the default
provided by the wizard.
On the Choose Your Database Objects page you can specify which tables and fields you want to
include in your DataSet. You can also provide a name for your DataSet or use the default provided
by the wizard.

132

The wizard creates the DataSet, BindingSource, and TableAdapter, and adds them to your project.
Click the drop-down arrow again next to the DataSource property or the Choose Data Source box
in the C1FlexGrid Tasks menu and then select the data source. If you double-click the form, you
will also notice that the code to fill the database is automatically generated in the Form_Load
event.

Storing and Retrieving Data


The C1FlexGrid control 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:
To write code in Visual Basic
Visual Basic

Copy Code

133

Row[2].Selected = True
To write code in C#
C#

Copy Code

Row[2].Selected = true;
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:
To write code in Visual Basic
Visual Basic

Copy Code

Dim r As Integer
For r = _flex.Rows.Fixed To _flex.Rows.Count - 1
_flex(r, 0) = r
Next
To write code in C#
C#

Copy Code

for (int r = _flex.Rows.Fixed; r <= _flex.Rows.Count - 1; r++)


{
_flex[r, 0] = r;
}
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.

134

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.

FlexGrid for WinForms Samples


Please be advised that this ComponentOne software tool is accompanied by various sample
projects and/or demos which may make use of other development tools included with the
ComponentOne Studios.
Samples can be accessed from the ComponentOne Sample Explorer. To view samples, on the
desktop, click the Start button and then click All Programs | ComponentOne | Studio for
WinForms | Samples | FlexGrid Samples.
Click one of the following links to view a list of C1FlexGrid samples:
Visual Basic Samples
Sample

Description

AutoSizeEdit

This sample demonstrates resizing the editor while the user types. This
sample uses the C1FlexGrid control.

BarChart

This sample uses OwnerDrawn cells to build a chart based on the grid
data. This sample uses the C1FlexGrid control.

Blinker

This sample shows how you can use CellStyles to make cells blink. The
sample creates a custom style and uses a timer to change the foregound
color on that style. This causes all cells that have that style to blink.This
sample uses the C1FlexGrid control.

BoundDelete

This sample deletes rows from a bound FlexGrid. This sample uses the
C1FlexGrid control.

BoundFinishEdit

This sample demonstrates how to commit changes to a DataRow after


editing. This sample uses the C1FlexGrid control.

135

Sample

Description

BoundImage

This sample shows how to bind the grid to image fields stored as OLE
objects. This sample uses the C1FlexGrid control.

C1FlexGridPrintable

This sample provides a printable (via C1Preview) C1FlexGrid control. This


sample uses the C1FlexGrid control and calls the C1.C1Preview
namespace.

CellBorders

This sample uses OwnerDraw to provide custom cell borders. This sample
uses the C1FlexGrid control.

CellDataType

This sample assigns cell types (and editors) on a per-cell basis. This
sample uses the C1FlexGrid control.

CellMerging

This sample shows various types of cell-merging in a C1FlexGrid control.


This sample uses the C1FlexGrid control.

CellNotes

This sample attaches notes to cells on a C1FlexGrid and implements Excelstyle cell notes using two classes: CellNote and CellNoteManager.

ColumnEditor

This sample exposes the C1FlexGrid design-time column editor in your


controls. This sample uses the C1FlexGrid control.

CustomDataMap

This sample demonstrates how to customize the options in drop-down


lists when using DataMaps. This sample uses the C1FlexGrid control.

CustomEditor

This sample shows how to implement your own cell editor. This sample
uses the C1FlexGrid control.

CustomMerge

This sample shows how to implement your own merging logic to create a
TV-guide display. This sample calls the C1.Win.C1FlexGrid namespace.

CustomMerge2

This sample shows how to implement your own merging logic to mix
merging modes. This sample calls the C1.Win.C1FlexGrid namespace.

136

Sample

Description

CustomMerge3

This sample shows how to customize grouping by overriding the GetData


method. This sample calls the C1.Win.C1FlexGrid namespace.

CustomMerge4

This sample shows how to customize grouping by overriding the GetData


method. This sample calls the C1.Win.C1FlexGrid namespace.

CustomPrint

This sample uses the CreateImage method to print grids with arbitrary
row and column breaks. This sample uses the C1FlexGrid control.

CustomTree

This sample uses the C1FlexGrid control to build a tree. This sample uses
the C1FlexGrid control.

DataIndex

This sample uses the Row.DataIndex property to get the underlying data
row. This sample uses the C1FlexGrid control.

DataMap

This sample uses data-mapped columns when bound to a data source.


This sample uses the C1FlexGrid control.

DataReader

This sample populates a grid from a DataReader. This sample uses the
C1FlexGrid control.

DataTable

This sample shows how you can create, populate, and bind a DataTable
object to the grid (including add/remove rows). This sample uses the
C1FlexGrid control.

DataTree

This sample binds the grid to a hierarchical data source and show details
in child grids.

DBDynamicStyles

This sample assigns styles to grid cells based on their contents. This
sample uses the C1FlexGrid control.

DBImageField

This sample shows images stored in a DataTable. This sample uses the
C1FlexGrid control.

137

Sample

Description

DBSchemaChange

This sample shows how to test grid response to changes in the data
source object. This sample uses the C1FlexGrid control.

DBTree

This sample shows how to display bound data in a hierarchical tree view.
This sample uses the C1FlexGrid control.

DragDrop

This sample shows how to customize automatic Drag & Drop. This sample
uses the C1FlexGrid control.

DragDropManual

This sample shows how to implement manual OleDragDrop between


controls and within the grid.

DragRow

This sample shows how to drag rows between grids. This sample uses the
C1FlexGrid control.

DynamicStyles

This sample shows how to assign styles to a cell based on the contents of
another cell. This sample uses the C1FlexGrid control.

Editing

This sample demonstrates how to edit cells using textboxes, lists, masks,
and checkboxes. This sample uses the C1FlexGrid control.

FilterRow_With_Totals

This sample shows a how to add totals to a bound grid with a FilterRow.

FlexByRow

This sample sets up a grid in 'transposed' format. In this sample data


types, edit masks, formats, and other properties usually assigned to grid
columns are assigned to grid rows. This sample uses the C1FlexGrid
control.

FlexGroup

This sample shows how you can implement Outlook-style grouping and
filtering using the C1FlexGrid. This sample uses the C1FlexGrid control.

FreezeBottom

This sample demonstrates how to show frozen rows at the bottom of a


grid. This sample uses the C1FlexGrid control.

138

Sample

Description

GridChart

This samples show how you can attach a FlexGrid to a C1Chart control.
This sample uses the C1FlexGrid and C1Chart controls.

HierData

This sample shows how you can bind to hierarchical data sources (masterdetail style). This sample uses the C1FlexGrid control.

Hyperlink

This sample shows how you can add hyperlinks to cells in the C1FlexGrid.
This sample uses the C1FlexGrid control.

LoadSpeed

This sample shows three techinques for loading data into a C1FlexGrid.

MapAndGroup

This sample shows grouping and sorting behavior when using datamapped columns. This sample uses the C1FlexGrid control.

MergeStyles

This sample merges CellStyles assigned to rows, columns, and cells. This
sample uses the C1FlexGrid control.

MultiColumnDictionary

This sample uses the MultiColumnDictionary class to implement multicolumn drop-downs.

Outline

This sample shows how to hide repeated data in an outline. This sample
uses the C1FlexGrid control.

PdfExportVB

This sample uses C1Pdf method to export C1FlexGrids to PDF files.

ProductTree

This sample demonstrates how to build a custom tree with product


information. This sample uses the C1FlexGrid control.

RTFGrid

This sample shows how to display RTF text in grid cells. This sample uses
the C1FlexGrid control.

ScrollPosition

This sample shows how the ScrollPosition property works. This sample
uses the C1FlexGrid control.

139

Sample

Description

SelectionMode

This sample shows the effect of the SelectionMode property. This sample
uses the C1FlexGrid control.

Sorting

This sample shows several sorting techniques. This sample uses the
C1FlexGrid control.

Splits

This sample demonstrates how to split a C1FlexGrid into multiple views.


This sample uses the C1FlexGrid control.

StartEditing

This sample implements a grid that stays in cell-editing mode. This sample
uses the C1FlexGrid control.

Styles

This sample shows how you can use Styles to customize the appearance
of the C1FlexGrid. This sample uses the C1FlexGrid control.

Subtotals

This sample creates subtotals for multiple columns. This sample uses the
C1FlexGrid control.

Transpose

This sample shows how to transpose data in a grid. This sample uses the
C1FlexGrid control.

TreeCheck

This sample shows how to add checkboxes to a grid tree. This sample
uses the C1FlexGrid control.

TreeNode

This sample shows how to manage an outline tree using the C1FlexGrid
Node objects. This sample uses the C1FlexGrid control.

Validate

This sample shows how to use the ErrorProvider control with the
C1FlexGrid. This sample uses the C1FlexGrid control.

ZoomCell

This sample shows how to zoom in on the selected cell.

C# Samples

140

Sample

Description

AcceleratorCaption

This sample shows how to add accelerator keys to grid captions.

Analyze

This sample shows how to provide dynamic data sorting and grouping.
This sample uses the C1FlexGrid control.

AnimagedGif

This sample shows how to display animated gifs in grid cells.

AutoComplete

This sample shows how to complete entries while the user types.

AutoSizeEdit

This sample shows how to resize the editor while the user types. This
sample uses the C1FlexGrid control.

BarChart

This sample shows how to draw bar charts using the grid cells. This
sample uses the C1FlexGrid control.

Blinker

This sample shows how to use CellStyles to make cells blink.

BoundDelete

This sample shows how to delete rows from a bound FlexGrid. This sample
uses the C1FlexGrid control.

BoundFinishEdit

This sample shows how to commit changes to a DataRow after editing.


This sample uses the C1FlexGrid control.

BoundImageMap

This sample shows how to use the ImageMap property with a data-bound
grid. This sample uses the C1FlexGrid control.

C1FlexGridPrintable

This sample provides a printable (via C1Preview) C1FlexGrid control. This


sample uses the C1FlexGrid control and calls the C1.C1Preview
namespace.

CellBorders

This sample shows how to use OwnerDraw to provide custom cell borders.
This sample uses the C1FlexGrid control.

141

Sample

Description

CellDataType

This sample shows how to assign cell types (and editors) on a per-cell
basis. This sample uses the C1FlexGrid control.

CellLabelDelay

This sample shows how to show cell labels after a specified interval.

CellNotes

This sample attaches notes to cells on a C1FlexGrid and implements Excelstyle cell notes using two classes: CellNote and CellNoteManager.

Classic

This sample shows a grid that derives from C1FlexGrid and provides an

(C1FlexGridClassic)

object model compatible with the VSFlexGrid control.

ColumnEditor

This sample shows how to expose the FlexGrid design-time column editor
in your controls. This sample uses the C1FlexGrid control.

ColumnFilters

This sample shows how to use the filtering feature in C1FlexGrid 2010.
The sample shows how you can control and customize the grid's built-in
filters using the AllowFiltering property and the AfterFilter event.

ColumnOrder

This sample shows how to position columns dynamically. This sample uses
the C1FlexGrid control.

ColumnWidthTip

This sample shows how to show a ToolTip while the user resizes columns.

CrossTabs

This sample shows how to summarize and cross-reference data using


PivotTables.

CustomData

This sample shows how to implement a custom data source object. This
sample uses the C1FlexGrid control.

CustomDataMap

This sample shows how to customize the options in drop-down lists when
using DataMaps. This sample uses the C1FlexGrid control.

CustomEditor

This sample shows how to implement your own cell editor. This sample

142

Sample

Description
uses the C1FlexGrid control.

CustomEditors

This sample shows how to use built-in, .NET, and custom edit controls
with the C1FlexGrid.

CustomFilters

This sample shows how to implement custom filters for the C1FlexGrid.

CustomMerge

This sample shows how to implement your own merging logic to create a
TV-guide display. This sample calls the C1.Win.C1FlexGrid namespace.

CustomMerge2

This sample shows how to implement your own merging logic to mix
merging modes. This sample calls the C1.Win.C1FlexGrid namespace.

CustomMerge3

This sample shows how to customize grouping by overriding the GetData


method. This sample calls the C1.Win.C1FlexGrid namespace.

CustomMerge4

This sample shows how to customize grouping by overriding the GetData


method. This sample calls the C1.Win.C1FlexGrid namespace.

CustomPrint

This sample shows how to use the CreateImage method to print grids
with arbitrary row and column breaks. This sample uses the C1FlexGrid
control.

CustomPrintMultiGrid

This sample shows how to use the CreateImage method to print multiple
grids in a single document.

CustomSelection

This sample uses OwnerDraw to implement custom (non-rectangular)


selection. This sample calls the C1.Win.C1FlexGrid namespace.

CustomSort

This sample shows how to implement your own sorting logic with a
custom IComparer object. This sample uses the C1FlexGrid control.

DataIndex

This sample shows how to use the Row.DataIndex property to get the

143

Sample

Description
underlying data row. This sample uses the C1FlexGrid control.

DataTable

This sample shows how to bind to a DataTable, add and remove rows.
This sample uses the C1FlexGrid control.

DataTree

This sample shows how to bind the grid to a hierarchical data source and
show details in child grids. This sample calls the C1.Win.C1FlexGrid
namespace.

DBDynamicStyles

This sample shows how to assign styles to grid cells based on their
contents. This sample uses the C1FlexGrid control.

DBImageField

This sample demonstrates how to show images stored in a DataTable. This


sample uses the C1FlexGrid control.

DBImages

This sample shows how to bind the grid to a data base with image fields
stored as OLE objects. This sample uses the C1FlexGrid control.

DBSchemaChange

This sample shows how to test grid response to changes in the data
source object. This sample uses the C1FlexGrid control.

DBTree

This sample shows how to display bound data in a hierarchical tree view.
This sample uses the C1FlexGrid control.

DBUpdate

This sample shows how to save changes to the underlying database. This
sample uses the C1FlexGrid control.

DragDrop

This sample shows how to customize automatic Drag & Drop This sample
uses the C1FlexGrid control.

DragImages

This sample shows how to customize Ole Drag and Drop to use cell
images.

144

Sample

Description

DragMerged

This sample shows how to drag groups of merged columns. This sample
uses the C1FlexGrid control.

DragRow

This sample shows how to drag rows between grids. This sample uses the
C1FlexGrid control.

DynamicStyles

This sample shows how to assign styles to a cell based on the contents of
another cell. This sample uses the C1FlexGrid control.

ErrorInfo

This sample demonstrates how to show error information on the grid.

Excel

This sample shows how to load and save Microsoft Excel files (.xls).

ExcelStyleFilter

This sample adds a context-menu that allows sorting and filtering data.

FilterRow

This sample shows how to implement a FilterRow on a FlexGrid control.


This sample uses the C1FlexGrid control.

FindRow

This sample shows how to how to find a row in the underlying datasource.
This sample uses the C1FlexGrid control.

FlexByRow

This sample shows how to set up a grid in 'transposed' format. This


sample uses the C1FlexGrid control.

FlexGroup

This sample shows how to implement Outlook-style grouping using the


C1FlexGrid. This sample uses the C1FlexGrid control.

FlexHierarchical

This sample shows how to implement hierarchical data binding using the
C1FlexGrid. This sample calls the C1.Win.C1FlexGrid namespace.

FreezeBottom

This sample demonstrates how to show frozen rows at the bottom of a


grid. This sample uses the C1FlexGrid control.

145

Sample

Description

GridChart

This sample shows how to attach a FlexGrid to a C1Chart control. This


sample uses the C1FlexGrid and C1Chart controls.

HierData

This sample shows how to bind to hierarchical data sources (master-detail


style). This sample uses the C1FlexGrid control.

HierData2

This sample shows how to bind to hierarchical data sources (master-detail


style).

HostControls

This sample shows how to host controls in grid cells. This sample uses the
C1FlexGrid control.

Hyperlink

This sample shows how to add hyperlinks to cells in the FlexGrid. This
sample uses the C1FlexGrid control.

LegacyDates

This sample shows how to use an unbound column to convert dates


stored as strings into real dates.

LockedColumns

This sample shows how to prevent the user from selecting certain
columns.

MasterDetail

This sample shows how to create and bind master-detail DataSets in code.
This sample calls the C1.Win.C1FlexGrid namespace.

MergeStyles

This sample shows how to merge CellStyles assigned to rows, columns,


and cells. This sample uses the C1FlexGrid control.

MultiColumnDictionary

This sample shows how to use the MultiColumnDictionary class to


implement multi-column drop-downs.

MultiParent

This sample shows how to create a complex master-detail display.

MultiSelection

This sample shows how to implement multi-range selection.

146

Sample

Description

NewFeatures20091

This sample shows the new features that were added for the V1/2009
release.

NewRowTemplate

This sample shows how to place a new row template above the grid.

Outline

This sample shows how to hide repeated data in an outline. This sample
uses the C1FlexGrid control.

OwnerDraw

This sample shows how to autosize Owner-Drawn cells.

OwnerDrawAlpha

This sample shows how to use OwnerDraw with transparency to get


MediaPlayer-like effects.

PasswordChar

This sample shows how to use the C1FlexGrid to enter and edit
passwords. This sample uses the C1FlexGrid control.

PdfExport

This sample shows how to use the C1Pdf method to export C1FlexGrids to
PDF files.

RowStateDisplay

This sample shows how to use different styles to display DataRows in


different states. This sample uses the C1FlexGrid control.

RTFGrid

This sample shows how to display RTF text in grid cells. This sample uses
the C1FlexGrid control.

ScrollPosition

This sample shows how to shows how the ScrollPosition property works.
This sample uses the C1FlexGrid control.

SelectionMode

This sample shows how to shows the effect of the SelectionMode


property. This sample uses the C1FlexGrid control.

SetupEditor

This sample shows how to use the SetupEditor event to customize the
grid editors. This sample uses the C1FlexGrid control.

147

Sample

Description

SimpleCalc

This sample uses the DataTable.Compute method to evaluate expressions


in grid cells and displays the results using OwnerDraw.

Sorting

This sample shows how to shows several sorting techniques. This sample
uses the C1FlexGrid control.

SortNulls

This sample shows how to use a custom sort to place null values at the
bottom of the grid.

Splits

This sample shows how to split a C1FlexGrid into multiple views. This
sample uses the C1FlexGrid control.

SqlBuilder

This sample shows how to a grid-based graphical interface for creating


SQL statements.

StartEditing

This sample shows how to implement a grid that stays in cell-editing


mode. This sample uses the C1FlexGrid control.

Subtotals

This sample shows how to create subtotals for multiple columns. This
sample uses the C1FlexGrid control.

Themes

This sample shows how to change the appearance of the grid to achieve
one of several pre-defined looks.

ThreadedUpdate

This sample shows how to update the grid from a different thread.

TreeCheck

This sample shows how to add checkboxes to a grid tree. This sample uses
the C1FlexGrid control.

TreeNode

This sample shows how to manage an outline tree using the FlexGrid
Node objects. This sample uses the C1FlexGrid control.

TriStateBound

This sample shows how to provide three-state (grayable) values in

148

Sample

Description
Boolean columns. This sample calls the C1.Win.C1FlexGrid namespace.

UnboundColumns

This sample shows how to additional support for unbound columns.

ZoomCell

This sample shows how to zoom in on the selected cell.

ComponentOne FlexGrid for Mobile Devices Visual Basic Samples


Sample

Description

Analyze

This sample shows how to provide dynamic data sorting and grouping.
This sample uses the C1FlexGrid control.

BarChart

This sample shows how to draw bar charts using the grid cells. This
sample uses the C1FlexGrid control.

EditData

This sample demonstrates how to show different types of built-in editors


and dynamic formatting. This sample uses the C1FlexGrid control.

ThreadedUpdate

This sample shows how to update the grid from a different thread.

ComponentOne FlexGrid for Mobile Devices C# Samples


Sample

Description

Analyze

This sample shows how to provide dynamic data sorting and grouping.
This sample uses the C1FlexGrid control.

BarChart

This sample shows how to draw bar charts using the grid cells. This
sample uses the C1FlexGrid control.

ContextMenu

This sample demonstrates how to show a ContextMenu after selecting an


item on the grid.

149

Sample

Description

DataTree

This sample demonstrates how to show hierarchical data in a drill-down


grid.

EditData

This sample demonstrates how to show different types of built-in editors


and dynamic formatting.

MasterDetail

This sample demonstrates how to show hierarchial data using two grids.

TransparentImages

This sample shows how to render images with transparency.

FlexGrid for WinForms 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:
Tutorial

Description

Edit Tutorial

Starting with a basic data-entry grid, this tutorial shows


how to implement data formatting, check boxes, dropdown lists, input masks, data validation, and clipboard
support.

Outline

Shows how you can use the C1FlexGrid as an outliner to

Tutorial

display structured (or hierarchical) data.

Data Analysis

Starting with a grid containing sales data for different

Tutorial

products, regions, and salespeople, this tutorial show


how to implement dynamic layout (column order),
automatic sorting, cell merging, automatic subtotals,
and outlining.

150

See Also
Edit Tutorial
Outline Tutorial
Data Analysis Tutorial

Edit Tutorial
This tutorial starts with a basic data-entry grid, then adds the following features:
1.
2.
3.
4.
5.
6.

Formatting
Check boxes
Drop-down lists
Complex data validation
Clipboard support
Custom editors

Here is what the final application will look like:

Note: A video is available for this tutorial on the ComponentOne Videos Web page.

See Also
Step 1 of 6: Create the C1FlexGrid Control for the Edit Tutorial
Step 2 of 6: Set Column Types and Formats

151

Step 3 of 6: Incorporate Drop-Down Lists


Step 4 of 6: Add Data Validation
Step 5 of 6: Add Clipboard Support
Step 6 of 6: Include Custom Editors

Step 1 of 6: Create the C1FlexGrid Control for the Edit Tutorial


Start a new 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 Choose
Items. 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.
1.

2.

Set the following properties in the Properties window for the C1FlexGrid control:
Property

Setting

Dock

Fill

Cols.Count

Cols.Fixed

Double-click the form caption area to open the code window. At the top of the file, add the
following statement:
To write code in Visual Basic
Visual Basic

Copy Code

Imports C1.Win.C1FlexGrid
To write code in C#
C#

Copy Code

152

using C1.Win.C1FlexGrid;
This makes the objects defined in the C1FlexGrid assembly visible to the project and saves a
lot of typing.
3.

Set up the columns by either in the designer through the Column Tasks menu or the
C1FlexGrid Column Editor, or in code.
In the Designer
o
o
o

Select the first column in the grid. This will open the Column Tasks menu for the
column.
Enter Product in the Column Caption and Data Field boxes.
Set the Column Caption and Data Field boxes for the remainder of the columns
as follows:
Column 1
Column

Region

Caption
Data Field

Region

Column 2
Column

Salesperson

Caption
Data Field

Salesperson

Column 3
Column

Sales

Caption
Data Field

Sales

Column 4

153

Column 1
Column

Bonus

Caption
Data Field

Bonus

Alternatively, the columns can also be set up through the C1FlexGrid Column Editor:
o

o
o
o

Open the C1FlexGrid Column Editor by clicking Designer in the C1FlexGrid


Tasks menu. For details on how to access the C1FlexGrid Column Editor, see
Accessing the C1FlexGrid Column Editor.
Select the Column 0 in the right pane.
In the left pane, set the Name and Caption properties to Product.
Set the Name and Caption properties for the remainder of the columns as follows:
Column 1
Name

Region

Caption

Region

Column 2
Name

Salesperson

Caption

Salesperson

Column 3
Name

Sales

Caption

Sales

Column 4
Name

Bonus

154

Column 1
Caption

Bonus

Click OK when finished to close the editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

' Set up the columns.


Dim cols As String = "Product|Region|Salesperson|Sales|Bonus"
Dim colNames As String() = cols.Split("|")
Dim i%For i = 0 To C1FlexGrid1.Cols.Count - 1
C1FlexGrid1(0, i) = colNames(i)
C1FlexGrid1.Cols(i).Name = colNames(i)Next
To write code in C#
C#

Copy Code

// Set up the columns.


string cols = "Product|Region|Salesperson|Sales|Bonus";
string[] colNames = cols.Split(new char[] { '|' });
for (int i = 0; i <= this.c1FlexGrid1.Cols.Count - 1; i++)
{
c1FlexGrid1[0, i] = colNames[i];
c1FlexGrid1.Cols[i].Name = colNames[i];
}

Run the program and observe the following:


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

155

Step 2 of 6: 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.
These properties can be set either in the designer or in code.

In the Designer
1.
2.
3.
4.
5.
6.
7.

Select the Sales column in the grid. This will open the Column Tasks menu for the Sales
column.
Set the Data Type box to Decimal.
Click the ellipsis button in the Format String box to open the Format String dialog box.
Under Format type select Currency.
Click OK to close the Format String dialog box.
Select the Bonus column in the grid. This will open the Column Tasks menu for the Bonus
column.
Set the Data Type box to Boolean.

Alternatively, the DataType and Format properties can also be set up through the C1FlexGrid
Column Editor:
1.

2.
3.
4.

Open the C1FlexGrid Column Editor by selecting Designer in the C1FlexGrid Tasks
menu. For details on how to access the C1FlexGrid Column Editor, see Accessing the
C1FlexGrid Column Editor.
Select the Sales column in the right pane.
Set the DataType property to Decimal.
Click the ellipsis button next to the Format property. This will open the Format String
dialog box.

156

5.
6.
7.
8.
9.

Under Format type select Currency.


Click OK to close the Format String dialog box.
Select the Bonus column in the right pane.
Set the DataType property to Boolean.
Click OK to close the editor.

In Code
To specify the DataType and Format for the columns, add the following code after the code added
in Step 1 of 6: Create the C1FlexGrid Control for the Edit Tutorial:
To write code in Visual Basic
Visual Basic

Copy Code

' Set the column DataType and Format.


Dim c As Column = C1FlexGrid1.Cols("Sales")
c.DataType = GetType(Decimal)
' Currency.
c.Format = "c2"c = C1FlexGrid1.Cols("Bonus")
c.DataType = GetType(Boolean)
c.ImageAlign = ImageAlignEnum.CenterCenter
To write code in C#
C#

Copy Code

// Set the column DataType and Format.


Column c = c1FlexGrid1.Cols["Sales"];
c.DataType = typeof(Decimal);
// Currency.
c.Format = "c2";
c = c1FlexGrid1.Cols["Bonus"];
c.DataType = typeof(bool);
c.ImageAlign = ImageAlignEnum.CenterCenter;

Run the program and observe the following:


157

The new code formats the Sales column to store and display currency values, and the Bonus column
to deal with Boolean values.
If you enter some numeric and non-numeric values in the Sales column, you will notice that the grid
won't accept non-numeric entries. 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.

Step 3 of 6: Incorporate 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 tutorial project only involves sales of three products (Applets, Wahoos, 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. This property can be set either in the designer or in code.

In the Designer
1.
2.

Select the Product column. This will open the Column Tasks menu for the Product column.
Click the ellipsis button in the Combo List box to open the Combo List dialog box.

158

3.

Enter Applets, Wahoos, and Gadgets as shown below:

4.
5.
6.
7.

Click OK to close the Combo List dialog box.


Select the Region column.
Click the ellipsis button in the Combo List box.
Enter North, South, East, and West as shown below:

8. Click OK.
9. Select the Salesperson column.
10. Click the ellipsis button in the Combo List box.

159

11. Enter Mary, Paula, and Sarah as shown below:

12. Select the Dropdown Combo option.


13. Click OK.
Alternatively, the ComboList property can be set using the C1FlexGrid Column Editor:
1.

2.
3.
4.
5.
6.
7.
8.

Open the C1FlexGrid Column Editor by selecting Designer in the C1FlexGrid Tasks
menu. For details on how to access the C1FlexGrid Column Editor, see Accessing the
C1FlexGrid Column Editor.
Select the Productcolumn in the right pane.
In the left pane, set the ComboList property to Applets|Wahoos|Gadgets.
Select the Region column in the right pane.
In the left pane, set the ComboList property to North|South|East|West.
Select the Salesperson column in the right pane.
In the left pane set the ComboList property to |Mary|Paula|Sarah.
Click OK to close the editor.

In Code
To add the combolists, add the following code after the code added in Step 2 of 6: Set Column
Types and Formats:
To write code in Visual Basic
Visual Basic

Copy Code

' Set up the drop-down lists.C1FlexGrid1.

160

Cols("Product").ComboList = "Applets|Wahoos|Gadgets"
C1FlexGrid1.Cols("Region").ComboList = "North|South|East|West"
C1FlexGrid1.Cols("Salesperson").ComboList = "|Mary|Paula|Sarah"
To write code in C#
C#

Copy Code

// Set up the drop-down lists.


c1FlexGrid1.Cols["Product"].ComboList = "Applets|Wahoos|Gadgets";
c1FlexGrid1.Cols["Region"].ComboList = "North|South|East|West";
c1FlexGrid1.Cols["Salesperson"].ComboList = "|Mary|Paula|Sarah";

Run the program and observe the following:


Notice how the last ComboList string starts with a pipe (text input cursor). This allows users to type
additional names that are not on the list. In other words, these values will be edited using a dropdown combo, as opposed to a simple drop-down list.
Press F5 to run the project again, and 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.

161

Step 4 of 6: Add 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 event checks the data after each edit and prevents invalid entries. Add the following
code to the form:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_ValidateEdit(ByVal sender As Object, ByVal e As


ValidateEditEventArgs) Handles C1FlexGrid1.ValidateEdit
Dim rgn As String = String.Empty
Dim prd As String = String.Empty
' Collect the data we need.
Select Case e.Col
Case 0
prd = C1FlexGrid1.Editor.Text
rgn = C1FlexGrid1(e.Row, "Region")
Case 1
prd = C1FlexGrid1(e.Row, "Product")
rgn = C1FlexGrid1.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

162

To write code in C#
C#

Copy Code

private void c1FlexGrid1_ValidateEdit( object sender, ValidateEditEventArgs e)


{
string rgn = string.Empty;
string prd = string.Empty;
// Collect the data we need.
switch (e.Col)
{
case 0:
prd = c1FlexGrid1.Editor.Text;
rgn = (string)c1FlexGrid1[e.Row, "Region"];
break;
case 1:
prd = (string)c1FlexGrid1[e.Row, "Product"];
rgn = c1FlexGrid1.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;
}
}

Run the program and observe the following:


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.

163

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

Step 5 of 6: Add Clipboard Support


The Windows clipboard is a very useful device for transferring information between applications.
Adding clipboard support to FlexGrid for WinForms projects is fairly easy. Simply set the
AutoClipboard property to True either in the designer or in code, and the grid will automatically
handle all standard keyboard commands related to the clipboard: CTRL+X or SHIFT+DELETE to cut,
CTRL+C or CTRL+INSERT to copy, and CTRL+V or SHIFT+INSERT to paste.

In the Designer
Locate the AutoClipboard property in the Properties window and set it to True.

In Code
Add the following code after the code added in Step 3 of 6: Incorporate Drop-Down Lists:
To write code in Visual Basic
Visual Basic

Copy Code

C1FlexGrid1.AutoClipboard = True
To write code in C#
C#

Copy Code

c1FlexGrid1.AutoClipboard = true;
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.

164

Just set both properties to their automatic settings either in the designer or in code, 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.

In the Designer
Locate the DragMode and DropMode properties and set them both to Automatic.

In Code
Add the following code after the code to set the AutoClipboard property:
To write code in Visual Basic
Visual Basic

Copy Code

C1FlexGrid1.DragMode = DragModeEnum.Automatic
C1FlexGrid1.DropMode = DropModeEnum.Automatic
To write code in C#
C#

Copy Code

c1FlexGrid1.DragMode = DragModeEnum.Automatic;
c1FlexGrid1.DropMode = DropModeEnum.Automatic;

Run the program and observe the following:


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.

Step 6 of 6: Include 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 tutorial, start by adding a NumericUpDown
control to the form.

165

1.

Set the following properties the Properties window to for the NumericUpDown control:
Property

Setting

BorderStyle

None

DecimalPlaces

Maximum

5000000

ThousandsSeparator True
Visible

2.
3.

False

Select Designer from the C1FlexGrid Tasks menu to bring up the grid's column editor.
Select the Sales column (or Column 3 where the Sales figures will be), and set the Editor
property to NumericUpDown1.

Run the program and observe the following:


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.

166

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

When you start editing by typing a number, the old value isn't cleared.
The size of the editor isn't exactly right (it looks a bit too small).
There's a beep when you press ENTER to finish editing.

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

Copy Code

Public Class MyUpDown


Inherits NumericUpDown
' Set the initial value.
Public Sub C1EditorInitialize(ByVal value As Object, ByVal editorAttributes
As IDictionary)
' Apply the initial value.

167

value = Convert.ChangeType(value, GetType(Decimal))


' Select the whole entry.
MyBase.Select(0, Int32.MaxValue)
End Sub
' Set the FontHeight so the control honors the rectangle height.
Public Sub C1EditorUpdateBounds(ByVal rc As Rectangle)
MyBase.FontHeight = rc.Height
Bounds = rc
End Sub
' Suppress the beeps when a user presses 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
To write code in C#
C#

Copy Code

internal class MyUpDown : NumericUpDown


{
// Set the initial value.
public void C1EditorInitialize(object value, System.Collections.IDictionary
editorAttributes)
{
// Apply the initial value.
Value = (decimal)Convert.ChangeType(value, typeof(decimal));
// Select the whole entry.

168

Select(0, int.MaxValue);
}
// Set the FontHeight so the control honors the rectangle height.
public void C1EditorUpdateBounds(Rectangle rc)
{
base.FontHeight = rc.Height;
Bounds = rc;
}
// Suppress the beeps when a user presses 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);
}
}
The previous code 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.
ProcessDialogKey method is overridden to suppress the beeps when the user presses the
Enter key.

Outline Tutorial
This tutorial 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 tutorial 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:

169

See Also
Step 1 of 5: Create the Controls
Step 2 of 5: Read the Data and Build the Outline
Step 3 of 5: Add Custom Mouse and Keyboard Handling
Step 4 of 5: Allow/Prevent Editing
Step 5 of 5: Implement ToolTips

Step 1 of 5: Create the Controls


Start a new project and add two controls:

A command Button near the top of the form.


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 Choose
Items. 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.
1.

Set the following properties in the Properties window:


o Command Button
Property

Setting

170

Property

Setting

Dock

Top

Text

"Open XML
File"

2.

C1FlexGrid
Property

Setting

Dock

Fill

Double-click the form caption area to open the code window. At the top of the file, add the
following statement:
To write code in Visual Basic
Visual Basic

Copy Code

Imports C1.Win.C1FlexGrid
To write code in C#
C#

Copy Code

using C1.Win.C1FlexGrid;
This makes the objects defined in the C1FlexGrid assembly visible to the project and saves a
lot of typing.
3.

Set up the grid either in the designer using the Properties window and editors, or in code
by typing (or copying) the following code.
In the Designer
Set the following properties for the C1FlexGrid control in the Properties window:

171

Property

Setting

Cols.Count

Cols.Fixed

ExtendLastCol True
Rows.Count

Tree.Column

Tree.Style

SimpleLeaf

Set up the styles for the grid:


o

o
o
o
o
o
o

Open the C1FlexGrid Style Editor by selecting Styles from the C1FlexGrid Tasks
menu. For more information on accessing the C1FlexGrid Style Editor, see
Accessing the C1FlexGrid Style Editor.
Select Normal in the list of Built-In Styles.
Set the Border.Style property to None, the TextAlign property to LeftCenter, and
the WordWrap property to False.
Click the Add button.
Rename CustomStyle1 to Data.
Set the BackColor property to Control.
Click OK to close the editor.

Set up the columns for the grid:


o
o
o
o
o

Select Column 0 in the grid. This will open the Column Tasks menu for Column 0.
Set the Column Caption to Element.
Uncheck the Allow Editing check box.
Select Column 1.
Set the Column Caption to Text.

Alternatively, the columns can also be set up through the C1FlexGrid Column Editor:
o

o
o

Open the C1FlexGrid Column Editor by selecting Designer in the C1FlexGrid


Tasks menu. For details on how to access the C1FlexGrid Column Editor, see
Accessing the C1FlexGrid Column Editor.
Select Column 0 in the right pane.
In the left pane, set the AllowEditing property to False and the Caption property
to Element.

172

o
o
o

Select Column 1 in the right pane.


In the left pane, set the Caption property to Text.
Click OK to close the editor.

In Code
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
' Initialize the grid.
C1FlexGrid1.Rows.Count = 1
C1FlexGrid1.Cols.Count = 2
C1FlexGrid1.Cols.Fixed = 0
C1FlexGrid1.ExtendLastCol = True
C1FlexGrid1(0, 0) = "Element"
C1FlexGrid1(0, 1) = "Text"
' Initialize the outline tree.
C1FlexGrid1.Tree.Column = 0
C1FlexGrid1.Tree.Style = TreeStyleFlags.SimpleLeaf
C1FlexGrid1.Cols(0).AllowEditing = False
' Initialize styles.
C1FlexGrid1.Styles.Normal.Border.Style = BorderStyleEnum.None
C1FlexGrid1.Styles.Normal.TextAlign = TextAlignEnum.LeftCenter
C1FlexGrid1.Styles.Normal.WordWrap = False
Dim cs As CellStyle = C1FlexGrid1.Styles.Add("Data")
cs.BackColor = SystemColors.Control
End Sub
To write code in C#
C#

Copy Code

173

private void Form1_Load( System.object sender, System.EventArgs e)


{
// Initialize the grid.
c1FlexGrid1.Rows.Count = 1;
c1FlexGrid1.Cols.Count = 2;
c1FlexGrid1.Cols.Fixed = 0;
c1FlexGrid1.ExtendLastCol = true;
c1FlexGrid1[0, 0] = "Element";
c1FlexGrid1[0, 1] = "Text";
// Initialize the outline tree.
c1FlexGrid1.Tree.Column = 0;
c1FlexGrid1.Tree.Style = TreeStyleFlags.SimpleLeaf;
c1FlexGrid1.Cols[0].AllowEditing = false;
// Initialize styles.
c1FlexGrid1.Styles.Normal.Border.Style = BorderStyleEnum.None;
c1FlexGrid1.Styles.Normal.TextAlign = TextAlignEnum.LeftCenter;
c1FlexGrid1.Styles.Normal.WordWrap = false;
CellStyle cs = c1FlexGrid1.Styles.Add("Data");
cs.BackColor = SystemColors.Control;}

Run the program and observe the following:


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

174

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.

Step 2 of 5: Read the Data and Build the Outline


To read the data and build the outline, add code to the Button1_Click event and add the
GetXMLData routine.
1.

Double-click the command button and add the following code to the Button1_Click event:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
' Get the file name.
Dim fo As OpenFileDialog = New OpenFileDialog()
fo.DefaultExt = "xml"
fo.Filter = "XML Files (*.xml)|*.xml"
If fo.ShowDialog() <> Windows.Forms.DialogResult.OK Then Exit Sub

175

' Load the XML file.


Dim xdoc As System.Xml.XmlDocument = New System.Xml.XmlDocument()
xdoc.Load(fo.FileName)
' Stop redrawing to improve speed.
C1FlexGrid1.Redraw = False
' Populate

the grid.

C1FlexGrid1.Rows.Count = 1
GetXMLData(xdoc.ChildNodes(1), 0)
' Autosize the tree column.
C1FlexGrid1.AutoSizeCol(0)
' Show levels 0, 1, and 2.
C1FlexGrid1.Tree.Show(2)
' Start redrawing.
C1FlexGrid1.Redraw = True
End Sub
To write code in C#
C#

Copy Code

private void button1_Click(System.object sender, System.EventArgs e)


{
// Get the file name.
OpenFileDialog fo = new OpenFileDialog();
fo.DefaultExt = "xml";
fo.Filter = "XML Files (*.xml)|*.xml";
if ( fo.ShowDialog() != DialogResult.OK ) return;
// Load the XML file.
System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();
xdoc.Load(fo.FileName);

176

// Stop redrawing to improve speed.


c1FlexGrid1.Redraw = false;
// Populate the grid.
c1FlexGrid1.Rows.Count = 1;
GetXMLData(xdoc.ChildNodes[1], 0);
// Autosize the tree column.
c1FlexGrid1.AutoSizeCol(0);
// Show levels 0, 1, and 2.
c1FlexGrid1.Tree.Show(2);
// Start redrawing.
c1FlexGrid1.Redraw = true;
}

Observe the following:


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 to 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 tutorial, 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.
2.

The GetXMLData routine is the most interesting one in this tutorial. It traverses the
XMLDocument object and builds the outline tree. Add the following code to the form:
To write code in Visual Basic
Visual Basic

Copy Code

177

Private Sub GetXMLData(ByVal node As System.Xml.XmlNode, ByVal level As Integer)


' Skip the comment nodes.
If node.NodeType = System.Xml.XmlNodeType.Comment Then
Exit Sub
End If
' Add a new row for this node.
Dim row As Integer = C1FlexGrid1.Rows.Count
C1FlexGrid1.Rows.Add()
' Add data to the new row.
C1FlexGrid1(row, 0) = node.Name
If node.ChildNodes.Count = 1 Then
C1FlexGrid1(row, 1) = node.InnerText
C1FlexGrid1.SetCellStyle(row, 1, C1FlexGrid1.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 System.Xml.XmlNode = node.SelectSingleNode("Name")
If Not (ndName Is Nothing) Then
C1FlexGrid1.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.
C1FlexGrid1.Rows(row).IsNode = True
C1FlexGrid1.Rows(row).Node.Level = level
' Recurse to get children.
Dim child As System.Xml.XmlNode
For Each child In node.ChildNodes
GetXMLData(child, level + 1)
Next
End If

178

End Sub
To write code in C#
C#

Copy Code

private void GetXMLData(System.Xml.XmlNode node, int level)


{
// Skip the comment nodes.
if ( node.NodeType == System.Xml.XmlNodeType.Comment )
{
return;
}
// Add a new row for this node.
int row = c1FlexGrid1.Rows.Count;
c1FlexGrid1.Rows.Add();
// Add data to the new row.
c1FlexGrid1[row, 0] = node.Name;
if ( node.ChildNodes.Count == 1 )
{
c1FlexGrid1[row, 1] = node.InnerText;
c1FlexGrid1.SetCellStyle(row, 1, c1FlexGrid1.Styles["Data"]);
}
// If the node has a "Name" subnode, save it to use as a ToolTip.
if (node.ChildNodes.Count > 0)
{
System.Xml.XmlNode ndName = node.SelectSingleNode("Name");
if (ndName != null)
{
c1FlexGrid1.Rows[row].UserData = ndName.InnerText;
}
}
// If this node has children, get them as well.
if ( node.ChildNodes.Count > 1 )

179

{
// Make this row a node.
c1FlexGrid1.Rows[row].IsNode = true;
c1FlexGrid1.Rows[row].Node.Level = level;
// Recurse to get children.
foreach (System.Xml.XmlNode child in node.ChildNodes)
GetXMLData(child, level + 1);
}
}

Observe the following:


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.

Run the program and observe the following:


The project can load XML files and display them, and the user can collapse and expand nodes by
clicking on them.

180

The next steps add a few improvements to make the application easier to use.

Step 3 of 5: Add 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 tutorial, we will trap the DoubleClick and KeyPress events to expand and collapse nodes
when the user double clicks or presses the ENTER key. Add the following DoubleClick and
KeyPress events to the form:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_DoubleClick(ByVal sender As Object, ByVal e As


EventArgs) Handles C1FlexGrid1.DoubleClick
If C1FlexGrid1.MouseCol = 0 Then
ToggleNodeState()
End If
End Sub
Private Sub C1FlexGrid1_KeyPress(ByVal sender As Object, ByVal e As

181

KeyPressEventArgs) Handles C1FlexGrid1.KeyPress


If e.KeyChar = vbCr Then
ToggleNodeState()
End If
End Sub
Private Sub ToggleNodeState()
' If the current row is not a node, no work is done.
Dim r As Row = C1FlexGrid1.Rows(C1FlexGrid1.Row)
If Not r.IsNode Then Exit Sub
' Toggle the collapsed state.
r.Node.Collapsed = Not r.Node.Collapsed
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_DoubleClick( object sender, EventArgs e)


{
if ( c1FlexGrid1.MouseCol == 0 )
{
ToggleNodeState();
}
}
private void c1FlexGrid1_KeyPress( object sender, KeyPressEventArgs e)
{
if ( e.KeyChar == 13 )
{
ToggleNodeState();
}
}
private void ToggleNodeState()
{

182

// If the current row is not a node, no work is done.


Row r = c1FlexGrid1.Rows[c1FlexGrid1.Row];
if (! r.IsNode ) return;
// Toggle the collapsed state.
r.Node.Collapsed = !r.Node.Collapsed;
}

Run the program and observe the following:


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.

Step 4 of 5: Allow/Prevent Editing


Recall that we set the AllowEditing property of the first column to False. 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:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_BeforeEdit(ByVal sender As Object, ByVal e As


RowColEventArgs) Handles C1FlexGrid1.BeforeEdit
' If the current row is a node, don't edit it.
Dim r As Row = C1FlexGrid1.Rows(C1FlexGrid1.Row)
If r.IsNode Then e.Cancel = True
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_BeforeEdit( object sender, RowColEventArgs e)


{
// If the current row is a node, don't edit it.

183

Row r = c1FlexGrid1.Rows[c1FlexGrid1.Row];
if (r.IsNode ) e.Cancel = true;
}

Step 5 of 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 UserDataproperty by the GetXMLDataroutine 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.
1.
2.

Add a ToolTipcontrol to the form.


Add the following code to handle the grid's MouseMoveevent:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_MouseMove(ByVal sender As Object, ByVal e As


MouseEventArgs) Handles C1FlexGrid1.MouseMove
' Check the ToolTip for this cell.
Dim tip As String
If C1FlexGrid1.MouseCol = 0 And C1FlexGrid1.MouseRow > 0 Then
tip = C1FlexGrid1.Rows(C1FlexGrid1.MouseRow).UserData
' Set it if it is different from the current ToolTip.
If tip <> ToolTip1.GetToolTip(C1FlexGrid1) Then
ToolTip1.SetToolTip(C1FlexGrid1, tip)
End If
End If
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_MouseMove( object sender, MouseEventArgs e)

184

{
// Check the ToolTip for this cell.
string

tip;

if ( c1FlexGrid1.MouseCol == 0 && c1FlexGrid1.MouseRow > 0 )


{
tip = (string)c1FlexGrid1.Rows[c1FlexGrid1.MouseRow].UserData;
// Set it if it is different from the current ToolTip.
if ( tip != toolTip1.GetToolTip(c1FlexGrid1) )
{
toolTip1.SetToolTip(c1FlexGrid1, tip);
}
}
}

Run the program and observe the following:


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.

185

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, and so on.

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.

See Also
Step 1 of 4: Create the C1FlexGrid Control for the Data Analysis Tutorial
Step 2 of 4: Initialize and Populate the Grid
Step 3 of 4: Allow Automatic Sorting

186

Step 4 of 4: Include Subtotals and Outline Tree

Step 1 of 4: Create the C1FlexGrid Control for the Data Analysis Tutorial
Start a new 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 Choose
Items. 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.
1.
2.

In the C1FlexGrid Tasks menu, click Dock in parent container. This sets the grid's Dock
property to Fill so the grid will fill the form.
Double-click the form caption area to open the code window. At the top of the file, add the
following statements:
To write code in Visual Basic
Visual Basic

Copy Code

Imports System.Data.OleDb
Imports System.ComponentModel
Imports C1.Win.C1FlexGrid
To write code in C#
C#

Copy Code

using System.Data.OleDb;
using System.ComponentModel;
using C1.Win.C1FlexGrid;
This makes the objects defined in the C1FlexGrid and OleDb assemblies visible to the
project and saves a lot of typing.

Step 2 of 4: Initialize and Populate the Grid


To set up the grid and populate the grid with the sales data we want to analyze, set the layout
properties and styles either in the designer or in code, and use the GetDataSource method to
populate the grid.
1.

Set up the grid layout and styles either in the designer or in code.
In the Designer

187

In the Properties window, set the following properties:


Property

Setting

AllowEditing

False

AllowSorting

None

AllowMerging

Nodes

ExtendLastCol

True

SelectionMode Cell

o
o
o
o
o

Tree.Style

Simple

Tree.Column

Open the C1FlexGrid Style Editor by selecting Styles from the C1FlexGrid Tasks
menu. For more information on accessing the C1FlexGrid Style Editor, see
Accessing the C1FlexGrid Style Editor.
Select Normal from the list of Built-In Styles.
Set the Border.Style property to None and the Trimming property to
EllipsisCharacter.
Select Subtotal0 from the list of Built-In Styles.
Set the BackColor property to Gold, and the ForeColor property to Black.
Set the properties for Subtotal1 and Subtotal2 to the following:
Subtotal1
BackColor Khaki
ForeColor Black
Subtotal2
BackColor LightGoldenrodYellow

188

Subtotal1
ForeColor Black

Click OK to close the editor.

In Code
Add the following code to the Form_Load event to set up the grid layout and styles:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As EventArgs)


Handles MyBase.Load
' Set up the grid layout/behavior.
C1FlexGrid1.AllowEditing = False
C1FlexGrid1.AllowSorting = AllowSortingEnum.None
C1FlexGrid1.AllowMerging = AllowMergingEnum.Nodes
C1FlexGrid1.SelectionMode = SelectionModeEnum.Cell
C1FlexGrid1.ExtendLastCol = True
C1FlexGrid1.Cols(0).Width = C1FlexGrid1.Cols.DefaultSize / 4
C1FlexGrid1.Tree.Style = TreeStyleFlags.Simple
C1FlexGrid1.Tree.Column = 1
' Set up grid styles.
C1FlexGrid1.Styles.Normal.Border.Style = BorderStyleEnum.None
C1FlexGrid1.Styles.Normal.Trimming = StringTrimming.EllipsisCharacter
Dim s As CellStyle = C1FlexGrid1.Styles(CellStyleEnum.GrandTotal)
s.BackColor = Color.Black
s.ForeColor = Color.White
s = C1FlexGrid1.Styles(CellStyleEnum.Subtotal0)
s.BackColor = Color.Gold
s.ForeColor = Color.Black
s = C1FlexGrid1.Styles(CellStyleEnum.Subtotal1)

189

s.BackColor = Color.Khaki
s.ForeColor = Color.Black
s = C1FlexGrid1.Styles(CellStyleEnum.Subtotal2)
s.BackColor = Color.LightGoldenrodYellow
s.ForeColor = Color.Black
End Sub
To write code in C#
C#

Copy Code

private void Form1_Load( System.object sender, EventArgs e)


{
// Set up the grid layout/behavior.
c1FlexGrid1.AllowEditing = false;
c1FlexGrid1.AllowSorting = AllowSortingEnum.None;
c1FlexGrid1.AllowMerging = AllowMergingEnum.Nodes;
c1FlexGrid1.SelectionMode = SelectionModeEnum.Cell;
c1FlexGrid1.ExtendLastCol = true;
c1FlexGrid1.Cols[0].Width = c1FlexGrid1.Cols.DefaultSize / 4;
c1FlexGrid1.Tree.Style = TreeStyleFlags.Simple;
c1FlexGrid1.Tree.Column = 1;
// Set up grid styles.
c1FlexGrid1.Styles.Normal.Border.Style = BorderStyleEnum.None;
c1FlexGrid1.Styles.Normal.Trimming = StringTrimming.EllipsisCharacter;
CellStyle s = c1FlexGrid1.Styles[CellStyleEnum.GrandTotal];
s.BackColor = Color.Black;
s.ForeColor = Color.White;
s = c1FlexGrid1.Styles[CellStyleEnum.Subtotal0];
s.BackColor = Color.Gold;
s.ForeColor = Color.Black;
s = c1FlexGrid1.Styles[CellStyleEnum.Subtotal1];
s.BackColor = Color.Khaki;
s.ForeColor = Color.Black;
s = c1FlexGrid1.Styles[CellStyleEnum.Subtotal2];
s.BackColor = Color.LightGoldenrodYellow;

190

s.ForeColor = Color.Black;
}
The routine starts by setting up the grid layout and some styles.
2.

Bind C1FlexGrid to a data source by adding the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

' Bind C1FlexGrid to the data source.


C1FlexGrid1.DataSource = GetDataSource()
To write code in C#
C#

Copy Code

// Bind C1FlexGrid to the data source.


c1FlexGrid1.DataSource = GetDataSource();
The routine binds it to a data source created by the GetDataSource method, listed below.
3.

Lock the last three columns 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). This property can be set either in the designer or at in
code.
In the Designer
o
o
o

Select Column 4 in the grid. This will open the Column Tasks menu for Column 4.
Uncheck the Allow Dragging check box.
Repeat for Column 5 and Column 6.

Alternatively, the AllowDragging property can also be set using the C1FlexGrid Column
Editor:
o

o
o
o

Open the C1FlexGrid Column Editor by selecting Designer in the C1FlexGrid


Tasks menu. For details on how to access the C1FlexGrid Column Editor, see
Accessing the C1FlexGrid Column Editor.
Select Column 4 in the right pane.
In the left pane, set the AllowDragging property to False.
Set the AllowDragging property to False for Column 5 and Column 6.

191

Do not close the editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

' Prevent the user from dragging last three columns.


C1FlexGrid1.Cols(4).AllowDragging = False
C1FlexGrid1.Cols(5).AllowDragging = False
C1FlexGrid1.Cols(6).AllowDragging = False
To write code in C#
C#

Copy Code

// Prevent the user from dragging last three columns.


c1FlexGrid1.Cols[4].AllowDragging = false;
c1FlexGrid1.Cols[5].AllowDragging = false;
c1FlexGrid1.Cols[6].AllowDragging = false;
4.

Set the Format property of the Sales Amount column so that the amounts are displayed as
currency values. This can be done either in the designer or in code.
In the Designer
o
o
o
o

Select Column 6 in the grid.


Click the ellipsis button in the Format String box to open the Format String
dialog box.
Under Format type select Currency.
Click OK to close the Format String dialog box.

Alternatively, the Format property can also be set using the C1FlexGrid Column Editor:
o
o
o

In the C1FlexGrid Column Editor, select Column 6 in the right pane.


In the left pane, click the ellipsis button next to the Format property to open the
Format String dialog box.
Under Format type select Currency.

192

o
o

Click OK to close the Format String dialog box.


Click OK to close the editor.

In Code
To write code in Visual Basic
Visual Basic

Copy Code

' Display currency values in the Sales Amount column.


C1FlexGrid1.Cols(6).Format = "c"
To write code in C#
C#

Copy Code

// Display currency values in the Sales Amount column.


c1FlexGrid1.Cols[6].Format = "c";
5.

The GetDataSource method creates the data table that is displayed by the grid. The
routine is very basic, 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.
Add the following code to the form. 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:
To write code in Visual Basic
Visual Basic

Copy Code

Private Function GetDataSource() As DataTable


' Set up the connection string.
Dim conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Program Files\ComponentOne Studio.NET 2.0\Common\Nwind.mdb"

193

' Set up the 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 the data into the DataSet.
Dim da As OleDbDataAdapter = New OleDbDataAdapter(rs, conn)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
' Return the data table.
GetDataSource = ds.Tables(0)
End Function
To write code in C#
C#

Copy Code

private DataTable GetDataSource()


{
// Set up the connection string.
string

conn = "Provider=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=C:\\Program Files\\ComponentOne Studio.NET


2.0\\Common\\Nwind.mdb";
// Set up the SQL statement.
string

rs =

"SELECT Employees.LastName,Orders.ShipCountry," +

194

"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 the data into the DataSet.
OleDbDataAdapter da = new OleDbDataAdapter(rs, conn);
DataSet ds = new DataSet();
da.Fill(ds);
// Return the data table.
return ds.Tables[0];
}

Run the program and observe the following:


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.

195

Step 3 of 4: Allow 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.)
Add the following code to the form to sort the record set and rebuild the subtotals when the user
drags columns:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_AfterDragColumn(ByVal sender As Object, ByVal e As


DragRowColEventArgs) Handles C1FlexGrid1.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 = C1FlexGrid1.Cols(1).Name & ", " & _
C1FlexGrid1.Cols(2).Name & ", " & _

196

C1FlexGrid1.Cols(3).Name
Dim dt As DataTable = C1FlexGrid1.DataSource
dt.DefaultView.Sort = sort
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_AfterDragColumn( object sender, DragRowColEventArgs e)


{
// 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 = c1FlexGrid1.Cols[1].Name + ", " +
c1FlexGrid1.Cols[2].Name + ", " +
c1FlexGrid1.Cols[3].Name;
DataTable dt = (DataTable)c1FlexGrid1.DataSource;
dt.DefaultView.Sort = sort;
}

Run the program and observe the following:


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.

197

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

Step 4 of 4: Include 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.
Add the following AfterDataRefresh event handler to the form:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_AfterDataRefresh(ByVal sender As Object, ByVal e As


ListChangedEventArgs) Handles C1FlexGrid1.AfterDataRefresh
' Total the Sale Amount.
Dim totalOn As Integer = C1FlexGrid1.Cols("Sale Amount").SafeIndex
Dim caption As String = "Total for {0}"
' Calculate three levels of totals.
C1FlexGrid1.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption)
C1FlexGrid1.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption)

198

C1FlexGrid1.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption)


' Collapse the outline to level 2.
C1FlexGrid1.Tree.Show(2)
' Autosize the grid to accommodate the tree.
C1FlexGrid1.AutoSizeCols(1, 1, 1000, 3, 30, AutoSizeFlags.IgnoreHidden)
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_AfterDataRefresh( object sender, ListChangedEventArgs


e)
{
// Total the Sale Amount.
int totalOn = c1FlexGrid1.Cols["Sale Amount"].SafeIndex;
string

caption = "Total for {0}";

// Calculate three levels of totals.


c1FlexGrid1.Subtotal(AggregateEnum.Sum, 0, 1, totalOn, caption);
c1FlexGrid1.Subtotal(AggregateEnum.Sum, 1, 2, totalOn, caption);
c1FlexGrid1.Subtotal(AggregateEnum.Sum, 2, 3, totalOn, caption);
// Collapse the outline to level 2.
c1FlexGrid1.Tree.Show(2);
// Autosize the grid to accommodate the tree.
c1FlexGrid1.AutoSizeCols(1, 1, 1000, 3, 30, AutoSizeFlags.IgnoreHidden);
}

Run the program and observe the following:


The code starts by getting the index of the Sale Amount column. In this tutorial, 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.

199

The code then calls the C1FlexGrid.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 dragging columns around. You can easily see the totals by country, product category, or
salesperson. You can also expand tree nodes to drill down into the data if you want to see more
detail.

200

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.

FlexGrid for WinForms 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. If you are a novice to the
ComponentOne FlexGrid for WinForms product, please see the FlexGrid for WinForms Tutorials
first.
Each topic provides a solution for specific tasks using the ComponentOne FlexGrid for WinForms
product. By following the steps outlined in the help, you will be able to create projects
demonstrating a variety of C1FlexGrid features.
Each task-based help topic also assumes that you have created a new .NET project.

See Also
Accessing the C1FlexGrid Editors
Adding Pictures and Text to a Cell
Adding Row Numbers in a Fixed Column
Adding Three-Dimensional Text to a Header Row
Adding ToolTips That Display UserData
Applying a Gradient Background to a CellRange
Changing the Column Order in the Grid
Filtering by Value
Filtering by Condition
Changing the Filter Language
Clearing a Tree View
Clearing C1FlexGrid
Converting Column Letters to Uppercase
Customizing Appearance Using Visual Styles

201

Entering Only Numbers in a Cell


Formatting Cells
Formatting the Border Style
Freezing Rows and Columns
Getting the Width of a Partially Visible Column
Loading and Saving Open XML Files
Populating an Unbound Grid with Data
Restricting Grid Editing
Restricting Sorting for a Specific Column
Scaling an Image
Searching for Entries in a Column
Setting a Cell's Value to Zero When Users Press the Delete Key
Setting Rows As Headers
Setting the Background Color of Columns and Rows
Setting the Font of a Single Cell
Setting the Text Delimiting Character in C1FlexGrid
Sorting Multiple Columns
Undoing a Sort
Using Password Entries in C1FlexGrid
Word Wrapping in a Header or Fixed Row

Accessing the C1FlexGrid Editors


The C1FlexGrid editors can be accessed through the C1FlexGrid Tasks menu, the context menu, or
the Properties window. There are two C1FlexGrid editors, the C1FlexGrid Column Editor and the
C1FlexGrid Style Editor, which allow you to control the layout and appearance of C1FlexGrid at
design time. To reorder columns, adjust column widths, set column properties, and insert or remove
columns, use the C1FlexGrid Column Editor. To modify existing styles and add custom styles,
which may later be assigned to cells, rows, and columns, use the C1FlexGrid Style Editor.

See Also
202

Accessing the C1FlexGrid Column Editor


Accessing the C1FlexGrid Style Editor

Accessing the C1FlexGrid Column Editor


To access the C1FlexGrid Column Editor, use the C1FlexGrid Tasks menu, the context menu, or
the Properties window. For more information on editing columns with the C1FlexGrid Column
Editor, see C1FlexGrid Column Editor.

C1FlexGrid Tasks Menu


Click the smart tag ( ) in the upper right corner of C1FlexGrid to open the C1FlexGrid Tasks
menu, and select Designer.

Context Menu
Right-click on the form and select Designer from the context menu.

Properties Window
In the Properties window, click the ellipsis button next to the Cols property.

Accessing the C1FlexGrid Style Editor


To access the C1FlexGrid Style Editor, use the C1FlexGrid Tasks menu, the context menu, or the
Properties window. For more information on customizing cell appearance with the C1FlexGrid
Style Editor, see C1FlexGrid Style Editor.

C1FlexGrid Tasks Menu


Click the smart tag ( ) in the upper right corner of C1FlexGrid to open the C1FlexGrid Tasks
menu, and select Styles.

Context Menu
Right-click on the form and select Styles from the context menu.

Properties Window
In the Properties window, click the ellipsis button next to the Styles property.

Adding Pictures and Text to a Cell


To add pictures and text to a cell, use the SetData and SetCellImage methods. Add the following
code to the Form_Load event:

203

1.

Resize the cells to fit the image using the Height and Width properties.
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Rows(1).Height = 90
Me.C1FlexGrid1.Cols(1).Width = 150
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Rows[1].Height = 90;
this.c1FlexGrid1.Cols[1].Width = 150;
2.

Add the SetCellImage method to add the image.


To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.SetCellImage(1, 1, Image.FromFile("c:\c1logo.bmp"))
To write code in C#
C#

Copy Code

this.c1FlexGrid1.SetCellImage(1, 1, Image.FromFile(@"c:\c1logo.bmp"));
3.

Add the SetData method to add the text:


To write code in Visual Basic
Visual Basic

Copy Code

204

Me.C1FlexGrid1.SetData(1, 1, "ComponentOne")
To write code in C#
C#

Copy Code

this.c1FlexGrid1.SetData(1, 1, "ComponentOne");
4.

Set the alignment of the image to CenterTop and the text to CenterBottom:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Styles.Normal.ImageAlign =
C1.Win.C1FlexGrid.ImageAlignEnum.CenterTop
Me.C1FlexGrid1.Styles.Normal.TextAlign =
C1.Win.C1FlexGrid.TextAlignEnum.CenterBottom
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Styles.Normal.ImageAlign =
C1.Win.C1FlexGrid.ImageAlignEnum.CenterTop;
this.c1FlexGrid1.Styles.Normal.TextAlign =
C1.Win.C1FlexGrid.TextAlignEnum.CenterBottom;

This topic illustrates the following:


Your grid will look like the following with an image and text in the same cell.

205

Note: To set the text on top of the picture, change the alignment of the text to CenterTop, and
the alignment of the image to CenterBottom.

Adding Row Numbers in a Fixed Column


To add row numbers in a fixed column, like in Microsoft Excel, use the OwnerDrawCell event to
draw the numbers, aligned left, in a fixed column.
1.

Add the following code to the Form_Load event to fire the OwnerDrawCell event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw
To write code in C#
C#

Copy Code

this.c1FlexGrid1.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw;
2.

Add the OwnerDrawCell event:


To write code in Visual Basic

206

Visual Basic

Copy Code

Private Sub C1FlexGrid1_OwnerDrawCell(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles C1FlexGrid1.OwnerDrawCell
If e.Row >= Me.C1FlexGrid1.Rows.Fixed And e.Col = Me.C1FlexGrid1.Cols.Fixed
- 1 Then
Dim rowNumber As Integer = e.Row - Me.C1FlexGrid1.Rows.Fixed + 1
e.Text = rowNumber.ToString()
End If
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_OwnerDrawCell(object sender,


C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
{
if ((e.Row >= this.c1FlexGrid1.Rows.Fixed) & (e.Col ==
(this.c1FlexGrid1.Cols.Fixed - 1)))
{
e.Text = ((e.Row - this.c1FlexGrid1.Rows.Fixed) + 1).ToString();
}
}

This topic illustrates the following:


Row numbers appear in the first column, which is fixed, and are left-aligned like in Microsoft Excel.

207

Adding Three-Dimensional Text to a Header Row


To add three-dimensional text to the table's header row, set the TextEffect property to Raised for
text with a shadow offset by one pixel to the right and below the text or Inset for text with a
shadow offset by one pixel to the left and above the text. Setting the TextEffect property to Flat
gives text no effect.
1.

Create a new style called 3DText.


In the Designer
o
o
o
o

Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid
Style Editor, see Accessing the C1FlexGrid Style Editor.
Click Add to create a new style.
Double-click CustomStyle1, rename it 3DText, and press ENTER when finished.
Do not exit the C1FlexGrid Style Editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Dim tdt As C1.Win.C1FlexGrid.CellStyle

208

To write code in C#
C#

Copy Code

C1.Win.C1FlexGrid.CellStyle tdt = this.c1FlexGrid1.Styles.Add("3Dtext");


2.

Set the TextEffect property to Raised.


In the Designer
Locate the TextEffect property in the right pane and set it to Raised.
In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

tdt.TextEffect = C1.Win.C1FlexGrid.TextEffectEnum.Raised
To write code in C#
C#

Copy Code

tdt.TextEffect = C1.Win.C1FlexGrid.TextEffectEnum.Raised;
3.

Apply the style to the header row by adding the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Rows(0).Style = Me.C1FlexGrid1.Styles("3DText")
To write code in C#

209

C#

Copy Code

this.c1FlexGrid1.Rows[0].Style = this.c1FlexGrid1.Styles["3DText"];

This topic illustrates the following:


The table should have a header with raised text similar to the following image.

See Also
Adding Three-Dimensional Text to a Header Row Using Built-In Styles

Adding Three-Dimensional Text to a Header Row Using Built-In Styles


The TextEffect property can be used to add a three-dimensional text effect to C1FlexGrid's built-in
styles. To add a header with three-dimensional text using styles, set the TextEffect property within a
style to Raised for text with a shadow offset by one pixel to the right and below the text or Inset
for text with a shadow offset by one pixel to the left and above the text. Setting the TextEffect
property to Flat gives text no effect. This property can be set either in the designer or in code.

In the Designer
1.
2.
3.

Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid Style
Editor, see Accessing the C1FlexGrid Style Editor.
Select Fixed under Built-In Styles.
In the right column, locate the TextEffect property and set it to Raised.

210

4.

Click OK to close the editor.

In Code
Add the following code to the Form_Load event to set the TextEffect property in the Fixed style:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Styles("Fixed").TextEffect =
C1.Win.C1FlexGrid.TextEffectEnum.Raised
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Styles["Fixed"].TextEffect =
C1.Win.C1FlexGrid.TextEffectEnum.Raised;

This topic illustrates the following:


By setting the TextEffect property in the Fixed style, only fixed cells in the table will have a raised
three-dimensional effect. The TextEffect property can also be set in the all of the built-in styles. See
CellStyleEnum Enumeration for a list and descriptions of the built-in styles.

211

Adding ToolTips That Display UserData


To add ToolTips that display UserData, use C1FlexGrid's MouseMove event to get the UserData
property and display it in a ToolTip control. ToolTips can be set to a column, a row, cell range, cell
style, or a single cell.

See Also
UserData ToolTips for a Column
UserData ToolTips for a Cell Range
UserData ToolTips for a Cell Style
UserData ToolTips for a Row
UserData ToolTips for a Single Cell

UserData ToolTips for a Column


To add ToolTips that display UserData for a column, use C1FlexGrid's MouseMove event to get
the UserData property and display it in a ToolTip control.
1.
2.

Locate the ToolTip control in the Toolbox and add it to the form.
In the Form_Load event, set the UserData property for the AtomicMass column:
To write code in Visual Basic

212

Visual Basic

Copy Code

Me.C1FlexGrid1.Cols("AtomicMass").UserData = "in atomic mass units (u)"


To write code in C#
C#

Copy Code

this.c1FlexGrid1.Cols["AtomicMass"].UserData = "in atomic mass units (u)";


3.

Add the following MouseMove event:


To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_MouseMove(ByVal sender As Object, ByVal e As


System.Windows.Forms.MouseEventArgs) Handles C1FlexGrid1.MouseMove
Dim tip As String
tip = C1FlexGrid1.Cols(C1FlexGrid1.MouseCol).UserData
ToolTip1.SetToolTip(C1FlexGrid1, tip)
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_MouseMove(object sender,


System.Windows.Forms.MouseEventArgs e)
{
string tip;
tip = (string)c1FlexGrid1.Cols[c1FlexGrid1.MouseCol].UserData;
toolTip1.SetToolTip(c1FlexGrid1, tip);
}

This topic illustrates the following:


213

The ToolTip appears within the entire AtomicMass column.

UserData ToolTips for a Cell Range


To add ToolTips that display UserData for a cell range, use C1FlexGrid's MouseMove event to get
the CellRange.UserData property and display it in a ToolTip control.
1.
2.

Locate the ToolTip control in the Toolbox and add it to the form.
In the Form_Load event, set the UserData property for a cell range that contains a group
of non-metallic elements:
To write code in Visual Basic
Visual Basic

Copy Code

' Set the cell range that contains the non-metallic elements.
Dim rng As C1.Win.C1FlexGrid.CellRange = Me.C1FlexGrid1.GetCellRange(6, 1, 10,
10)
' Set the background color to see the cell range more easily.
rng.StyleNew.BackColor = Color.AliceBlue
' Set the user data for the cell range.
rng.UserData = "Non-Metallic"

214

To write code in C#
C#

Copy Code

// Set the cell range that contains the non-metallic elements.


C1.Win.C1FlexGrid.CellRange rng = this.c1FlexGrid1.GetCellRange(6, 1, 10, 10);
// Set the background color to see the cell range more easily.
rng.StyleNew.BackColor = Color.AliceBlue;
// Set the user data for the cell range.
rng.UserData = "Non-Metallic";
3.

Add the following MouseMove event:


To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_MouseMove(ByVal sender As Object, ByVal e As


System.Windows.Forms.MouseEventArgs) Handles C1FlexGrid1.MouseMove
Dim tip As String
tip = Me.C1FlexGrid1.GetUserData(C1FlexGrid1.MouseRow, C1FlexGrid1.MouseCol)
ToolTip1.SetToolTip(C1FlexGrid1, tip)
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_MouseMove(object sender,


System.Windows.Forms.MouseEventArgs e)
{
string tip;
tip = (string)this.c1FlexGrid1.GetUserData(c1FlexGrid1.MouseRow,
c1FlexGrid1.MouseCol);
toolTip1.SetToolTip(c1FlexGrid1, tip);

215

This topic illustrates the following:


The ToolTip appears within the entire cell range.

UserData ToolTips for a Cell Style


To add ToolTips that display UserData for a cell style, use C1FlexGrid's MouseMove event to get
the CellStyle.UserData property and display it in a ToolTip control.
1.
2.

Locate the ToolTip control in the Toolbox and add it to the form.
In the Form_Load event, create a custom CellStyle for columns and a custom CellStyle for
rows, and assign the styles to a column and row in the grid. For more information on how
to create CellStyles, see the Setting the Background Color of Columns and Rows topic.
To write code in Visual Basic
Visual Basic

Copy Code

' Create a CellStyle for columns.


Dim cc As C1.Win.C1FlexGrid.CellStyle
cc = Me.C1FlexGrid1.Styles.Add("ColumnColor")
cc.BackColor = Color.Cornsilk

216

' Add UserData with the style name.


cc.UserData = "ColumnColor Style"
' Create a CellStyle for rows.
Dim rs As C1.Win.C1FlexGrid.CellStyle
rs = Me.C1FlexGrid1.Styles.Add("RowColor")
rs.BackColor = Color.PowderBlue
' Add UserData with the style name.
rs.UserData = "RowColor Style"
' Assign the ColumnColor Style to a column.
Me.C1FlexGrid1.Cols(2).Style = Me.C1FlexGrid1.Styles("ColumnColor")
' Assign the RowColor Style to a row.
Me.C1FlexGrid1.Rows(8).Style = Me.C1FlexGrid1.Styles("RowColor")
To write code in C#
C#

Copy Code

// Create a CellStyle for columns.


C1.Win.C1FlexGrid.CellStyle cc;
cc = this.c1FlexGrid1.Styles.Add("ColumnColor");
cc.BackColor = Color.Cornsilk;
// Add UserData with the style name.
cc.UserData = "ColumnColor Style";
// Create a CellStyle for rows.
C1.Win.C1FlexGrid.CellStyle rs;
rs = this.c1FlexGrid1.Styles.Add("RowColor");
rs.BackColor = Color.PowderBlue;
// Add UserData with the style name.
rs.UserData = "RowColor Style";
// Assign the ColumnColor Style to a column.

217

this.c1FlexGrid1.Cols[2].Style = this.c1FlexGrid1.Styles["ColumnColor"];
// Assign the RowColor Style to a row.
this.c1FlexGrid1.Rows[8].Style = this.c1FlexGrid1.Styles["RowColor"];
3.

Add the following MouseMove event:


To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_MouseMove(ByVal sender As Object, ByVal e As


System.Windows.Forms.MouseEventArgs) Handles C1FlexGrid1.MouseMove
Dim tip As String
If C1FlexGrid1.MouseCol <> C1FlexGrid1.Cols.Fixed - 1 And
C1FlexGrid1.MouseRow <> C1FlexGrid1.Rows.Fixed - 1 Then
tip = C1FlexGrid1.Cols(C1FlexGrid1.MouseCol).Style.UserData
ToolTip1.SetToolTip(C1FlexGrid1, tip)
End If
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_MouseMove(object sender,


System.Windows.Forms.MouseEventArgs e)
{
string tip;
if (c1FlexGrid1.MouseCol != c1FlexGrid1.Cols.Fixed - 1 &
c1FlexGrid1.MouseRow != c1FlexGrid1.Rows.Fixed - 1)
{
tip = (string)c1FlexGrid1.Cols[c1FlexGrid1.MouseCol].Style.UserData;
toolTip1.SetToolTip(c1FlexGrid1, tip);
}
}

This topic illustrates the following:


218

The ToolTip appears within the CellStyle.

UserData ToolTips for a Row


To add ToolTips that display UserData for a row, use C1FlexGrid's MouseMove event to get the
UserData property and display it in a ToolTip control.
1.
2.

Locate the ToolTip control in the Toolbox and add it to the form.
In the Form_Load event, set the UserData property for the row that contains Oxygen:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Rows(8).UserData = "Oxygen makes up approximately 1/5 of the


earth's atmosphere."
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Rows[8].UserData = "Oxygen makes up approximately 1/5 of the


earth's atmosphere.";

219

3.

Add the following MouseMove event:


To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_MouseMove(ByVal sender As Object, ByVal e As


System.Windows.Forms.MouseEventArgs) Handles C1FlexGrid1.MouseMove
Dim tip As String
tip = C1FlexGrid1.Rows(C1FlexGrid1.MouseRow).UserData
ToolTip1.SetToolTip(C1FlexGrid1, tip)
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_MouseMove(object sender,


System.Windows.Forms.MouseEventArgs e)
{
string tip;
tip = (string)c1FlexGrid1.Rows[c1FlexGrid1.MouseRow].UserData;
toolTip1.SetToolTip(c1FlexGrid1, tip);
}

This topic illustrates the following:


The ToolTip appears across the entire row.

220

UserData ToolTips for a Single Cell


To add ToolTips that display UserData for a single cell, use C1FlexGrid's MouseMove event to get
the UserData and display it in a ToolTip control.
1.
2.

Locate the ToolTip control in the Toolbox and add it to the form.
Add the following SetUserData method to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.SetUserData(1, "Element", "Hydrogen is a highly flammable gas.")


To write code in C#
C#

Copy Code

this.c1FlexGrid1.SetUserData(1, "Element", "Hydrogen is a highly flammable


gas.");
3.

Add the following MouseMove event:


To write code in Visual Basic

221

Visual Basic

Copy Code

Private Sub C1FlexGrid1_MouseMove(ByVal sender As Object, ByVal e As


System.Windows.Forms.MouseEventArgs) Handles C1FlexGrid1.MouseMove
Dim tip As String
tip = Me.C1FlexGrid1.GetUserData(C1FlexGrid1.MouseRow, C1FlexGrid1.MouseCol)
ToolTip1.SetToolTip(C1FlexGrid1, tip)
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_MouseMove(object sender,


System.Windows.Forms.MouseEventArgs e)
{
string tip;
tip = (string)this.c1FlexGrid1.GetUserData(c1FlexGrid1.MouseRow,
c1FlexGrid1.MouseCol);
toolTip1.SetToolTip(c1FlexGrid1, tip);
}

This topic illustrates the following:


When the mouse moves over the first row in the Element column, the information about Hydrogen
appears.

222

Applying a Gradient Background to a CellRange


To apply a gradient background to a CellRange, use the OwnerDrawCell event to create custom cell
painting.
1.

Create a LinearGradient brush and a CellRange by adding the following code to the form
class level:
To write code in Visual Basic
Visual Basic

Copy Code

Dim GradientStyleBrush As System.Drawing.Drawing2D.LinearGradientBrush


Dim rng As C1.Win.C1FlexGrid.CellRange
To write code in C#
C#

Copy Code

System.Drawing.Drawing2D.LinearGradientBrush GradientStyleBrush;
C1.Win.C1FlexGrid.CellRange rng;

223

2.

Set C1FlexGrid's DrawMode property to OwnerDraw by adding the following code to the
Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw
To write code in C#
C#

Copy Code

this.c1FlexGrid1.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw;
3.

Set the CellRange using the GetCellRange method:


To write code in Visual Basic
Visual Basic

Copy Code

rng = Me.C1FlexGrid1.GetCellRange(2, 2, 4, 4)
To write code in C#
C#

Copy Code

rng = this.c1FlexGrid1.GetCellRange(2, 2, 4, 4);


4.

Set the LinearGradient brush colors and angle of the gradient:


To write code in Visual Basic
Visual Basic

Copy Code

GradientStyleBrush = New

224

System.Drawing.Drawing2D.LinearGradientBrush(ClientRectangle, Color.Navy,
Color.Transparent, 270)
To write code in C#
C#

Copy Code

GradientStyleBrush = new
System.Drawing.Drawing2D.LinearGradientBrush(ClientRectangle, Color.Navy,
Color.Transparent, 270);
5.

Add the OwnerDrawCell event to draw the gradient in the CellRange:


To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_OwnerDrawCell(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles C1FlexGrid1.OwnerDrawCell
' Draw cell background using gradient brush.
If (e.Row >= rng.r1) And (e.Row <= rng.r2) Then
If (e.Col >= rng.c1) And (e.Col <= rng.c2) Then
' Draw background.
e.Graphics.FillRectangle(GradientStyleBrush, e.Bounds)
' Let the grid draw the content.
e.DrawCell(C1.Win.C1FlexGrid.DrawCellFlags.Content)
' Finish drawing the cell.
e.Handled = True
End If
End If
End Sub
To write code in C#

225

C#

Copy Code

private void c1FlexGrid1_OwnerDrawCell(object sender,


C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
{
// Draw cell background using gradient brush.
if ((e.Row >= rng.r1) & (e.Row <= rng.r2))
{
if ((e.Col >= rng.c1) & (e.Col <= rng.c2))
{
// Draw background.
e.Graphics.FillRectangle(GradientStyleBrush, e.Bounds);
// Let the grid draw the content.
e.DrawCell(C1.Win.C1FlexGrid.DrawCellFlags.Content);
// Finish drawing the cell.
e.Handled = true;
}
}
}

This topic illustrates the following:


The Transparent to Navy gradient background appears only in the CellRange.

226

Changing the Column Order in the Grid


To change the column order in the grid, drag the column to the new position in the grid or use the
C1FlexGrid Column Editor, or set the MoveRange method in code.

In the Designer
1.

In the grid, select the column you would like to move. In this example, the Element column
will be moved.

227

2.

Click and drag the column to the left. A vertical dotted line appears where the column can
be dropped.

3.

Drop the Element column before the AtomicNumber column.

Alternatively, columns can be reordered in the grid using the C1FlexGrid Column Editor:
1.
2.
3.
4.
5.

Open the C1FlexGrid Column Editor. For details on how to access the C1FlexGrid
Column Editor, see Accessing the C1FlexGrid Column Editor.
In the designer, select the column you would like to move. In this example, the Element
column will be moved.
Click and drag the column to the left. A vertical dotted line appears where the column can
be dropped.
Drop the Element column before the AtomicNumber column.
Click OK to close the editor.

In Code
Add the following code to the Form_Load event to move Column 2 (the Element column in this
example) to the Column 1 position:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Cols.MoveRange(2, 1, 1)
To write code in C#

228

C#

Copy Code

this.c1FlexGrid1.Cols.MoveRange(2, 1, 1);

This topic illustrates the following:


The Element column now appears before the AtomicNumber column in the grid.

Filtering by Value
To use the ValueFilter, follow these steps:
1.
2.
3.
4.

Select the grid and click the smart tag to open the C1FlexGrid Tasks menu.
Select the Enable Column Filtering check box.
Click the Designer link. The C1FlexGrid Column Editor appears.
Click the drop-down arrow next to the AllowFiltering property and select ByValue.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

229

Me.C1FlexGrid1.AllowFiltering = True
Me.C1FlexGrid1.Cols(1).AllowFiltering = AllowFiltering.ByValue
To write code in C#
C#

Copy Code

this.c1FlexGrid1.AllowFiltering = true;
this.c1FlexGrid1.Cols[1].AllowFiltering = AllowFiltering.ByValue

This topic illustrates the following:


In this example, the second column is sorted by value:

Filtering by Condition
To use the ConditionFilter, follow these steps:
1.
2.
3.
4.

Select the grid and click the smart tag to open the C1FlexGrid Tasks menu.
Select the Enable Column Filtering check box.
Click the Designer link. The C1FlexGrid Column Editor appears.
Click the drop-down arrow next to the AllowFiltering property and select ByCondition.

In Code
230

Add the following code to the Form_Load event:


To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.AllowFiltering = True
Me.C1FlexGrid1.Cols(1).AllowFiltering = AllowFiltering.ByCondition
To write code in C#
C#

Copy Code

this.c1FlexGrid1.AllowFiltering = true;
this.c1FlexGrid1.Cols[1].AllowFiltering = AllowFiltering.ByCondition

This topic illustrates the following:


In this example, the second column is sorted by condition:

Changing the Filter Language


To change the language used in the column filter editor, you can use the Language property.
1.

Right-click your grid and select Properties to view the Visual Studio Properties window.

231

2.
3.
4.

Set the AllowFiltering property to True.


Click the drop-down arrow next to the Language property and select a language.
Run the project and click the drop-down arrow on one of the column headers to open the
column filter editor. The language of the column filter editor matches the language
specified in the Language property.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.AllowFiltering = True
Me.C1FlexGrid1.Language = C1.Util.Localization.Language.Danish
To write code in C#
C#

Copy Code

this.c1FlexGrid1.AllowFiltering = true;
this.c1FlexGrid1.Language = C1.Util.Localization.Language.Danish;

This topic illustrates the following:


Notice the language of the column filter editor matches the language specified in the Language
property.

232

Clearing a Tree View


To clear a tree view in C1FlexGrid, set the editable row count to zero. For additional information on
creating trees, see FlexGrid for WinForms Tutorials and Outlining and Summarizing Data.

Add 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 Clear button is clicked.
To write code in Visual Basic
Visual Basic

Copy Code

233

Me.C1FlexGrid1.Rows.Count = Me.C1FlexGrid1.Rows.Fixed
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Rows.Count = this.c1FlexGrid1.Rows.Fixed;

This topic illustrates the following:


Once the button is clicked, the tree view disappears.

Clearing C1FlexGrid
To clear C1FlexGrid, use the Clear method. The Clear method clears either the content, styles,
UserData, or all three.
The following image shows the grid before any content, styles or UserData has been cleared.

234

See Also
Clearing Content
Clearing Styles
Clearing UserData
Clearing Content, Styles, and UserData

Clearing Content
To clear the contents of C1FlexGrid, add the following Clear method. In this example, the code was
added to the Click event of the Clear Contents button.
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.Content)
To write code in C#
C#

Copy Code

235

this.c1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.Content);

This topic illustrates the following:


Clicking Clear Content clears only the contents, not the styles or UserData of the grid.

Clearing Styles
To clear the style formatting of C1FlexGrid, add the following Clear method. In this example, the
code was added to the Click event of the Clear Styles button.
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.Style)
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.Style);

236

This topic illustrates the following:


Clicking Clear Styles clears only the style formatting, not the contents or UserData of the grid.

Clearing UserData
To clear the UserData of C1FlexGrid, add the following Clear method. In this example, the code was
added to the Click event of the Clear UserData button.
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.UserData)
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.UserData);
Note that there will be no visible change to the grid when clearing UserData, since UserData only
stores data that is useful to the application.

237

Clearing Content, Styles, and UserData


To clear the contents, style formatting, and UserData of C1FlexGrid, add the following Clear
method. In this example, the code was added to the Click event of the Clear All button.
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.All)
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Clear(C1.Win.C1FlexGrid.ClearFlags.All);

This topic illustrates the following:


Clicking Clear All clears the contents, style formatting, and UserData of the grid, leaving a blank
grid.

238

Converting Column Letters to Uppercase


To convert column letters from lowercase to uppercase, add the following SetupEditor event to
your form:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_SetupEditor(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.RowColEventArgs) Handles C1FlexGrid1.SetupEditor
If Me.C1FlexGrid1.Cols(e.Col).Name = "UCASECOL" Then
Dim tb As TextBox = Me.C1FlexGrid1.Editor
tb.CharacterCasing = CharacterCasing.Upper
End If
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_SetupEditor(object sender,


C1.Win.C1FlexGrid.RowColEventArgs e)
{
if (this.c1FlexGrid1.Cols[e.Col].Name == "UCASECOL")
{
TextBox tb = this.c1FlexGrid1.Editor as TextBox;
tb.CharacterCasing = CharacterCasing.Upper;
}
}

Customizing Appearance Using Visual Styles


To customize the appearance of C1FlexGrid using Visual Styles, set the VisualStyle property to
Custom, Office2007Black, Office2007Blue, Office2007Silver, Office2010Blue, Office2010Black,
Office2010Silver, or System. This property can be set either in the designer or in code. The
following table describes each of the Visual Styles:

239

Visual Style

Description

Custom

Do not use any visual styles. Render the


control using the styles and properties
only.

Office2007Black

Do not use any visual styles. Render the


control using the styles and properties
only.

Office2007Blue

Do not use any visual styles. Render the


control using the styles and properties
only.

Office2007Silver

Render the control with an appearance


based on the Office 2007 Silver color
scheme.

System

Render the control with an appearance


based on the current system settings.

Office2010Black

Render the control with an appearance


based on the current system settings.

Office2010Silver

Render the control with an appearance


based on the Office 2010 Silver color
scheme.

Office2010Blue

Render the control with an appearance


based on the Office 2010 Blue color
scheme.

In the Designer

240

Locate the VisualStyle property in the Properties window and set it to Custom, Office2007Black,
Office2007Blue, Office2007Silver, Office2010Blue, Office2010Black, Office2010Silver, or
System. In this example, the VisualStyle property is set to Office2007Blue.

In Code
Add code to the Form_Load event to set the VisualStyle property to Custom, Office2007Black,
Office2007Blue, Office2007Silver, Office2010Blue, Office2010Black, Office2010Silver, or
System. The following code sets the VisualStyle property to Office2007Blue:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue
To write code in C#
C#

Copy Code

this.c1FlexGrid1.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;

Custom Visual Style


No visual style is applied:

Office2007Black Visual Style


The Office 2007 Black color scheme:

241

Office2007Blue Visual Style


The Office 2007 Blue color scheme:

Office2007Silver Visual Style


The Office 2007 Silver color scheme.

Office2010Blue Visual Style


The Office 2010 Blue color scheme:

242

Office2010Silver Visual Style


The Office 2010 Silver color scheme:

Office2010Black Visual Style


The Office 2010 Black color scheme:

System Visual Style


The current system settings:

Entering Only Numbers in a Cell


To allow entering only numbers in a cell, use the KeyPressEdit event and set the e.Handled
parameter to True for the invalid keys. Use the following code to set the fourth column to accept
only numbers, BACKSPACE, DELETE, and the PERIOD keys:
To write code in Visual Basic

243

Visual Basic

Copy Code

Private Sub C1FlexGrid1_KeyPressEdit(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.KeyPressEditEventArgs) Handles C1FlexGrid1.KeyPressEdit
If e.Col = 3 Then
' If not the characters 0-9, PERIOD, DELETE, or BACKSPACE.
If Not (e.KeyChar = Chr(48) Or e.KeyChar = Chr(49) Or _
e.KeyChar = Chr(50) Or e.KeyChar = Chr(51) Or _
e.KeyChar = Chr(52) Or e.KeyChar = Chr(53) Or _
e.KeyChar = Chr(54) Or e.KeyChar = Chr(55) Or _
e.KeyChar = Chr(56) Or e.KeyChar = Chr(57) Or _
e.KeyChar = Chr(46) Or e.KeyChar = Chr(127) Or _
e.KeyChar = Chr(8)) Then
' Stop the character from being entered into the
' control since it is an invalid key.
e.Handled = True
End If
End If
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_KeyPressEdit(object sender,


C1.Win.C1FlexGrid.KeyPressEditEventArgs e)
{
if( e.Col == 3 )
{
// If not the characters 0-9, PERIOD, DELETE, or BACKSPACE.
if( !((e.KeyChar == 48) || (e.KeyChar == 49) ||
(e.KeyChar == 50) || (e.KeyChar == 51) || (e.KeyChar == 52) ||
(e.KeyChar == 53) || (e.KeyChar == 54) || (e.KeyChar == 55) ||
(e.KeyChar == 56) || (e.KeyChar == 57) || (e.KeyChar == 46) ||
(e.KeyChar == 127) || (e.KeyChar == 8)))

244

// Stop the character from being entered into the


// control since it is an invalid key.
e.Handled = true;
}
}

Formatting Cells
Formatting cells allows you to control the accessibility and appearance of data in a single cell or
multiple cells. The following topics show you how to set cells to be read-only, format a cell to
display currency values, and format cells based on their contents.

See Also
Formatting a Cell as Read-Only
Formatting a Cell with Decimal Content
Formatting Cells Based on the Contents

Formatting a Cell as Read-Only


To make a single cell or multiple cells read-only, use the BeforeEdit event.

Single Cell Read-Only


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:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_BeforeEdit(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.RowColEventArgs) Handles C1FlexGrid1.BeforeEdit
If e.Row = 1 And e.Col = 1 Then
e.Cancel = True
End If
End Sub
To write code in C#

245

C#

Copy Code

private void c1FlexGrid1_BeforeEdit(object sender,


C1.Win.C1FlexGrid.RowColEventArgs e)
{
if (e.Row == 1 & e.Col == 1)
{
e.Cancel = true;
}
}

Multiple Cell Read-Only


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 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:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_BeforeEdit(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.RowColEventArgs) Handles C1FlexGrid1.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
To write code in C#
C#

Copy Code

246

{
for (int i = 1; i <= 9; i++)
{
if (e.Col == 1 & e.Row == i)
{
e.Cancel = true;
}
}
}

This topic illustrates the following:


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

Formatting a Cell with Decimal Content


To format a cell that contains decimal numbers, set the Format property either in the designer or in
code. In this example, numbers already entered in the first column will be formatted to a decimal
amount.

In the Designer
1.
2.
3.
4.

Select Column 1 in the grid. This will open the Column Tasks menu for Column 1.
Click the ellipsis button in the Format String box to open the Format String dialog box.
Under Format type select Custom and set the Custom format to $#,##0.00.
Click OK to close the Format String dialog box.

Alternatively, the Format property can also be set using the C1FlexGrid Column Editor:
1.

Open the C1FlexGrid Column Editor. For details on how to access the C1FlexGrid
Column Editor, see Accessing the C1FlexGrid Column Editor.

247

2.
3.

Select Column 1 from the right pane and set the Format property to $#,##0.00 in the left
pane.
Click OK to close the editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Cols(1).Format = "$#,##0.00"
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Cols[1].Format = "$#,##0.00";
Note: The format specifier follows the standard .NET conventions. Use ',' for thousand
separators and '.' for the decimal, regardless of locale.

This topic illustrates the following:


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

248

Formatting Cells Based on the Contents


To conditionally format cells based on the contents, create a new style and use the CellChanged
event.
1.

Create a new CellStyle called LargeValue and set the BackColor property to Gold.
In the Designer
o
o
o
o
o
o
o
o

Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid
Style Editor, see Accessing the C1FlexGrid Style Editor.
Click Add to create a new style.
Double-click CustomStyle1, rename it LargeValue, and press ENTER when
finished.
Locate the BackColor property in the right pane and set it to Gold.
Locate the Font property and click the ellipsis button next to it to open the Font
dialog box.
Set the Font style box to Italic.
Click OK to close the Font dialog box.
Click OK to close the C1FlexGrid Style Editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

249

' Create a custom style for large values.


Dim cs As C1.Win.C1FlexGrid.CellStyle
cs = Me.C1FlexGrid1.Styles.Add("LargeValue")
cs.Font = New Font(Font, FontStyle.Italic)
cs.BackColor = Color.Gold
To write code in C#
C#

Copy Code

// Create a custom style for large values.


C1.Win.C1FlexGrid.CellStyle cs;
cs = this.c1FlexGrid1.Styles.Add("LargeValue");
cs.Font = new Font(Font, FontStyle.Italic);
cs.BackColor = Color.Gold;
2.

Use the CellChanged event to format the cells based on the contents:
To write code in Visual Basic
Visual Basic

Copy Code

' Format cells based on their content.


Private Sub C1FlexGrid1_CellChanged(ByVal sender As Object, ByVal e As
C1.Win.C1FlexGrid.RowColEventArgs) Handles C1FlexGrid1.CellChanged
' Mark currency values > 50,000 as LargeValues.
' Reset others by setting their Style to Nothing.
Dim cs As C1.Win.C1FlexGridCellStyle
If Val(Me.C1FlexGrid1(e.Row, e.Col)) >= 50000 Then
cs = Me.C1FlexGrid1.Styles("LargeValue")
End If
Me.C1FlexGrid1.SetCellStyle(e.Row, e.Col, cs)
End Sub
To write code in C#

250

C#

Copy Code

// Format cells based on their content.


private void c1FlexGrid1_CellChanged(object sender,
C1.Win.C1FlexGrid.RowColEventArgs e)
{
// Mark currency values > 50,000 as LargeValues.
// Reset others by setting their Style to Nothing.
C1.Win.C1FlexGrid.CellStyle cs;
if (Val(this.c1FlexGrid1(e.Row, e.Col)) >= 50000)
{
cs = this.c1FlexGrid1.Styles("LargeValue");
}
this.c1FlexGrid1.SetCellStyle(e.Row, e.Col, cs);

This topic illustrates the following:


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

Formatting the Border Style


Formatting the border style allows you to customize the appearance of the grid. The border style
can be set for both the control and the grid.

See Also
Formatting the Border Style of the Control
Formatting the Border Style of the Grid

251

Formatting the Border Style of the Control


To format the border style of the control, set the ScrollableControl.BorderStyle property to
Fixed3D, FixedSingle, Light3D, None, or XpThemes. This property can be set either in the
designer or in code. The following table describes each of the border styles.
Border

Description

Fixed3D

A three-dimensional border. This is


the default setting.

FixedSingle

A single line border.

Light3D

A light sunken border.

None

No border.

XpThemes

A border drawn using XP themes.

In the Designer
Locate the BorderStyle property in the Properties window and set it to Fixed3D, FixedSingle,
Light3D, None, or XpThemes. In this example, the BorderStyle property is set to Fixed3D.

In Code
Add code to the Form_Load event to set the BorderStyle property to Fixed3D, FixedSingle,
Light3D, None, or XpThemes. The following code sets the BorderStyle property to Fixed3D:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.BorderStyle =
C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Fixed3D
To write code in C#
C#

Copy Code

252

this.c1FlexGrid1.BorderStyle =
C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Fixed3D;

Three-Dimensional Border
The border will be three-dimensional.

Single Line Border


The border will be a single line.

253

Light Sunken Border


The border will be light and three-dimensional.

No Border
There is no border.

254

XP Theme Border
The border will be XP themed.

Formatting the Border Style of the Grid


To format the border style of the grid, set the Style property to Dotted, Double, Fillet, Flat,
Groove, Inset, None, or Raised. This property can be set using C1FlexGrids built-in styles either in
the designer or in code. The following table describes each of the border styles.

255

Border

Description

Dotted

Dotted border.

Double

Double border.

Fillet

Fillet border.

Flat

Solid flat border.

Groove

Groove border.

Inset

Inset border.

None

No border. This is the


default setting.

Raised

Raised border.

In the Designer
1.
2.

3.

Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid Style
Editor, see Accessing the C1FlexGrid Style Editor.
Select Normal under Built-In Styles. In the right column, locate the Border property and
expand it. Set the Style property to Dotted, Double, Fillet, Flat, Groove, Inset, None, or
Raised. In this example, the Style property is set to Dotted.
Click OK to close the editor.

In Code
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Styles("Normal").Border.Style =
C1.Win.C1FlexGrid.BorderStyleEnum.Dotted
To write code in C#

256

C#

Copy Code

this.c1FlexGrid1.Styles["Normal"].Border.Style =
C1.Win.C1FlexGrid.BorderStyleEnum.Dotted;

Dotted Border
The cell border will be a dotted line.

Double Border
The cell border will be double lines.

257

Fillet Border
The cell border will be fillet.

Flat Border
The cell border will be a solid flat line.

258

Groove Border
The cell border will be grooved.

Inset Border
The cell border will be inset.

259

No Border
There is no cell border.

Raised Border
The cell border will be raised.

260

Freezing Rows and Columns


To allow the user to freeze rows and columns with the mouse, set the AllowFreezing property to
Columns to freeze only columns, Rows to freeze only rows, or Both to freeze both columns and
rows. Conversely, to disable freezing, set the AllowFreezing property to None, which is the default
setting. This property can be set either in the designer or in code.

In the Designer
Locate the AllowFreezing property in the Properties window and set it to Both.

In Code
Add the following code to the Form_Load event to set the AllowFreezing property to Both:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.AllowFreezing = C1.Win.C1FlexGrid.AllowFreezingEnum.Both
To write code in C#

261

C#

Copy Code

this.c1FlexGrid1.AllowFreezing = C1.Win.C1FlexGrid.AllowFreezingEnum.Both;

This topic illustrates the following:


When the mouse pointer becomes the lock rows

or the lock columns

icon, click and drag the

mouse over the rows or columns to freeze. In this example, the Element column is frozen and will
remain on the grid when it is scrolled to the right.

In this example, the row containing Hydrogen is frozen and will remain on the grid when it is
scrolled to the bottom.

262

Note: Setting the AllowFreezing property to Both allows both rows and columns to be frozen
at the same time, as seen in the following image.

Getting the Width of a Partially Visible Column


If you need to obtain the width of the visible part of a column that is not fully visible due to
horizontal scrolling, you can easily do so with just a few lines of code.
Suppose you have a C1FlexGrid with multiple columns and a Label control on the form. Add the
following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Dim lastCol As Integer = C1FlexGrid1.RightCol


Dim colPoint As Point = C1FlexGrid1.GetCellRect(1, lastCol).Location
Dim flexPoint As Point = New Point(C1FlexGrid1.ClientRectangle.Right,
C1FlexGrid1.ClientRectangle.Top)
Label1.Text = flexPoint.X - colPoint.X

263

To write code in C#
C#

Copy Code

int lastCol = c1FlexGrid1.RightCol;


Point colPoint = c1FlexGrid1.GetCellRect(1, lastCol).Location;
Point flexPoint = new Point(c1FlexGrid1.ClientRectangle.Right,
c1FlexGrid1.ClientRectangle.Top);
label1.Text = flexPoint.X - colPoint.X;}
When you run the project, the label will show the width of the visible part of the last visible column.
In this case, the TitleOfCourtesy column is only partially visible. The width of the part of that
column that is showing is 38.

Loading and Saving Open XML Files


You can load and save Microsoft Excel 2007 Open XML files within a C1FlexGrid control. Open XML
is an open, standards-based format introduced by Microsoft in Office 2007. Open XML files contain
a number of XML files compressed using Zip compression. Because they are compressed, Open
XML files are usually much smaller than traditional document files (such as XLS files).
By default, the Load and Save methods in C1FlexGrid select the appropriate file format
automatically based on the file extension. Any files with a "XLSX" or "ZIP" extensions are treated as
Open XML files.
The LoadGrid and SaveGrid methods also have overloads that take the file type as a parameter. This
allows you to take control over the file format and not rely on the file extension. For example, your
application may use the Open XML format for its data files, but with an extension other than

264

"XLSX". You can specify the file type as "Excel" and use the OpenXml option of the FileFlags
enumeration.

To save and load a grid as an OpenXml file, complete


the following steps:
1.

Add three buttons to the form containing the C1FlexGrid control and enter Save, Clear,
and Load in the Text property for each, respectively, in the Visual Basic Properties window.

2.

From the Designer, double-click the Save button, Button_1, and enter code in the
Button1_Click event, so it looks like the following:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Me.C1FlexGrid1.SaveGrid("C:\test\myfile.xlsx", FileFormatEnum.Excel,
FileFlags.OpenXml)
End Sub
To write code in C#
C#

Copy Code

265

private void button1_Click(object sender, EventArgs e)


{
this.c1FlexGrid1.SaveGrid(@"C:\test\myfile.xlsx",
FileFormatEnum.Excel, FileFlags.OpenXml);
}
Note: You must have the Imports or using statement at the top of your form in
order for this code to work correctly. If coding in Visual Basic, use Imports
C1.Win.C1FlexGrid. If coding in C#, use using C1.Win.C1FlexGrid;. For more
information, see the Namespaces topic.

3.

Enter the following code for the Button2_Click event to be used for the Clear button:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Me.C1FlexGrid1.Clear(ClearFlags.All)
End Sub
To write code in C#
C#

Copy Code

private void button2_Click(object sender, EventArgs e)


{
this.c1FlexGrid1.Clear(ClearFlags.All);
}
4.

Enter the following code for the Button3_Click event to be used for the Load button:
To write code in Visual Basic
Visual Basic

Copy Code

266

Private Sub button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Me.C1FlexGrid1.LoadGrid("C:\test\myfile.xlsx", FileFormatEnum.Excel,
FileFlags.OpenXml)
End Sub
To write code in C#
C#

Copy Code

private void button3_Click(object sender, EventArgs e)


{
this.c1FlexGrid1.LoadGrid(@"C:\test\myfile.xlsx",
FileFormatEnum.Excel, FileFlags.OpenXml);
}

Run the project:


1.
2.

Enter content in the grid, as desired.


Click the Save button. The grid is saved as an Open XML file with an .xlsx extension to the
"C:\test" folder. You must create this folder if it does not already exist.

3.
4.

Click the Clear button to clear the grid.


Click the Load button, and the grid you previously saved is loaded.

Populating an Unbound Grid with Data


To populate an unbound grid with data, use the grid's indexer to populate a column, row, or a
single cell. To populate a cell range, use the Data property.

267

See Also
Populating a Column with Data
Populating a Range of Cells with Data
Populating a Row with Data
Populating a Single Cell with Data

Populating a Column with Data


To populate a column with data when the form loads, set a loop with the grid's indexer to the data
to fill the column. Add the following code to the Form_Load event to set column one to zero:
To write code in Visual Basic
Visual Basic

Copy Code

Dim r As Integer
For r = C1FlexGrid1.Rows.Fixed To C1FlexGrid1.Rows.Count - 1
Me.C1FlexGrid1(r, 1) = 0
Next
To write code in C#
C#

Copy Code

int r;
for (r = c1FlexGrid1.Rows.Fixed; r <= c1FlexGrid1.Rows.Count -1;r++)
{
this.c1FlexGrid1[r, 1] = 0;
}

This topic illustrates the following:


Column one fills with zeros.

Populating a Range of Cells with Data


To populate a range of cells with data when the form loads, set the Data property of the CellRange.
Add the following code to the Form_Load event to set the Data property to zero:

268

To write code in Visual Basic


Visual Basic

Copy Code

Dim rng As C1.Win.C1FlexGrid.CellRange = Me.C1FlexGrid1.GetCellRange(1, 1, 3, 3)


rng.Data = 0
To write code in C#
C#

Copy Code

C1.Win.C1FlexGrid.CellRange rng = this.c1FlexGrid1.GetCellRange(1,1,3,3);


rng.Data = 0;

This topic illustrates the following:


The cell range fills with zeros.

Populating a Row with Data


To populate a row with data when the form loads, set a loop with the grid's indexer to the data to
fill the row. Add the following code to the Form_Load event to set column one to zero:
To write code in Visual Basic
Visual Basic

Copy Code

Dim r As Integer
For r = C1FlexGrid1.Cols.Fixed To C1FlexGrid1.Cols.Count - 1
Me.C1FlexGrid1(1, r) = 0
Next
To write code in C#
C#

Copy Code

int r;
for (r = c1FlexGrid1.Cols.Fixed; r <= c1FlexGrid1.Cols.Count -1;r++)

269

{
this.c1FlexGrid1[1, r] = 0;
}

This topic illustrates the following:


Row one fills with zeros.

Populating a Single Cell with Data


To populate a single cell with data when the form loads, set the grid's indexer to the data. Add the
following code to the Form_Load event to set the cell text:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1(3, 2) = "Cell Text"


To write code in C#
C#

Copy Code

this.c1FlexGrid1[3, 2] = "Cell Text";

This topic illustrates the following:


The text Cell Text is in the fourth row, third column.

Restricting Grid Editing


To disable editing of the entire grid, specific column or specific row, set the AllowEditing property
to False. Conversely, to allow editing, set the AllowEditing property to True, which is the default
value.

See Also
Disable Editing for the Entire Grid
Disable Editing for a Specific Column
Disable Editing for a Specific Row

270

Disable Editing for the Entire Grid


To disable editing for the entire grid, setting the AllowEditing property to False either in the
designer or in code.

In the Designer
In the C1FlexGrid Tasks menu, uncheck the Enable Editing check box.
Alternatively, locate the AllowEditing property in the Properties window and set it to False.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.AllowEditing = False
To write code in C#
C#

Copy Code

this.c1FlexGrid1.AllowEditing = false;

Disable Editing for a Specific Column


To disable editing for a specific column, set the AllowEditing property to False either in the
designer or in code.

In the Designer
1.
2.

Select the column in the grid that you would like to edit. This will open the Column Tasks
menu for that column.
Uncheck the Allow Editing check box.

Alternatively, the AllowEditing property can be set using the C1FlexGrid Column Editor:
1.

Open the C1FlexGrid Column Editor. For details on how to access the C1FlexGrid
Column Editor, see Accessing the C1FlexGrid Column Editor.

271

2.
3.

Select the column that you would like to edit from the right pane and set the AllowEditing
property to False in the left pane.
Click OK to close the editor.

In Code
Add the following code to the Form_Load event to restrict editing the AtomicMass column:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Cols("AtomicMass").AllowEditing = False
' Is the same as: Me.C1FlexGrid1.Cols(4).AllowEditing = False
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Cols["AtomicMass"].AllowEditing = false;
// Is the same as: this.c1FlexGrid1.Cols[4].AllowEditing = false;

Disable Editing for a Specific Row


To disable editing for a specific row, add the following code to the Form_Load event to set the
AllowEditing property to False. In this example, the code will restrict editing in the 6th row:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Rows(5).AllowEditing = False
To write code in C#
C#

Copy Code

272

this.c1FlexGrid1.Rows[5].AllowEditing = false;

Restricting Sorting for a Specific Column


To restrict sorting for a specific column, set the AllowSorting property to False either in the
designer or in code.

In the Designer
1.
2.

Select the column in the grid that you would like to edit. This will open the Column Tasks
menu for that column.
Uncheck the Allow Sorting check box.

Alternatively, the AllowSorting property can be set using the C1FlexGrid Column Editor:
1.
2.
3.

Open the C1FlexGrid Column Editor. For details on how to access the C1FlexGrid
Column Editor, see Accessing the C1FlexGrid Column Editor.
Select the column that you would like to edit from the right pane and set the AllowSorting
property to False in the left pane.
Click OK to close the editor.

In Code
Add the following code to the Form_Load event to restrict sorting the AtomicNumber column:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Cols("AtomicNumber").AllowSorting = False
' Is the same as: Me.C1FlexGrid1.Cols(1).AllowEditing = False
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Cols["AtomicNumber"].AllowSorting = false;
// Is the same as: this.c1FlexGrid1.Cols[1].AllowEditing = false;

273

Scaling an Image
To scale an image in a single column when the rows of the grid are resized, set the ImageAlign
property to Scale.
1.

Set the row height of the first two rows by adding the following code to the Form_Load
event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Rows(1).Height = 2 * Me.C1FlexGrid1.Rows.DefaultSize
Me.C1FlexGrid1.Rows(2).Height = 2 * Me.C1FlexGrid1.Rows.DefaultSize
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Rows[1].Height = 2 * this.c1FlexGrid1.Rows.DefaultSize;
this.c1FlexGrid1.Rows[2].Height = 2 * this.c1FlexGrid1.Rows.DefaultSize;
2.

Scale the images in the column.

In the Designer
o
o
o

Open the C1FlexGrid Column Editor. For details on how to access the C1FlexGrid
Column Editor, see Accessing the C1FlexGrid Column Editor.
Select the column that contains the images from the right pane and set the
ImageAlign property to Scale in the left pane.
Click OK to close the editor.

In Code
Add the following code after the code in step 1:
To write code in Visual Basic
Visual Basic

Copy Code

274

Me.C1FlexGrid1.Cols(3).ImageAlign = C1.Win.C1FlexGrid.ImageAlignEnum.Scale
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Cols[3].ImageAlign = C1.Win.C1FlexGrid.ImageAlignEnum.Scale;

This topic illustrates the following:


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

See Also
Scaling Images in the Entire Grid

Scaling Images in the Entire Grid


To scale the images in the entire grid, not just one column, set the ImageAlign property for the
Normal style to Scale.

In the Designer
1.
2.
3.
4.

Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid Style
Editor, see Accessing the C1FlexGrid Style Editor.
Select Normal in the Built-In Styles list.
In the right pane, locate the ImageAlign property and set it to Scale.
Click OK to close the editor.

275

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Styles("Normal").ImageAlign =
C1.Win.C1FlexGrid.ImageAlignEnum.Scale
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Styles["Normal"].ImageAlign =
C1.Win.C1FlexGrid.ImageAlignEnum.Scale;

Searching for Entries in a Column


To search for entries in a column as a user types, set the AutoSearch property to FromCursor to
begin the search from the current row or FromTop to begin the search from the first scrollable row.
Conversely, to disable the search, set the AutoSearch property to None, which is the default setting.
This property can be set either in the designer or in code.

In the Designer
Locate the AutoSearch property in the Properties window and set it to FromTop.

In Code
Add the following code to the Form_Load event to set the AutoSearch property to FromTop:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.AutoSearch = C1.Win.C1FlexGrid.AutoSearchEnum.FromTop

276

To write code in C#
C#

Copy Code

this.c1FlexGrid1.AutoSearch = C1.Win.C1FlexGrid.AutoSearchEnum.FromTop;

This topic illustrates the following:


As the user types, the search will highlight the cell containing that letter. In this example, tying C in
the Element column highlights Carbon.

Note: If more than one entry begins with the same letter, typing the next letter will highlight
the entry with those letters. For example, typing He in the Element column will highlight
Helium.

Setting a Cell's Value to Zero When Users Press the Delete Key
To set a cell's value to zero when a user presses the DELETE key, use C1FlexGrid's KeyDown event
to catch when the DELETE key is pressed.
Add the following KeyDown event to your form:
To write code in Visual Basic

277

Visual Basic

Copy Code

Private Sub C1FlexGrid1_KeyDown(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyEventArgs) Handles C1FlexGrid1.KeyDown
If (e.KeyCode = Keys.Delete) Then
C1FlexGrid1(C1FlexGrid1.Row, C1FlexGrid1.Col) = 0
End If
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_KeyDown(object sender,


System.Windows.Forms.KeyDownEventArgs e)
{
if (e.KeyCode == Keys.Delete)
{
c1FlexGrid1(c1FlexGrid1.Row, c1FlexGrid1.Col) = 0;
}
}

Setting Rows As Headers


To set rows as headers, set the Caption and DataType properties for each row.
1.

Add the following code to the Form_Load event to set the number of rows and columns to
appear in the grid.
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Cols.Count = 5
Me.C1FlexGrid1.Rows.Count = 7
To write code in C#

278

C#

Copy Code

this.c1FlexGrid1.Cols.Count = 5;
this.c1FlexGrid1.Rows.Count = 7;
2.

Add the rows to the RowCollection:


To write code in Visual Basic
Visual Basic

Copy Code

Dim row As C1.Win.C1FlexGrid.RowCollection = Me.C1FlexGrid1.Rows


To write code in C#
C#

Copy Code

C1.Win.C1FlexGrid.RowCollection row = this.c1FlexGrid1.Rows;


3.

Set the Caption and DataType for each row.


To write code in Visual Basic
Visual Basic

Copy Code

row(1).Caption = "Date"
row(1).DataType = GetType(DateTime)
row(2).Caption = "Contact"
row(2).DataType = GetType(String)
row(3).Caption = "Phone"
row(3).DataType = GetType(String)
row(3).EditMask = "(999) 999-9999;*"
row(4).Caption = "Platform"

279

row(4).DataType = GetType(String)
row(4).ComboList = "|Windows XP|Windows 2000|Windows ME|Windows NT|Windows
98|Windows 95"
row(5).Caption = "Error Code"
row(5).DataType = GetType(Integer)
row(6).Caption = "Resolved"
row(6).DataType = GetType(Boolean)
To write code in C#
C#

Copy Code

row[1].Caption = "Date";
row[1].DataType = typeof(DateTime);
row[2].Caption = "Contact";
row[2].DataType = typeof(string);
row[3].Caption = "Phone";
row[3].DataType = typeof(string);
row[3].EditMask = "(999) 999-9999;*";
row[4].Caption = "Platform";
row[4].DataType = typeof(string);
row[4].ComboList = "|Windows XP|Windows 2000|Windows ME|Windows NT|Windows
98|Windows 95";
row[5].Caption = "Error Code";
row[5].DataType = typeof(int);
row[6].Caption = "Resolved";
row[6].DataType = typeof(bool);
4.

Format the headers to Tahoma, 9pt, Bold font.


To write code in Visual Basic

280

Visual Basic

Copy Code

Me.C1FlexGrid1.Styles("Fixed").Font = New Font("Tahoma", 9, FontStyle.Bold)


To write code in C#
C#

Copy Code

this.c1FlexGrid1.Styles["Fixed"].Font = new Font("Tahoma", 9, FontStyle.Bold);


5.

Merge the fixed row and add a header to it:


To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.FixedOnly
row(0).AllowMerging = True
Dim rng As C1.Win.C1FlexGrid.CellRange = C1FlexGrid1.GetCellRange(0, 1, 0, 4)
rng.Data = "Call Log"
To write code in C#
C#

Copy Code

this.c1FlexGrid1.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.FixedOnly;
row[0].AllowMerging = true;
C1.Win.C1FlexGrid.CellRange rng = c1FlexGrid1.GetCellRange(0,1,0,4);
rng.Data = "Call Log";

This topic illustrates the following:


The row headers appears in the first column and the each row will be formatted according to its
DataType property.

281

Setting the Background Color of Columns and Rows


To set the background color of columns and rows, create a new style and assign it to a column and
row.

Setting the Background Color of Columns


1.

Create a new style for the column.


In the Designer
o
o
o
o

Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid
Style Editor, see Accessing the C1FlexGrid Style Editor.
Click Add to create a new style.
Double-click CustomStyle1, rename it ColumnColor, and press ENTER when
finished.
Do not exit the C1FlexGrid Style Editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

282

Dim cc As C1.Win.C1FlexGrid.CellStyle
cc = Me.C1FlexGrid1.Styles.Add("ColumnColor")
To write code in C#
C#

Copy Code

C1.Win.C1FlexGrid.CellStyle cc = this.c1FlexGrid1.Styles.Add("ColumnColor");
2.

Set the BackColor color to CornSilk.


In the Designer
o
o

In the C1FlexGrid Style Editor, locate the BackColor property in the right pane
and set it to CornSilk.
Click OK to close the C1FlexGrid Style Editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

cc.BackColor = Color.Cornsilk
To write code in C#
C#

Copy Code

cc.BackColor = Color.Cornsilk;
3.

Assign the style to a column by adding the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

283

Me.C1FlexGrid1.Cols(2).Style = Me.C1FlexGrid1.Styles("ColumnColor")
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Cols[2].Style = this.c1FlexGrid1.Styles["ColumnColor"];

This topic illustrates the following:


The background color of the Element column is set to CornSilk.

Setting the Background Color of Rows


1.

Create a new style for the row.


In the Designer
o
o
o
o

Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid
Style Editor, see Accessing the C1FlexGrid Style Editor.
Click Add to create a new style.
Double-click CustomStyle1, rename it RowColor, and press ENTER when finished.
Do not exit the C1FlexGrid Style Editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Dim rs As C1.Win.C1FlexGrid.CellStyle
rs = Me.C1FlexGrid1.Styles.Add("RowColor")
To write code in C#
C#

Copy Code

284

C1.Win.C1FlexGrid.CellStyle rs = this.c1FlexGrid1.Styles.Add("RowColor");
2.

Set the BackColor to PowderBlue.


In the Designer
o
o

In the C1FlexGrid Style Editor, locate the BackColor property and set it to
PowderBlue.
Click OK to close the C1FlexGrid Style Editor.

In Code
To write code in Visual Basic
Visual Basic

Copy Code

rs.BackColor = Color.PowderBlue
To write code in C#
C#

Copy Code

rs.BackColor = Color.PowderBlue;
3.

Assign the style to a row by adding the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Rows(8).Style = Me.C1FlexGrid1.Styles("RowColor")
To write code in C#
C#

Copy Code

285

this.c1FlexGrid1.Rows[8].Style = this.c1FlexGrid1.Styles["RowColor"];

This topic illustrates the following:


The background color of the row is set to PowderBlue. Notice how the column color takes
precedence over the row color.

See Also
Setting the Background Color of Rows and Columns in a Single Statement

Setting the Background Color of Rows and Columns in a Single Statement


To set the background color of rows and columns in a single statement, add the following code to
the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Cols(2).StyleNew.BackColor = Color.Cornsilk
Me.C1FlexGrid1.Rows(8).StyleNew.BackColor = Color.PowderBlue
To write code in C#

286

C#

Copy Code

this.c1FlexGrid1.Cols[2].StyleNew.BackColor = Color.Cornsilk;
this.c1FlexGrid1.Rows[8].StyleNew.BackColor = Color.PowderBlue;

This topic illustrates the following:


The single line of code produces the same result as creating a new style and assigning it to a row.
However, using a single statement only changes the row or column it is set to. To apply a style to
multiple columns or rows, create a new style and set it to the columns or rows as in Setting the
Background Color of Columns and Rows.

Setting the Font of a Single Cell


To set the font of a single cell, create a new style and assign it to a cell.
1.

Create a new style.


In the Designer
o
o
o
o

Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid Style
Editor, see Accessing the C1FlexGrid Style Editor.
Click Add to create a new style.
Double-click CustomStyle1, rename it myStyle, and press ENTER when finished.
Do not exit the C1FlexGrid Style Editor.

287

In Code
To write code in Visual Basic
Visual Basic

Copy Code

Dim cs As C1.Win.C1FlexGrid.CellStyle
cs = Me.C1FlexGrid1.Styles.Add("myStyle")
To write code in C#
C#

Copy Code

C1.Win.C1FlexGrid.CellStyle cs = this.c1FlexGrid1.Styles.Add("myStyle");
2.

Set the font to Tahoma, 10 pt, Bold.


In the Designer
o
o
o
o
o

In the C1FlexGrid Style Editor, locate the Font property in the right pane and click
the ellipsis button. The Font dialog will appear.
Set the Font box to Tahoma.
Set the Font style box to Bold.
Set the Size box to 10.
Click OK to close the Font dialog box, but do not exit the C1FlexGrid Style Editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

cs.Font = New Font("Tahoma", 10, FontStyle.Bold)


To write code in C#

288

C#

Copy Code

cs.Font = new Font("Tahoma", 10, FontStyle.Bold);


3.

Set the font color to Blue.


In the Designer
o
o

In the C1FlexGrid Style Editor, locate the ForeColor property in the right pane
and set it to Blue.
Click OK to close the C1FlexGrid Style Editor.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

cs.ForeColor = Color.Blue
To write code in C#
C#

Copy Code

cs.ForeColor = Color.Blue;
4.

Assign the style to a cell by adding the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.SetCellStyle(6, 2, "myStyle")
To write code in C#

289

C#

Copy Code

this.c1FlexGrid1.SetCellStyle(6, 2, "myStyle");

This topic illustrates the following:


Carbon appears in Blue, Bold, 10 pt, Tahoma font.

Setting the Text Delimiting Character in C1FlexGrid


To set the text delimiting character in C1FlexGrid, set the Split method.
Add the following code to the Form_Load event to set the delimiting character to a semicolon:
To write code in Visual Basic
Visual Basic

Copy Code

Dim cols As String = "Product;Region;Salesperson;Sales;Bonus"


Dim colNames As String() = cols.Split(";")
Me.C1FlexGrid1.Cols.Count = 5
Me.C1FlexGrid1.Cols.Fixed = 0

290

Dim i%
For i = 0 To Me.C1FlexGrid1.Cols.Count - 1
Me.C1FlexGrid1(0, i) = colNames(i)
Me.C1FlexGrid1.Cols(i).Name = colNames(i)
Next
To write code in C#
C#

Copy Code

string cols = "Product;Region;Salesperson;Sales;Bonus";


string[] colNames = cols.Split(new char[] { ';' });
this.c1FlexGrid1.Cols.Count = 5;
this.c1FlexGrid1.Cols.Fixed = 0;
for (int i = 0; i >= this.c1FlexGrid1.Cols.Count - 1; i++)
{
this.c1FlexGrid1[0, i] = colNames[i];
this.c1FlexGrid1.Cols[i].Name = colNames[i];
}

This topic illustrates the following:


The string in the Split method determines the delimiting character. Changing the semicolon to a
comma in both the Split method and the string will produce the same output as the semicolon.

Sorting Multiple Columns


To sort multiple columns, set each column's Sort property and use the Sort method to sort
according to the column settings.
1.

Add the following code to the Form_Load event to set the second column to sort in
ascending order and the third column to sort in descending order.
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Cols(1).Sort = C1.Win.C1FlexGrid.SortFlags.Ascending
Me.C1FlexGrid1.Cols(2).Sort = C1.Win.C1FlexGrid.SortFlags.Descending

291

To write code in C#
C#

Copy Code

this.c1FlexGrid1.Cols[1].Sort = C1.Win.C1FlexGrid.SortFlags.Ascending;
this.c1FlexGrid1.Cols[2].Sort = C1.Win.C1FlexGrid.SortFlags.Descending;
2.

Add the following Sort method to sort according to the settings in columns two and three.
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Sort(C1.Win.C1FlexGrid.SortFlags.UseColSort, 1, 2)
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Sort(C1.Win.C1FlexGrid.SortFlags.UseColSort, 1, 2);

This topic illustrates the following:


Your grid will look like the following with the second column sorted in ascending order, then the
third column in descending order. In this example, Neon appears before Argon in the Element
column since the grid is sorted first by the StandardState column in ascending order, then by the
Element column in descending order.

292

Undoing a Sort
To undo a sort in C1FlexGrid when the grid is bound to a DataTable, set the DefaultView property
to null.
Add the following code to the Button1_Click event:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
CustTable.DefaultView.Sort = ""
End Sub
To write code in C#
C#

Copy Code

private void Button1_Click(object sender, System.EventArgs e)


{
CustTable.DefaultView.Sort = "";

293

}
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.

This topic illustrates the following:


Click the Last Name column to sort on it.

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

Using Password Entries in C1FlexGrid


To show placeholder characters (*) in cells used for password entry, use the SetupEditor event.
1.

Create a column for passwords in the grid and set the draw mode:
To write code in Visual Basic

294

Visual Basic

Copy Code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.C1FlexGrid1.Cols(0).Width = Me.C1FlexGrid1.Rows(0).HeightDisplay
Me.C1FlexGrid1.ShowCursor = True
Me.C1FlexGrid1.Cols(1).Caption =((Me.C1FlexGrid1.Cols(1).Name) = "Password")
Me.C1FlexGrid1.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw
End Sub
To write code in C#
C#

Copy Code

{
this.c1FlexGrid1.Cols[0].Width = this.c1FlexGrid1.Rows[0].HeightDisplay;
this.c1FlexGrid1.ShowCursor = true;
this.c1FlexGrid1.Cols[1].Caption = this.c1FlexGrid1.Cols[1].Name =
"Password";
this.c1FlexGrid1.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw;
}
2.

Add the following code for the SetupEditor event. This code will hide characters that are
entered by the user.
To write code in Visual Basic
Visual Basic

Copy Code

Visual Basic
Private Sub C1FlexGrid1_SetupEditor(ByVal sender As Object, ByVal e As
C1.Win.C1FlexGrid.RowColEventArgs) Handles C1FlexGrid1.SetupEditor
Dim tb As TextBox = Me.C1FlexGrid1.Editor
If Not (tb Is Nothing) Then
If Me.C1FlexGrid1.Cols(e.Col).Name = "Password" Then
tb.PasswordChar = "*"c

295

Else
tb.PasswordChar = CChar(0)
End If
End If
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_SetupEditor(object sender,


C1.Win.C1FlexGrid.RowColEventArgs e)
{
TextBox tb = this.c1FlexGrid1.Editor as TextBox;
if (tb != null)
{
if (this.c1FlexGrid1.Cols[e.Col].Name == "Password")
tb.PasswordChar = '*';
else
tb.PasswordChar = (char)0;
}
}

This topic illustrates the following:


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

See Also

296

Hiding Characters Already Entered

Hiding Characters Already Entered


To hide the characters that have already been entered and do not need edited, use the
OwnerDrawCell event.
1.

Add the following code for the OwnerDrawCell event. This code will hide the characters
that have already been entered and do not need edited.
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub C1FlexGrid1_OwnerDrawCell(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles C1FlexGrid1.OwnerDrawCell
If e.Row >= Me.C1FlexGrid1.Rows.Fixed And Me.C1FlexGrid1.Cols(e.Col).Name =
"Password" Then
e.Text = New String("*"c, e.Text.Length)
End If
End Sub
To write code in C#
C#

Copy Code

private void c1FlexGrid1_OwnerDrawCell(object sender,


C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
{
if (e.Row >= this.c1FlexGrid1.Rows.Fixed &&
this.c1FlexGrid1.Cols[e.Col].Name == "Password")
{
e.Text = new string('*', e.Text.Length);
}
}
2.

Add the following code to the Form_Load event:


To write code in Visual Basic

297

Visual Basic

Copy Code

Me.C1FlexGrid1(1, 1) = "123456"
To write code in C#
C#

Copy Code

this.c1FlexGrid1[1,1] = "123456";

This topic illustrates the following:


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

Word Wrapping in a Header or Fixed Row


To set word wrapping in a header or fixed row, set the Height and WordWrap properties.
1.

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


In the Designer
o
o

Select a column in the grid. This will open the Column Tasks menu for that
column.
In the Column Caption box, enter Word Wrapping in Header.

Alternatively, the Caption property can also be set using the C1FlexGrid Column Editor.
o

Open the C1FlexGrid Column Editor. For details on how to access the C1FlexGrid
Column Editor, see Accessing the C1FlexGrid Column Editor.

298

o
o

Select a column in the right pane and set the Caption property in the left pane to
Word Wrapping in Header.
Click OK to close the editor.

In Code
Add the following code to the Form_Load event.
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Cols(1).Caption = "Word Wrapping in Header"


To write code in C#
C#

Copy Code

this.c1FlexGrid1.Cols[1].Caption = "Word Wrapping in Header";


2.

Set the row height of the header.


To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Rows(0).Height = 3 * Me.C1FlexGrid1.Rows.DefaultSize
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Rows[0].Height = 3 * this.c1FlexGrid1.Rows.DefaultSize;
3.

Enable word wrapping for the fixed cells.


In the Designer

299

o
o
o
o

Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid
Style Editor, see Accessing the C1FlexGrid Style Editor.
Select Fixed in the Built-In Styles list.
Locate the WordWrap property in the right pane and set it to True.
Click OK to close the designer.

In Code
Add the following code to the Form_Load event:
To write code in Visual Basic
Visual Basic

Copy Code

Me.C1FlexGrid1.Styles("Fixed").WordWrap = True
To write code in C#
C#

Copy Code

this.c1FlexGrid1.Styles["Fixed"].WordWrap = true;

This topic illustrates the following:


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

FlexGrid for WinForms Top Tips


The following tips were compiled from frequently asked user questions posted in the C1FlexGrid
forum.

300

Tip 1: Use the BeginUpdate/EndUpdate Methods to


Increase Performance
Every time a cell value is changed, or rows and columns are added or removed from the grid, some
calculations are performed in order to recalculate the grid layout and update the display.
You can increase performance significantly by enclosing the changes in calls to the BeginUpdate
and EndUpdate methods. For example:
To write code in Visual Basic
Visual Basic

Copy Code

' call BeginUpdate before updating the grid.


_flex. BeginUpdate()
' Make the changes.
Try
Dim r As Integer = 0
Do While (r < _flex.Rows.Count)
Dim c As Integer = 0
Do While (c < _flex.Cols.Count)
_flex(r, c) = (r + c)
c += 1
Loop
r += 1
Loop
Finally
' Always call EndUpdate when done.
_flex.EndUpdate()
End Try
To write code in C#
C#

Copy Code

301

// call BeginUpdate before updating the grid.


_flex.BeginUpdate();
// Make the changes.
try
{
for (int r = 0; r < _flex.Rows.Count; r++)
{
for (int c = 0; c < _flex.Cols.Count; c++)
{
_flex[r, c] = r + c;
}
}
}
finally
{
// Always call EndUpdate when done.
_flex.EndUpdate();
}
Note the use of a try/finally block to ensure that the C1FlexGridBase.EndUpdate method is called
even if the update code fails and throws an exception.
Note: The BeginUpdate and EndUpdate methods were added in the 2010/v1 release of the
C1FlexGrid. In previous versions, the Redraw property was used for the same purpose. This
change was made to increase source compatibility with other controls that use the
BeginUpdate and EndUpdate pattern.

Tip 2: Use the AutoResize Property to Increase


Performance
When a bound grid retrieves data from a data source, it measures every cell and sets the column
widths so they fit all the data. This ensures the grid layout is optimal to display the data in the data
source, but it can be time-consuming if the data source is large (say more than a few thousand
rows).
In these cases, you should consider setting the AutoResize property to False and setting the
column widths in code.

302

Note: Starting with the 2010/v1 release of the C1FlexGrid, the AutoResize property defaults to
False. If your data source contains a relatively small number of items and you want the grid to
resize the columns automatically, you can either set the AutoResize property to True manually
or simply call the AutoSizeCols methods after binding or populating the grid. This change was
made to increase performance in cases where the grid is bound to large data sources.

Tip 3: Use the DrawMode Property to Assign Styles


Dynamically Based on Cell Values
The grid allows you to create cell styles and assign them to rows, columns, and arbitrary cell ranges.
You can use this capability to format cells based on their values. For example, cells that contain
negative values can display them in red.
You can do this by assigning styles to cells with the SetCellStyle method, but in this case you have
to update the style whenever the cell value changes. Also, if the grid is bound to a data source,
styles will be lost whenever the data source is reset (after sorting and filtering operations for
example).
A better alternative in these cases is to use the grid's OwnerDraw feature and select styles
dynamically, based on the cell values. For example, the code below shows negative values in red
and values above 1,000 in green:
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
' Fill a column with random values.
_flex.Cols(1).DataType = GetType(Integer)
Dim rnd As New Random
Dim r As Integer = 1
Do While (r < _flex.Rows.Count)
_flex(r, 1) = rnd.Next(-10000, 10000)
r += 1
Loop
' Create style used to show negative values.

303

_flex.Styles.Add("Red").ForeColor = Color.Red
' Create style used to show values >= 1000.
_flex.Styles.Add("Green").ForeColor = Color.Green
' Enable OwnerDraw by setting the DrawMode property.
_flex.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw
End Sub
Private Sub _flex_OwnerDrawCell(ByVal sender As Object, ByVal e As
C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles _flex.OwnerDrawCell
' Check that the row and column contain integer data.
If ((e.Row > 0) AndAlso (_flex.Cols(e.Col).DataType Is GetType(Integer)))
Then
' Get value in cell about to be painted.
Dim value As Integer = CInt(_flex(e.Row, e.Col))
If (value < 0) Then
' If the Cell value < 0, use the Red style.
e.Style = _flex.Styles("Red")
ElseIf (value >= 1000) Then
' If the Cell value >= 1000, use the Green style.
e.Style = _flex.Styles("Green")
End If
End If
End Sub
To write code in C#
C#

Copy Code

private void Form1_Load(object sender, EventArgs e)


{
// Fill a column with random values.

304

_flex.Cols[1].DataType = typeof(int);
Random rnd = new Random();
for (int r = 1; r < _flex.Rows.Count; r++)
{
_flex[r, 1] = rnd.Next(-10000, 10000);
}
// Create style used to show negative values.
_flex.Styles.Add("Red").ForeColor = Color.Red;
// Create style used to show values >= 1000.
_flex.Styles.Add("Green").ForeColor = Color.Green;
// Enable OwnerDraw by setting the DrawMode property.
_flex.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw;
_flex.OwnerDrawCell += new
C1.Win.C1FlexGrid.OwnerDrawCellEventHandler(_flex_OwnerDrawCell);
}
private void _flex_OwnerDrawCell(object sender,
C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
{
// Check that the row and column contain integer data.
if (e.Row > 0 && _flex.Cols[e.Col].DataType == typeof(int))
{
// Get value in cell about to be painted.
int value = (int)_flex[e.Row, e.Col];
if (value < 0)
{
// If the Cell value < 0, use the Red style.
e.Style = _flex.Styles["Red"];
}
else if (value >= 1000)
{
// If the Cell value >= 1000, use the Green style.

305

e.Style = _flex.Styles["Green"];
}
}
}

Tip 4: Do Not Modify Styles in the OwnerDrawCell


Event
Note that the code in Tip 3 does not modify the CellStyle object passed as a parameter in the
OwnerDrawCell event. Instead, it assigns a new value to the e.Style parameter.
That is important because the CellStyle passed to the event handler is often used by other cells. For
example, you could, unintentionally change the grid's normal style, which would affect most cells in
the grid.
The examples below illustrate the difference:
To write code in Visual Basic
Visual Basic

Copy Code

' ** CORRECT APPROACH:


Private Sub _flex_OwnerDrawCell(ByVal sender As Object, ByVal e As
C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles _flex.OwnerDrawCell
' Select style to use when painting this cell:
e.Style = MyStyleSelector(e.Row, e.Col)
End Sub
To write code in C#
C#

Copy Code

// ** CORRECT APPROACH:
private void _flex_OwnerDrawCell(object sender,
C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
{

306

// Select style to use when painting this cell:


e.Style = MyStyleSelector(e.Row, e.Col);
Contrast this with the following:
To write code in Visual Basic
Visual Basic

Copy Code

' ** WRONG APPROACH:


Private Sub _flex_OwnerDrawCell(ByVal sender As Object, ByVal e As
C1.Win.C1FlexGrid.OwnerDrawCellEventArgs) Handles _flex.OwnerDrawCell
' Select style to use when painting this cell:
' This is bad because changing any CellStyle objects invalidates the
' grid, which would cause this event handler to be called over and
' over again.
e.Style.Color = MyColorSelector(e.Row, e.Col)
End Sub
To write code in C#
C#

Copy Code

// ** WRONG APPROACH:
private void _flex_OwnerDrawCell(object sender,
C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
{
// Select style to use when painting this cell:
// This is bad because changing any CellStyle objects invalidates the
// grid, which would cause this event handler to be called over and
// over again.
e.Style.Color = MyColorSelector(e.Row, e.Col);
}

Tip 5: Use the Trimming Property to Show Ellipses in a


Single Column of the Grid
307

The Trimming property should be used to show ellipses in a single column of the grid. To
determine how long strings are trimmed to fit the cell, the Trimming property can be set to either
None, Character, Word, EllipsisCharacter, EllipsisWord, or EllipsisPath.
The following table describes each of the be trimming options:
Member Name

Description

Character

Specifies that the text is trimmed to


the nearest character.

EllipsisCharacter

Specifies that the text is trimmed to


the nearest character, and an ellipsis
is inserted at the end of a trimmed
line.

EllipsisPath

The center is removed from the


trimmed lines and replaced by an
ellipsis. The algorithm keeps as much
of the last slash-delimited segment of
the line as possible.

EllipsisWord

Specifies that the text is trimmed to


the nearest word and an ellipsis is
inserted at the end of a trimmed line.

None

Specifies no trimming.

Word

Specifies that the text is trimmed to


the nearest word.

The following code sets the Trimming property to show ellipses at the end of the second column,
with the text trimmed to the nearest character:
To write code in Visual Basic
Visual Basic

Copy Code

308

_flex.Cols(1).StyleNew.Trimming StringTrimming.EllipsisCharacter
To write code in C#
C#

Copy Code

_flex.Cols[1].StyleNew.Trimming =StringTrimming.EllipsisCharacter;

Tip 6: Use the WordWrap Property to Show Multiple


Line Text in a Cell
When showing multiple lines of text in a cell, use the WordWrap and Height properties. The
WordWrap property determines whether the grid should automatically break long strings that
contain spaces and display them in multiple lines. Strings that contain hard line breaks (vbCrLf or
"\n\r") are always displayed in multiple lines.
Multiple line text can be displayed in both fixed and scrollable cells. For an example setting multiple
line text in a fixed cell, see Word Wrapping in a Header or Fixed Row.
The following code sets display multiple line text in a scrollable cell:
To write code in Visual Basic
Visual Basic

Copy Code

' Set the WordWrap property.


_flex.Styles("Normal").WordWrap = True
' Set the row height.
_flex.Rows(1).Height = 2 * fg.Rows.DefaultSize
' Add text to the cell.
_flex(1, 2) = "This is the first line." & ControlChars.CrLf & " This is the
second line."
To write code in C#

309

C#

Copy Code

// Set the WordWrap property.


_flex.Styles["Normal"].WordWrap = true;
// Set the row height.
_flex.Rows[1].Height = 2 * fg.Rows.DefaultSize;
// Add text to the cell.
_flex[1, 2] = "This is the first line. \r\n This is the second line.";

Tip 7: Use the Sort Property to Retrieve Data Sorting


when Bound to a DataTable
If the grid is bound to a DataTable, the user can maintain the way the grid is sorted when data is
refreshed. This can be achieved by using the default view's Sort property and a sort expression.
The Sort property uses a string containing the column name followed by ASC (to sort the column
in ascending order) or DESC (to sort the column in descending order). By default, columns are
sorted in ascending order. Multiple columns can be sorted by entering each column name
separated by a comma.
A sort expression can include names of grid columns or a calculation. Setting the sort expression at
run time immediately reflects the changes in the data view.
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.ProductsTableAdapter.Fill(Me.NwindDataSet.Products)
End Sub
Private Sub btn_Sort_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn_Sort.Click
' Sort the data by the UnitsInStock column then by the ProductID column.
Me.ProductsBindingSource.Sort = "UnitsInStock ASC, ProductID ASC"

310

End Sub
Private Sub btn_ClearSort_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn_ClearSort.Click
' Clear the sort.
Me.ProductsBindingSource.Sort = ""
End Sub
To write code in C#
C#

Copy Code

private void Form1_Load(object sender, System.EventArgs e)


{
this.productsTableAdapter.Fill(this.nwindDataSet.Products);
}
private void btn_Sort_Click(object sender, EventArgs e)
{
// Sort the data by the UnitsInStock column then by the ProductID column.
this.productsBindingSource.Sort = "UnitsInStock ASC, ProductID ASC";
}
private void btn_ClearSort_Click(object sender, EventArgs e)
{
// Clear the sort.
this.productsBindingSource.Sort = "";
}
Tip 8: Control the Number of Characters to be Entered in a Column with the SetupEditor Event
To set the maximum number of characters a user can enter for any given column use the
SetupEditor event. For this example a C1TextBox has been set as the editor for C1FlexGrid. You
must declare an external editor to be used with C1FlexGrid in the StartEdit event:
To write code in Visual Basic
Visual Basic

Copy Code

311

Private Sub _flex_StartEdit(ByVal sender As System.Object, ByVal e As


C1.Win.C1FlexGrid.RowColEventArgs) Handles _flex.StartEdit
_flex.Editor = C1TextBox
End Sub
To write code in C#
C#

Copy Code

private void _flex_StartEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)


{
_flex.Editor = c1TextBox;
}
Now that you have the grid's editor set up you can use the following code to allow 20 characters to
be entered in the 3rd column and only 10 characters to be entered in the rest of the grid's columns
(remember the following code must be entered in the SetupEditor event):
To write code in Visual Basic
Visual Basic

Copy Code

Private Sub _flex_SetupEditor(ByVal sender As Object, ByVal e As


C1.Win.C1FlexGrid.RowColEventArgs) Handles _flex.SetupEditor
' Set the 3rd column to allow 20 characters and the rest only 10.
If e.Col = 2 Then
CType(fg.Editor, C1TextBox).MaxLength = 20
Else
CType(fg.Editor, C1TextBox).MaxLength = 10
End If
End Sub
To write code in C#
C#

Copy Code

312

private void _flex_SetupEditor(object sender, RowColEventArgs e)


{
// Set the 3rd column to allow 20 characters and the rest only 10.
if (e.Col == 2)
c1TextBox.MaxLength = 20;
else
c1TextBox.MaxLength = 10;
}

C1FlexGridClassic Control
C1FlexGridClassic is a control that derives from C1FlexGrid and provides an object model that is
virtually 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.

C1.Win.C1FlexGrid.4 Assembly
Overview
%%description%%
" -->

Namespaces
Namespace

Description

C1.Win.C1FlexGrid
C1.Win.C1FlexGrid.Util.BaseControls

313

Namespaces
C1.Win.C1FlexGrid Namespace
Overview

Classes
Class

Description

BeforeMouseDownEventArgs Provides data for the C1FlexGridBase.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.

C1FlexGridRenderer

Represents an abstract base class for custom grid renderers.

CellBorder

The CellBorder class encapsulates properties that control the


appearance of borders in CellStyle objects.

CellRangeCollection

Collection of CellRange 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.

ColumnFilter

Represents a filter that contains a ValueFilter and a

314

ConditionFilter.
ComboBoxEditor

Helper class that provides information about a currently active


ComboBox editor.

Condition

Represents a condition within a ConditionFilter.

ConditionFilter

Represents a filter based on one or two logical conditions.

DragRowColEventArgs

Provides data for the C1FlexGridBase.BeforeDragColumn,


C1FlexGridBase.BeforeDragRow,
C1FlexGridBase.AfterDragColumn, and
C1FlexGridBase.AfterDragRow events.

GetErrorInfoEventArgs

Provides data for the C1FlexGridBase.GetCellErrorInfo and


C1FlexGridBase.GetRowErrorInfo events.

GetLocalizedStringEventArgs Provides data for the C1FlexGridBase.GetLocalizedString


event.
GridChangedEventArgs

Provides data for the C1FlexGridBase.GridChanged event


handler.

GridErrorEventArgs

Provides data for the C1FlexGridBase.GridError event.

GridGlyphs

Represents a collection of glyphs (images) indexed by glyph


type (GlyphEnum type).

GridPrinter

Represents a class that encapsulates the control printing


functionality, including page and printer settings, headers, and
footers.

GridRendererOffice2007

Represents the base abstract class for Office2007 style renderers.

GridRendererOffice2007Black C1FlexGridRenderer that implements the Office2007 Black visual

315

style.
GridRendererOffice2007Blue

C1FlexGridRenderer that implements the Office2007 Blue visual


style.

GridRendererOffice2007Silver C1FlexGridRenderer that implements the Office2007 Silver visual


style.
GridRendererOffice2010Black C1FlexGridRenderer that implements the Office2010 Black visual
style.
GridRendererOffice2010Blue

C1FlexGridRenderer that implements the Office2010 Blue visual


style.

GridRendererOffice2010Silver C1FlexGridRenderer that implements the Office2010 Silver visual


style.
GridRendererSystem

C1FlexGridRenderer that implements the System visual style.

GridTree

The GridTree class encapsulates properties that specify the


appearance, position, and behavior of the outline tree.

KeyEditEventArgs

Provides data for the C1FlexGridBase.KeyDownEdit and


C1FlexGridBase.KeyUpEdit events.

KeyPressEditEventArgs

Provides data for the C1FlexGridBase.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).

316

OwnerDrawCellEventArgs

Provides data for the C1FlexGridBase.OwnerDrawCell event.

PrintDocumentGridRenderer

Represents an object that renders a C1FlexGrid into a paged


System.Drawing.Printing.PrintDocument.

RangeEventArgs

Provides data for the C1FlexGridBase.AfterRowColChange,


C1FlexGridBase.AfterScroll, C1FlexGridBase.AfterSelChange,
C1FlexGridBase.BeforeRowColChange,
C1FlexGridBase.BeforeScroll, and
C1FlexGridBase.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 C1FlexGridBase.AfterEdit,


C1FlexGridBase.AfterResizeColumn,
C1FlexGridBase.AfterResizeRow, C1FlexGridBase.BeforeEdit,
C1FlexGridBase.BeforePageBreak,
C1FlexGridBase.BeforeResizeColumn,
C1FlexGridBase.BeforeResizeRow,
C1FlexGridBase.ShowScrollTip,
C1FlexGridBase.CellButtonClick,
C1FlexGridBase.ComboCloseUp,
C1FlexGridBase.ComboDropDown,
C1FlexGridBase.SetupEditor, and C1FlexGridBase.StartEdit
events.

RowCollection

Collection of grid Row objects.

SortColEventArgs

Provides data for the C1FlexGridBase.BeforeSort and

317

C1FlexGridBase.AfterSort events.
SubtotalEventArgs

Provides data for the C1FlexGridBase.BeforeSubtotal and


C1FlexGridBase.AfterSubtotal events.

ToolTipEventArgs

Provides data for the C1FlexGridBase.ShowScrollTip event.

UnboundValueEventArgs

Provides data for the C1FlexGridBase.GetUnboundValue and


C1FlexGridBase.SetUnboundValue events.

ValidateEditEventArgs

Provides data for the C1FlexGridBase.ValidateEdit event.

ValueFilter

Represents a filter based on a set of values.

Interfaces
Interface

Description

IC1ColumnFilter

Interface implemented by column filter objects.

IC1ColumnFilterEditor

Interface implemented by column filter editor controls.

IC1EmbeddedEditor

Interface implemented by editors and used by the grid to host edit


controls on cells.

IC1MultiColumnDictionary Interface that extends System.Collections.IDictionary and can be


used to implement multi-column data maps.

Structures
Structure

Description

CellRange

Represents cell ranges, allowing the caller to set properties for multiple cells
with a single statement.

318

HitTestInfo

Contains information, such as the row and column indexes, about a specific
coordinate pair in the C1FlexGrid control.

Delegates
Delegate

Description

BeforeMouseDownEventHandler Represents the method that will handle the


C1FlexGridBase.BeforeMouseDown event.
DragRowColEventHandler

Represents the method that will handle the


C1FlexGridBase.BeforeDragColumn,
C1FlexGridBase.BeforeDragRow,
C1FlexGridBase.AfterDragColumn and
C1FlexGridBase.AfterDragRow events.

GetErrorInfoEventHandler

Represents the method that will handle the


C1FlexGridBase.GetCellErrorInfo and
C1FlexGridBase.GetRowErrorInfo events.

GetLocalizedStringEventHandler Represents the method that will handle the


C1FlexGridBase.GetLocalizedString event.
GridChangedEventHandler

Represents the method that will handle the


C1FlexGridBase.GridChanged event.

GridErrorEventHandler

Represents the method that will handle the


C1FlexGridBase.GridError event.

KeyEditEventHandler

Represents the method that will handle the


C1FlexGridBase.KeyDownEdit and
C1FlexGridBase.KeyUpEdit events.

KeyPressEditEventHandler

Represents the method that will handle the


C1FlexGridBase.KeyPressEdit event.

319

OwnerDrawCellEventHandler

Represents the method that will handle the


C1FlexGridBase.OwnerDrawCell event.

RangeEventHandler

Represents the method that will handle the


C1FlexGridBase.AfterRowColChange,
C1FlexGridBase.AfterScroll,
C1FlexGridBase.AfterSelChange,
C1FlexGridBase.BeforeRowColChange,
C1FlexGridBase.BeforeScroll, and
C1FlexGridBase.BeforeSelChange events.

RowColEventHandler

Represents the method that will handle the


C1FlexGridBase.AfterEdit,
C1FlexGridBase.AfterResizeColumn,
C1FlexGridBase.AfterResizeRow,
C1FlexGridBase.BeforeEdit,
C1FlexGridBase.BeforePageBreak,
C1FlexGridBase.BeforeResizeColumn,
C1FlexGridBase.BeforeResizeRow,
C1FlexGridBase.ShowScrollTip,
C1FlexGridBase.CellButtonClick,
C1FlexGridBase.ComboCloseUp,
C1FlexGridBase.ComboDropDown,
C1FlexGridBase.SetupEditor, and C1FlexGridBase.StartEdit
events.

RowColToolTipEventHandler

Represents the method that will handle the


C1FlexGridBase.ShowScrollTip event.

SortColEventHandler

Represents the method that will handle the


C1FlexGridBase.BeforeSort and C1FlexGridBase.AfterSort
events.

SubtotalEventHandler

Represents the method that will handle the


C1FlexGridBase.BeforeSubtotal and

320

C1FlexGridBase.AfterSubtotal events.
UnboundValueEventHandler

Represents the method that will handle the


C1FlexGridBase.GetUnboundValue and
C1FlexGridBase.SetUnboundValue events.

ValidateEditEventHandler

Represents the method that will handle the


C1FlexGridBase.ValidateEdit event.

Enumerations
Enumeration

Description

AggregateEnum

Specifies the type of aggregate function to calculate with the


C1FlexGridBase.Aggregate and C1FlexGridBase.Subtotal
methods.

AggregateFlags

Specifies options to use when calculating aggregates with the


C1FlexGridBase.Aggregate method.

AllowDraggingEnum

Specifies whether the user should be able to drag rows and


columns with the mouse.

AllowFiltering

Specifies the type of filter to be used for a Column.

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.

321

AutoSearchEnum

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

AutoSizeFlags

Specifies options that control auto-sizing.

BorderDirEnum

Specifies the direction of cell borders.

BorderStyleEnum

Specifies the type of cell border to display.

C1FlexGridRenderer.CellType Represents the type of cell being rendered.


CellStyleEnum

Enumeration used to retrieve CellStyle objects from the


C1FlexGridBase.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


C1FlexGridBase.Clear method.

ClipboardCopyModeEnum

Specifies what parts of the grid should be copied to the clipboard


when the C1FlexGridBase.AutoClipboard property is set to true.

ConditionOperator

Represents operators used in filter conditions.

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.

322

EditFlags

Specifies options that customize the grid's editing behavior.

FileFlags

Specifies options for use with the C1FlexGridBase.SaveGrid and


C1FlexGridBase.LoadGrid methods.

FileFormatEnum

Specifies the type of file to save or load with the


C1FlexGridBase.SaveGrid and C1FlexGridBase.LoadGrid
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 C1FlexGridBase.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.

NodeMoveEnum

Specifies the destination of nodes when they are moved with the
Node.Move method.

NodeTypeEnum

Specifies a node with respect to another given node.

PrintGridFlags

Contains flags that specify printing options to use with the


C1FlexGridBase.PrintGrid method.

ScrollFlags

Specifies options that customize scrollbar behavior.

323

SelectionModeEnum

Specifies the type of selection provided by the grid.

ShowButtonsEnum

Specifies when the grid should display combo buttons in cells.

ShowSortPositionEnum

Specifies the position of the sort glyphs within the column


header cells.

ShowThemedHeadersEnum

Specifies whether the control should use themes for displaying


row or column headers.

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


C1FlexGridBase.Subtotal 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.

VisualStyle

Specifies a visual style to use when rendering the control.

See Also
Reference
C1.Win.C1FlexGrid.4 Assembly

324

Classes
BeforeMouseDownEventArgs
Provides data for the C1FlexGridBase.BeforeMouseDown event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class BeforeMouseDownEventArgs
Inherits System.EventArgs
C#
public class BeforeMouseDownEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.BeforeMouseDownEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.BeforeMouseDown event.

Object Model

325

Syntax
Visual Basic (Declaration)
Public Class BeforeMouseDownEventArgs
Inherits System.EventArgs
C#
public class BeforeMouseDownEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.BeforeMouseDownEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by BeforeMouseDownEventArgs.

Public Constructors
Name

Description

BeforeMouseDownEventArgs Constructor Overloaded.

326

Top

Public Fields
Name

Description

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.

Gets the x-coordinate of a mouse click.

Gets the y-coordinate of a mouse click.

Top

See Also
Reference
BeforeMouseDownEventArgs Class
C1.Win.C1FlexGrid Namespace

BeforeMouseDownEventArgs Constructor

Overload List
Overload

Description

BeforeMouseDownEventArgs Constructor(MouseEventArgs)

Initializes a new instance


of the
BeforeMouseDownEventA
rgs class.

BeforeMouseDownEventArgs

Initializes a new instance

327

Constructor(C1FlexGridBase,MouseButtons,Int32)

of the
BeforeMouseDownEventA
rgs class.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Class
BeforeMouseDownEventArgs Members

BeforeMouseDownEventArgs Constructor(MouseEventArgs)
System.Windows.Forms.MouseEventArgs with mouse event information.
Initializes a new instance of the BeforeMouseDownEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal e As MouseEventArgs _
)
C#
public BeforeMouseDownEventArgs(
MouseEventArgs e
)

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

Requirements
328

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Class
BeforeMouseDownEventArgs Members
Overload List

BeforeMouseDownEventArgs Constructor(C1FlexGridBase,MouseButtons,Int32)
Control that will fire the event.
System.Windows.Forms.MouseButtons value that indicates which button was pressed.
Number of times the button was pressed and released.
Initializes a new instance of the BeforeMouseDownEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal view As C1FlexGridBase, _
ByVal buttons As MouseButtons, _
ByVal clicks As Integer _
)
C#
public BeforeMouseDownEventArgs(
C1FlexGridBase view,
MouseButtons buttons,
int clicks
)

Parameters
view
Control that will fire the event.

329

buttons
System.Windows.Forms.MouseButtons value that indicates which button was pressed.
clicks
Number of times the button was pressed and released.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Class
BeforeMouseDownEventArgs Members
Overload List

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

Public Fields
Name

Description

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.

Gets the x-coordinate of a mouse click.

Gets the y-coordinate of a mouse click.

330

Top

See Also
Reference
BeforeMouseDownEventArgs Class
C1.Win.C1FlexGrid Namespace

Button Field
Gets which mouse button was pressed.

Syntax
Visual Basic (Declaration)
Public ReadOnly Button As MouseButtons
C#
public readonly MouseButtons Button

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Class
BeforeMouseDownEventArgs Members

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

Syntax
Visual Basic (Declaration)
Public Cancel As Boolean

331

C#
public bool Cancel

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Class
BeforeMouseDownEventArgs Members

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

Syntax
Visual Basic (Declaration)
Public ReadOnly Clicks As Integer
C#
public readonly int Clicks

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Class
BeforeMouseDownEventArgs Members

332

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.

Syntax
Visual Basic (Declaration)
Public ReadOnly Delta As Integer
C#
public readonly int Delta

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Class
BeforeMouseDownEventArgs Members

X Field
Gets the x-coordinate of a mouse click.

Syntax
Visual Basic (Declaration)
Public ReadOnly X As Integer
C#
public readonly int X

Requirements

333

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Class
BeforeMouseDownEventArgs Members

Y Field
Gets the y-coordinate of a mouse click.

Syntax
Visual Basic (Declaration)
Public ReadOnly Y As Integer
C#
public readonly int Y

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventArgs Class
BeforeMouseDownEventArgs Members

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.

Object Model

334

Syntax
Visual Basic (Declaration)
Public Class C1FlexGrid
Inherits C1FlexGridBase
C#
public class C1FlexGrid : 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 }

Inheritance Hierarchy
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
C1.Win.C1FlexGrid.C1FlexGrid
C1.Win.C1FlexGrid.Classic.C1FlexGridClassic

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

335

See Also
Reference
C1FlexGrid Members
C1.Win.C1FlexGrid Namespace

Overview
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.

Object Model

Syntax
Visual Basic (Declaration)
Public Class C1FlexGrid
Inherits C1FlexGridBase
C#
public class C1FlexGrid : 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 }

Inheritance Hierarchy
336

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
C1.Win.C1FlexGrid.C1FlexGrid
C1.Win.C1FlexGrid.Classic.C1FlexGridClassic

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods Events

The following tables list the members exposed by C1FlexGrid.

Public Constructors
Name

Description

C1FlexGrid Constructor Creates a new instance of the C1FlexGrid control.


Top

Public Properties
Name

Description

AccessibilityObject

(Inherited from System.Windows.Forms.Control)

AccessibleDefaultActionDescription (Inherited from System.Windows.Forms.Control)

337

AccessibleDescription

(Inherited from System.Windows.Forms.Control)

AccessibleName

(Inherited from System.Windows.Forms.Control)

AccessibleRole

(Inherited from System.Windows.Forms.Control)

AllowMerging

Gets or sets how cells should be merged.

AllowMergingFixed

Gets or sets how non-scrollable cells should be merged.

Anchor

(Inherited from System.Windows.Forms.Control)

AutoScrollOffset

(Inherited from System.Windows.Forms.Control)

BackgroundImage

(Inherited from System.Windows.Forms.Control)

BackgroundImageLayout

(Inherited from System.Windows.Forms.Control)

BindingContext

(Inherited from System.Windows.Forms.Control)

Bottom

(Inherited from System.Windows.Forms.Control)

Bounds

(Inherited from System.Windows.Forms.Control)

CanFocus

(Inherited from System.Windows.Forms.Control)

CanSelect

(Inherited from System.Windows.Forms.Control)

Capture

(Inherited from System.Windows.Forms.Control)

CausesValidation

(Inherited from System.Windows.Forms.Control)

ClientRectangle

(Inherited from System.Windows.Forms.Control)

ClientSize

(Inherited from System.Windows.Forms.Control)

338

CompanyName

(Inherited from System.Windows.Forms.Control)

Container

(Inherited from System.ComponentModel.Component)

ContainsFocus

(Inherited from System.Windows.Forms.Control)

ContextMenu

(Inherited from System.Windows.Forms.Control)

ContextMenuStrip

(Inherited from System.Windows.Forms.Control)

Controls

(Inherited from System.Windows.Forms.Control)

Created

(Inherited from System.Windows.Forms.Control)

Cursor

(Inherited from System.Windows.Forms.Control)

DataBindings

(Inherited from System.Windows.Forms.Control)

DisplayRectangle

(Inherited from System.Windows.Forms.Control)

Disposing

(Inherited from System.Windows.Forms.Control)

Dock

(Inherited from System.Windows.Forms.Control)

Enabled

(Inherited from System.Windows.Forms.Control)

Focused

(Inherited from System.Windows.Forms.Control)

Font

(Inherited from System.Windows.Forms.Control)

Handle

(Inherited from System.Windows.Forms.Control)

HasChildren

(Inherited from System.Windows.Forms.Control)

Height

(Inherited from System.Windows.Forms.Control)

339

ImeMode

(Inherited from System.Windows.Forms.Control)

InvokeRequired

(Inherited from System.Windows.Forms.Control)

IsAccessible

(Inherited from System.Windows.Forms.Control)

IsDisposed

(Inherited from System.Windows.Forms.Control)

IsHandleCreated

(Inherited from System.Windows.Forms.Control)

IsMirrored

(Inherited from System.Windows.Forms.Control)

LayoutEngine

(Inherited from System.Windows.Forms.Control)

Left

(Inherited from System.Windows.Forms.Control)

Location

(Inherited from System.Windows.Forms.Control)

Margin

(Inherited from System.Windows.Forms.Control)

MaximumSize

(Inherited from System.Windows.Forms.Control)

MergedRanges

Gets the CellRangeCollection that determines which grid


cells are merged when the AllowMerging property is set to
AllowMergingEnum.Custom.

MinimumSize

(Inherited from System.Windows.Forms.Control)

Name

(Inherited from System.Windows.Forms.Control)

Padding

(Inherited from System.Windows.Forms.Control)

Parent

(Inherited from System.Windows.Forms.Control)

PreferredSize

(Inherited from System.Windows.Forms.Control)

340

ProductName

(Inherited from System.Windows.Forms.Control)

ProductVersion

(Inherited from System.Windows.Forms.Control)

RecreatingHandle

(Inherited from System.Windows.Forms.Control)

Region

(Inherited from System.Windows.Forms.Control)

Right

(Inherited from System.Windows.Forms.Control)

RightToLeft

(Inherited from System.Windows.Forms.Control)

Site

(Inherited from System.Windows.Forms.Control)

Size

(Inherited from System.Windows.Forms.Control)

TabIndex

(Inherited from System.Windows.Forms.Control)

TabStop

(Inherited from System.Windows.Forms.Control)

Tag

(Inherited from System.Windows.Forms.Control)

Top

(Inherited from System.Windows.Forms.Control)

TopLevelControl

(Inherited from System.Windows.Forms.Control)

UseWaitCursor

(Inherited from System.Windows.Forms.Control)

Visible

(Inherited from System.Windows.Forms.Control)

Width

(Inherited from System.Windows.Forms.Control)

Top

Public Methods

341

Name

Description

BeginInvoke

Overloaded. (Inherited from System.Windows.Forms.Control)

BringToFront

(Inherited from System.Windows.Forms.Control)

Clear

Overloaded. Overridden. Overridden to clear merged ranges.

Contains

(Inherited from System.Windows.Forms.Control)

CreateControl

(Inherited from System.Windows.Forms.Control)

CreateGraphics

(Inherited from System.Windows.Forms.Control)

CreateObjRef

(Inherited from System.MarshalByRefObject)

Dispose

(Inherited from System.ComponentModel.Component)

DoDragDrop

(Inherited from System.Windows.Forms.Control)

DrawToBitmap

(Inherited from System.Windows.Forms.Control)

EndInvoke

(Inherited from System.Windows.Forms.Control)

FindForm

(Inherited from System.Windows.Forms.Control)

Focus

(Inherited from System.Windows.Forms.Control)

GetChildAtPoint

Overloaded. (Inherited from System.Windows.Forms.Control)

GetContainerControl

(Inherited from System.Windows.Forms.Control)

GetLifetimeService

(Inherited from System.MarshalByRefObject)

GetMergedRange

Overloaded. Returns the merged range of cells that includes a

342

given cell.
GetNextControl

(Inherited from System.Windows.Forms.Control)

GetPreferredSize

(Inherited from System.Windows.Forms.Control)

Hide

(Inherited from System.Windows.Forms.Control)

InitializeLifetimeService

(Inherited from System.MarshalByRefObject)

Invalidate

Overloaded. Overridden. Invalidates a cell range, causing it to be


repainted.

Invoke

Overloaded. (Inherited from System.Windows.Forms.Control)

IsCellCursor

Overridden. Gets a value that determines if a cell contains the grid


cursor.

IsCellHighlighted

Overridden. Gets a value that determines if a cell is part of the


selection and should be highlighted.

PerformLayout

Overloaded. (Inherited from System.Windows.Forms.Control)

PointToClient

(Inherited from System.Windows.Forms.Control)

PointToScreen

(Inherited from System.Windows.Forms.Control)

PreProcessControlMessage (Inherited from System.Windows.Forms.Control)


PreProcessMessage

(Inherited from System.Windows.Forms.Control)

RectangleToClient

(Inherited from System.Windows.Forms.Control)

RectangleToScreen

(Inherited from System.Windows.Forms.Control)

343

Refresh

(Inherited from System.Windows.Forms.Control)

ResetText

(Inherited from System.Windows.Forms.Control)

ResumeLayout

Overloaded. (Inherited from System.Windows.Forms.Control)

Scale

(Inherited from System.Windows.Forms.Control)

SelectNextControl

(Inherited from System.Windows.Forms.Control)

SendToBack

(Inherited from System.Windows.Forms.Control)

SetBounds

Overloaded. (Inherited from System.Windows.Forms.Control)

Show

(Inherited from System.Windows.Forms.Control)

SuspendLayout

(Inherited from System.Windows.Forms.Control)

ToString

(Inherited from System.ComponentModel.Component)

Update

(Inherited from System.Windows.Forms.Control)

Top

Public Events
Name

Description

BackColorChanged

(Inherited from System.Windows.Forms.Control)

BackgroundImageChanged

(Inherited from System.Windows.Forms.Control)

BackgroundImageLayoutChanged (Inherited from System.Windows.Forms.Control)


BindingContextChanged

(Inherited from System.Windows.Forms.Control)

344

CausesValidationChanged

(Inherited from System.Windows.Forms.Control)

ChangeUICues

(Inherited from System.Windows.Forms.Control)

Click

(Inherited from System.Windows.Forms.Control)

ClientSizeChanged

(Inherited from System.Windows.Forms.Control)

ContextMenuChanged

(Inherited from System.Windows.Forms.Control)

ContextMenuStripChanged

(Inherited from System.Windows.Forms.Control)

ControlAdded

(Inherited from System.Windows.Forms.Control)

ControlRemoved

(Inherited from System.Windows.Forms.Control)

CursorChanged

(Inherited from System.Windows.Forms.Control)

Disposed

(Inherited from System.ComponentModel.Component)

DockChanged

(Inherited from System.Windows.Forms.Control)

DoubleClick

(Inherited from System.Windows.Forms.Control)

DragDrop

(Inherited from System.Windows.Forms.Control)

DragEnter

(Inherited from System.Windows.Forms.Control)

DragLeave

(Inherited from System.Windows.Forms.Control)

DragOver

(Inherited from System.Windows.Forms.Control)

EnabledChanged

(Inherited from System.Windows.Forms.Control)

Enter

(Inherited from System.Windows.Forms.Control)

345

FontChanged

(Inherited from System.Windows.Forms.Control)

ForeColorChanged

(Inherited from System.Windows.Forms.Control)

GiveFeedback

(Inherited from System.Windows.Forms.Control)

GotFocus

(Inherited from System.Windows.Forms.Control)

HandleCreated

(Inherited from System.Windows.Forms.Control)

HandleDestroyed

(Inherited from System.Windows.Forms.Control)

HelpRequested

(Inherited from System.Windows.Forms.Control)

ImeModeChanged

(Inherited from System.Windows.Forms.Control)

Invalidated

(Inherited from System.Windows.Forms.Control)

KeyDown

(Inherited from System.Windows.Forms.Control)

KeyPress

(Inherited from System.Windows.Forms.Control)

KeyUp

(Inherited from System.Windows.Forms.Control)

Layout

(Inherited from System.Windows.Forms.Control)

Leave

(Inherited from System.Windows.Forms.Control)

LocationChanged

(Inherited from System.Windows.Forms.Control)

LostFocus

(Inherited from System.Windows.Forms.Control)

MarginChanged

(Inherited from System.Windows.Forms.Control)

MouseCaptureChanged

(Inherited from System.Windows.Forms.Control)

346

MouseClick

(Inherited from System.Windows.Forms.Control)

MouseDoubleClick

(Inherited from System.Windows.Forms.Control)

MouseDown

(Inherited from System.Windows.Forms.Control)

MouseEnter

(Inherited from System.Windows.Forms.Control)

MouseHover

(Inherited from System.Windows.Forms.Control)

MouseLeave

(Inherited from System.Windows.Forms.Control)

MouseMove

(Inherited from System.Windows.Forms.Control)

MouseUp

(Inherited from System.Windows.Forms.Control)

MouseWheel

(Inherited from System.Windows.Forms.Control)

Move

(Inherited from System.Windows.Forms.Control)

PaddingChanged

(Inherited from System.Windows.Forms.Control)

Paint

(Inherited from System.Windows.Forms.Control)

ParentChanged

(Inherited from System.Windows.Forms.Control)

PreviewKeyDown

(Inherited from System.Windows.Forms.Control)

QueryAccessibilityHelp

(Inherited from System.Windows.Forms.Control)

QueryContinueDrag

(Inherited from System.Windows.Forms.Control)

RegionChanged

(Inherited from System.Windows.Forms.Control)

Resize

(Inherited from System.Windows.Forms.Control)

347

RightToLeftChanged

(Inherited from System.Windows.Forms.Control)

SizeChanged

(Inherited from System.Windows.Forms.Control)

StyleChanged

(Inherited from System.Windows.Forms.Control)

SystemColorsChanged

(Inherited from System.Windows.Forms.Control)

TabIndexChanged

(Inherited from System.Windows.Forms.Control)

TabStopChanged

(Inherited from System.Windows.Forms.Control)

TextChanged

(Inherited from System.Windows.Forms.Control)

Validated

(Inherited from System.Windows.Forms.Control)

Validating

(Inherited from System.Windows.Forms.Control)

VisibleChanged

(Inherited from System.Windows.Forms.Control)

Top

See Also
Reference
C1FlexGrid Class
C1.Win.C1FlexGrid Namespace

C1FlexGrid Constructor
Creates a new instance of the C1FlexGrid control.

Syntax
Visual Basic (Declaration)
Public Function New()
C#

348

public C1FlexGrid()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members
Overload List

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

Public Methods
Name

Description

BeginInvoke

Overloaded. (Inherited from System.Windows.Forms.Control)

BringToFront

(Inherited from System.Windows.Forms.Control)

Clear

Overloaded. Overridden. Overridden to clear merged ranges.

Contains

(Inherited from System.Windows.Forms.Control)

CreateControl

(Inherited from System.Windows.Forms.Control)

CreateGraphics

(Inherited from System.Windows.Forms.Control)

CreateObjRef

(Inherited from System.MarshalByRefObject)

Dispose

(Inherited from System.ComponentModel.Component)

349

DoDragDrop

(Inherited from System.Windows.Forms.Control)

DrawToBitmap

(Inherited from System.Windows.Forms.Control)

EndInvoke

(Inherited from System.Windows.Forms.Control)

FindForm

(Inherited from System.Windows.Forms.Control)

Focus

(Inherited from System.Windows.Forms.Control)

GetChildAtPoint

Overloaded. (Inherited from System.Windows.Forms.Control)

GetContainerControl

(Inherited from System.Windows.Forms.Control)

GetLifetimeService

(Inherited from System.MarshalByRefObject)

GetMergedRange

Overloaded. Returns the merged range of cells that includes a


given cell.

GetNextControl

(Inherited from System.Windows.Forms.Control)

GetPreferredSize

(Inherited from System.Windows.Forms.Control)

Hide

(Inherited from System.Windows.Forms.Control)

InitializeLifetimeService

(Inherited from System.MarshalByRefObject)

Invalidate

Overloaded. Overridden. Invalidates a cell range, causing it to be


repainted.

Invoke

Overloaded. (Inherited from System.Windows.Forms.Control)

IsCellCursor

Overridden. Gets a value that determines if a cell contains the grid


cursor.

350

IsCellHighlighted

Overridden. Gets a value that determines if a cell is part of the


selection and should be highlighted.

PerformLayout

Overloaded. (Inherited from System.Windows.Forms.Control)

PointToClient

(Inherited from System.Windows.Forms.Control)

PointToScreen

(Inherited from System.Windows.Forms.Control)

PreProcessControlMessage (Inherited from System.Windows.Forms.Control)


PreProcessMessage

(Inherited from System.Windows.Forms.Control)

RectangleToClient

(Inherited from System.Windows.Forms.Control)

RectangleToScreen

(Inherited from System.Windows.Forms.Control)

Refresh

(Inherited from System.Windows.Forms.Control)

ResetText

(Inherited from System.Windows.Forms.Control)

ResumeLayout

Overloaded. (Inherited from System.Windows.Forms.Control)

Scale

(Inherited from System.Windows.Forms.Control)

SelectNextControl

(Inherited from System.Windows.Forms.Control)

SendToBack

(Inherited from System.Windows.Forms.Control)

SetBounds

Overloaded. (Inherited from System.Windows.Forms.Control)

Show

(Inherited from System.Windows.Forms.Control)

SuspendLayout

(Inherited from System.Windows.Forms.Control)

351

ToString

(Inherited from System.ComponentModel.Component)

Update

(Inherited from System.Windows.Forms.Control)

Top

See Also
Reference
C1FlexGrid Class
C1.Win.C1FlexGrid Namespace

Clear Method
Overridden to clear merged ranges.

Overload List
Overload

Description

Clear()

Overridden to clear merged ranges.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members
Clear() Method
Overridden to clear merged ranges.

Syntax
Visual Basic (Declaration)

352

Public Overloads Overrides Sub Clear()


C#
public override void Clear()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members
Overload List

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

Overload List
Overload

Description

GetMergedRange(Int32,Int32,Boolean) Returns the merged range of cells that includes a given


cell.
GetMergedRange(Int32,Int32)

Returns the merged range of cells that includes a given


cell.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

353

C1FlexGrid Class
C1FlexGrid Members
GetMergedRange(Int32,Int32,Boolean) Method
Example

Row index.
Column index.
Whether the range should be clipped to the visible area of the grid.
Returns the merged range of cells that includes a given cell.

Syntax
Visual Basic (Declaration)
Public Overloads Overridable Function GetMergedRange( _
ByVal row As Integer, _
ByVal col As Integer, _
ByVal clip As Boolean _
) As CellRange
C#
public virtual CellRange GetMergedRange(
int row,
int col,
bool clip
)

Parameters
row
Row index.
col
Column index.
clip
Whether the range should be clipped to the visible area of the grid.

Return Value
354

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: The code below shows how you can override the
GetMergedRange(Int32,Int32,Boolean) method to provide custom merging:

C#

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);
}
}

C#

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)

355

if (row >= 1 && row <= 3 && col >= 1 && col <= 3)
return GetCellRange(1, 1, 3, 3);
// don't merge anything else
return GetCellRange(row, col);
}
}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members
Overload List
GetMergedRange(Int32,Int32) Method
Row index.
Column index.
Returns the merged range of cells that includes a given cell.

Syntax
Visual Basic (Declaration)
Public Overloads Function GetMergedRange( _
ByVal row As Integer, _
ByVal col As Integer _
) As CellRange
C#
public CellRange GetMergedRange(
int row,
int col
)

Parameters

356

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members
Overload List

Invalidate Method
Invalidates a cell range, causing it to be repainted.

Overload List
Overload

Description

Invalidate(CellRange)

Invalidates a cell range, causing it to be repainted.

Invalidate(Region)

(Inherited from System.Windows.Forms.Control)

Invalidate(Region,Boolean)

(Inherited from System.Windows.Forms.Control)

357

Invalidate(Boolean)

(Inherited from System.Windows.Forms.Control)

Invalidate(Rectangle)

(Inherited from System.Windows.Forms.Control)

Invalidate(Rectangle,Boolean) (Inherited from System.Windows.Forms.Control)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members
Invalidate(CellRange) Method
Range to be invalidated.
Invalidates a cell range, causing it to be repainted.

Syntax
Visual Basic (Declaration)
Public Overloads Overrides Sub Invalidate( _
ByVal rg As CellRange _
)
C#
public override void Invalidate(
CellRange rg
)

Parameters
rg
Range to be invalidated.

358

Remarks
This method is rarely used by the programmer, since the grid automatically performs
invalidation as needed.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members
Overload List

IsCellCursor Method
Row index.
Column index.
Gets a value that determines if a cell contains the grid cursor.

Syntax
Visual Basic (Declaration)
Public Overrides Function IsCellCursor( _
ByVal row As Integer, _
ByVal col As Integer _
) As Boolean
C#
public override bool IsCellCursor(
int row,
int col
)

Parameters

359

row
Row index.
col
Column index.

Return Value
True if the cell contains the cursor, false otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members

IsCellHighlighted Method
Row index.
Column index.
Gets a value that determines if a cell is part of the selection and should be highlighted.

Syntax
Visual Basic (Declaration)
Public Overrides Function IsCellHighlighted( _
ByVal row As Integer, _
ByVal col As Integer _
) As Boolean
C#
public override bool IsCellHighlighted(
int row,

360

int col
)

Parameters
row
Row index.
col
Column index.

Return Value
True if the cell should be highlighted, false otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members

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

Public Properties
Name

Description

AccessibilityObject

(Inherited from System.Windows.Forms.Control)

AccessibleDefaultActionDescription (Inherited from System.Windows.Forms.Control)


AccessibleDescription

(Inherited from System.Windows.Forms.Control)

361

AccessibleName

(Inherited from System.Windows.Forms.Control)

AccessibleRole

(Inherited from System.Windows.Forms.Control)

AllowMerging

Gets or sets how cells should be merged.

AllowMergingFixed

Gets or sets how non-scrollable cells should be merged.

Anchor

(Inherited from System.Windows.Forms.Control)

AutoScrollOffset

(Inherited from System.Windows.Forms.Control)

BackgroundImage

(Inherited from System.Windows.Forms.Control)

BackgroundImageLayout

(Inherited from System.Windows.Forms.Control)

BindingContext

(Inherited from System.Windows.Forms.Control)

Bottom

(Inherited from System.Windows.Forms.Control)

Bounds

(Inherited from System.Windows.Forms.Control)

CanFocus

(Inherited from System.Windows.Forms.Control)

CanSelect

(Inherited from System.Windows.Forms.Control)

Capture

(Inherited from System.Windows.Forms.Control)

CausesValidation

(Inherited from System.Windows.Forms.Control)

ClientRectangle

(Inherited from System.Windows.Forms.Control)

ClientSize

(Inherited from System.Windows.Forms.Control)

CompanyName

(Inherited from System.Windows.Forms.Control)

362

Container

(Inherited from System.ComponentModel.Component)

ContainsFocus

(Inherited from System.Windows.Forms.Control)

ContextMenu

(Inherited from System.Windows.Forms.Control)

ContextMenuStrip

(Inherited from System.Windows.Forms.Control)

Controls

(Inherited from System.Windows.Forms.Control)

Created

(Inherited from System.Windows.Forms.Control)

Cursor

(Inherited from System.Windows.Forms.Control)

DataBindings

(Inherited from System.Windows.Forms.Control)

DisplayRectangle

(Inherited from System.Windows.Forms.Control)

Disposing

(Inherited from System.Windows.Forms.Control)

Dock

(Inherited from System.Windows.Forms.Control)

Enabled

(Inherited from System.Windows.Forms.Control)

Focused

(Inherited from System.Windows.Forms.Control)

Font

(Inherited from System.Windows.Forms.Control)

Handle

(Inherited from System.Windows.Forms.Control)

HasChildren

(Inherited from System.Windows.Forms.Control)

Height

(Inherited from System.Windows.Forms.Control)

ImeMode

(Inherited from System.Windows.Forms.Control)

363

InvokeRequired

(Inherited from System.Windows.Forms.Control)

IsAccessible

(Inherited from System.Windows.Forms.Control)

IsDisposed

(Inherited from System.Windows.Forms.Control)

IsHandleCreated

(Inherited from System.Windows.Forms.Control)

IsMirrored

(Inherited from System.Windows.Forms.Control)

LayoutEngine

(Inherited from System.Windows.Forms.Control)

Left

(Inherited from System.Windows.Forms.Control)

Location

(Inherited from System.Windows.Forms.Control)

Margin

(Inherited from System.Windows.Forms.Control)

MaximumSize

(Inherited from System.Windows.Forms.Control)

MergedRanges

Gets the CellRangeCollection that determines which grid


cells are merged when the AllowMerging property is set to
AllowMergingEnum.Custom.

MinimumSize

(Inherited from System.Windows.Forms.Control)

Name

(Inherited from System.Windows.Forms.Control)

Padding

(Inherited from System.Windows.Forms.Control)

Parent

(Inherited from System.Windows.Forms.Control)

PreferredSize

(Inherited from System.Windows.Forms.Control)

ProductName

(Inherited from System.Windows.Forms.Control)

364

ProductVersion

(Inherited from System.Windows.Forms.Control)

RecreatingHandle

(Inherited from System.Windows.Forms.Control)

Region

(Inherited from System.Windows.Forms.Control)

Right

(Inherited from System.Windows.Forms.Control)

RightToLeft

(Inherited from System.Windows.Forms.Control)

Site

(Inherited from System.Windows.Forms.Control)

Size

(Inherited from System.Windows.Forms.Control)

TabIndex

(Inherited from System.Windows.Forms.Control)

TabStop

(Inherited from System.Windows.Forms.Control)

Tag

(Inherited from System.Windows.Forms.Control)

Top

(Inherited from System.Windows.Forms.Control)

TopLevelControl

(Inherited from System.Windows.Forms.Control)

UseWaitCursor

(Inherited from System.Windows.Forms.Control)

Visible

(Inherited from System.Windows.Forms.Control)

Width

(Inherited from System.Windows.Forms.Control)

Top

See Also
Reference
C1FlexGrid Class
C1.Win.C1FlexGrid Namespace

365

AllowMerging Property
Example

Gets or sets how cells should be merged.

Syntax
Visual Basic (Declaration)
Public Property AllowMerging As AllowMergingEnum
C#
public AllowMergingEnum AllowMerging {get; set;}

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 RowCol.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:

C#

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

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
366

C1FlexGrid Class
C1FlexGrid Members

AllowMergingFixed Property
Gets or sets how non-scrollable cells should be merged.

Syntax
Visual Basic (Declaration)
Public Property AllowMergingFixed As AllowMergingEnum
C#
public AllowMergingEnum AllowMergingFixed {get; set;}

Remarks
By default, this property is set to AllowMergingEnum.Default, which causes fixed cells to be merged
with the same setting as scrollable cells.
If you specify a different value for this property, you can use different merging modes for fixed cells
such as column headers than the setting used for scrollable cells.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members

MergedRanges Property
Gets the CellRangeCollection that determines which grid cells are merged when the AllowMerging
property is set to AllowMergingEnum.Custom.

Syntax

367

Visual Basic (Declaration)


Public ReadOnly Property MergedRanges As CellRangeCollection
C#
public CellRangeCollection MergedRanges {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGrid Class
C1FlexGrid Members

C1FlexGridRenderer
Represents an abstract base class for custom grid renderers.

Object Model

Syntax
Visual Basic (Declaration)
Public MustInherit Class C1FlexGridRenderer
C#
public abstract class C1FlexGridRenderer

Remarks
To create custom grid renderers, inherit from this class, override the appropriate virtual methods
and properties, and assign an instance of your class to the grid's C1FlexGridBase.Renderer
property.

368

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererSystem

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridRenderer Members
C1.Win.C1FlexGrid Namespace

Overview
Represents an abstract base class for custom grid renderers.

Object Model

Syntax
Visual Basic (Declaration)
Public MustInherit Class C1FlexGridRenderer
C#
public abstract class C1FlexGridRenderer

Remarks
To create custom grid renderers, inherit from this class, override the appropriate virtual methods
and properties, and assign an instance of your class to the grid's C1FlexGridBase.Renderer
property.

369

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererSystem

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridRenderer Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by C1FlexGridRenderer.

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state.
TracksMouse

Gets a value that determines whether this renderer renders hot cells
differently than normal cells.

TracksSelection

Gets a value that determines whether this renderer tracks the selection to
paint highlighted column and row headers.

Top

Public Methods

370

Name

Description

GetBackgroundBrush Gets a System.Drawing.Brush object used to paint the cell background


for a specific cell type.
GetBorderPen

Gets a System.Drawing.Pen object used to paint the cell borders.

OnDrawCell

Overloaded. Draws a grid cell of any type.

Top

See Also
Reference
C1FlexGridRenderer Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see C1FlexGridRenderer members.

Public Methods
Name

Description

GetBackgroundBrush Gets a System.Drawing.Brush object used to paint the cell background


for a specific cell type.
GetBorderPen

Gets a System.Drawing.Pen object used to paint the cell borders.

OnDrawCell

Overloaded. Draws a grid cell of any type.

Top

See Also
Reference
C1FlexGridRenderer Class
C1.Win.C1FlexGrid Namespace

371

GetBackgroundBrush Method
C1FlexGridBase that contains the cell being drawn.
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.
A System.Drawing.Rectangle that represents the bounds of the cell being drawn.
Gets a System.Drawing.Brush object used to paint the cell background for a specific cell type.

Syntax
Visual Basic (Declaration)
Public Overridable Function GetBackgroundBrush( _
ByVal flex As C1FlexGridBase, _
ByVal cellType As C1FlexGridRenderer.CellType, _
ByVal bounds As Rectangle _
) As Brush
C#
public virtual Brush GetBackgroundBrush(
C1FlexGridBase flex,
C1FlexGridRenderer.CellType cellType,
Rectangle bounds
)

Parameters
flex
C1FlexGridBase that contains the cell being drawn.
cellType
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.
bounds
A System.Drawing.Rectangle that represents the bounds of the cell being drawn.

Return Value
A System.Drawing.Brush object used to render the cell background.

Remarks
372

The bounds parameter can be used to create or select complex brushes such as
gradient or tiled image brushes.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridRenderer Class
C1FlexGridRenderer Members

GetBorderPen Method
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.
Gets a System.Drawing.Pen object used to paint the cell borders.

Syntax
Visual Basic (Declaration)
Public Overridable Function GetBorderPen( _
ByVal cellType As C1FlexGridRenderer.CellType _
) As Pen
C#
public virtual Pen GetBorderPen(
C1FlexGridRenderer.CellType cellType
)

Parameters
cellType
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.

Return Value
A System.Drawing.Pen object used to paint the cell borders.

373

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridRenderer Class
C1FlexGridRenderer Members

OnDrawCell Method
Draws a grid cell of any type.

Overload List
Overload

Description

OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs)

Draws a grid cell of any type.

OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs,CellType) Draws a single grid cell of a


specific type.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridRenderer Class
C1FlexGridRenderer Members
OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs) Method
C1FlexGridBase that contains the cell being drawn.
OwnerDrawCellEventArgs that provides information about the cell being drawn.

374

Draws a grid cell of any type.

Syntax
Visual Basic (Declaration)
Public Overloads Overridable Sub OnDrawCell( _
ByVal flex As C1FlexGridBase, _
ByVal e As OwnerDrawCellEventArgs _
)
C#
public virtual void OnDrawCell(
C1FlexGridBase flex,
OwnerDrawCellEventArgs e
)

Parameters
flex
C1FlexGridBase that contains the cell being drawn.
e
OwnerDrawCellEventArgs that provides information about the cell being drawn.

Remarks
This method determines the type of cell being drawn and then calls the
OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs,CellType) method passing the
type of cell to be drawn.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference

375

C1FlexGridRenderer Class
C1FlexGridRenderer Members
Overload List
OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs,CellType) Method
C1FlexGridBase that contains the cell being drawn.
OwnerDrawCellEventArgs that provides information about the cell being drawn.
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.
Draws a single grid cell of a specific type.

Syntax
Visual Basic (Declaration)
Public Overloads Overridable Sub OnDrawCell( _
ByVal flex As C1FlexGridBase, _
ByVal e As OwnerDrawCellEventArgs, _
ByVal cellType As C1FlexGridRenderer.CellType _
)
C#
public virtual void OnDrawCell(
C1FlexGridBase flex,
OwnerDrawCellEventArgs e,
C1FlexGridRenderer.CellType cellType
)

Parameters
flex
C1FlexGridBase that contains the cell being drawn.
e
OwnerDrawCellEventArgs that provides information about the cell being drawn.
cellType
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.

Requirements
376

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,


Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridRenderer Class
C1FlexGridRenderer Members
Overload List

Properties
For a list of all members of this type, see C1FlexGridRenderer members.

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state.
TracksMouse

Gets a value that determines whether this renderer renders hot cells
differently than normal cells.

TracksSelection

Gets a value that determines whether this renderer tracks the selection to
paint highlighted column and row headers.

Top

See Also
Reference
C1FlexGridRenderer Class
C1.Win.C1FlexGrid Namespace

HeaderForeColor Property
Gets the foreground color of header cells in the normal state.

Syntax

377

Visual Basic (Declaration)


Public Overridable ReadOnly Property HeaderForeColor As Color
C#
public virtual Color HeaderForeColor {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridRenderer Class
C1FlexGridRenderer Members

TracksMouse Property
Gets a value that determines whether this renderer renders hot cells differently than normal cells.

Syntax
Visual Basic (Declaration)
Public Overridable ReadOnly Property TracksMouse As Boolean
C#
public virtual bool TracksMouse {get;}

Remarks
Hot cells are cells currently under the mouse. If a renderer tracks the mouse, then it will be called as
the mouse moves over the grid.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

378

See Also
Reference
C1FlexGridRenderer Class
C1FlexGridRenderer Members

TracksSelection Property
Gets a value that determines whether this renderer tracks the selection to paint highlighted column
and row headers.

Syntax
Visual Basic (Declaration)
Public Overridable ReadOnly Property TracksSelection As Boolean
C#
public virtual bool TracksSelection {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridRenderer Class
C1FlexGridRenderer Members

CellBorder
The CellBorder class encapsulates properties that control the appearance of borders in CellStyle
objects.

Object Model

Syntax

379

Visual Basic (Declaration)


Public Class CellBorder
C#
public class CellBorder

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.CellBorder

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellBorder Members
C1.Win.C1FlexGrid Namespace

Overview
The CellBorder class encapsulates properties that control the appearance of borders in CellStyle
objects.

Object Model

Syntax
Visual Basic (Declaration)
Public Class CellBorder
C#
public class CellBorder

380

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.CellBorder

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellBorder Members
C1.Win.C1FlexGrid Namespace

Members
Properties

The following tables list the members exposed by CellBorder.

Public Properties
Name

Description

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).

Top

See Also
Reference
CellBorder Class
C1.Win.C1FlexGrid Namespace

381

Properties
For a list of all members of this type, see CellBorder members.

Public Properties
Name

Description

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).

Top

See Also
Reference
CellBorder Class
C1.Win.C1FlexGrid Namespace

Color Property
Gets or sets the border color (except for 3D borders).

Syntax
Visual Basic (Declaration)
Public Property Color As Color
C#
public Color Color {get; set;}

Remarks
3D borders are always drawn using the system colors defined for highlights and shadows.

Requirements
382

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellBorder Class
CellBorder Members

Direction Property
Gets or sets the border direction.

Syntax
Visual Basic (Declaration)
Public Property Direction As BorderDirEnum
C#
public BorderDirEnum Direction {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellBorder Class
CellBorder Members

Style Property
Gets or sets the border style.

Syntax
Visual Basic (Declaration)

383

Public Property Style As BorderStyleEnum


C#
public BorderStyleEnum Style {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellBorder Class
CellBorder Members

Width Property
Gets or sets the border width (except for 3D borders).

Syntax
Visual Basic (Declaration)
Public Property Width As Integer
C#
public int Width {get; set;}

Remarks
3D borders are always one or two pixels wide.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
384

CellBorder Class
CellBorder Members

CellRangeCollection
Collection of CellRange objects.

Object Model

Syntax
Visual Basic (Declaration)
Public Class CellRangeCollection
C#
public class CellRangeCollection

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.CellRangeCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Members
C1.Win.C1FlexGrid Namespace

Overview
Collection of CellRange objects.

Object Model

385

Syntax
Visual Basic (Declaration)
Public Class CellRangeCollection
C#
public class CellRangeCollection

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.CellRangeCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by CellRangeCollection.

Public Constructors
Name

Description

CellRangeCollection Constructor Initializes a new instance of a CellRangeCollection.


Top

386

Public Properties
Name

Description

Count

Gets the number of CellRange objects in the collection.

Item

Gets or sets the CellRange object at a specified index.

Top

Public Methods
Name

Description

Add

Overloaded. Adds a new CellRange object to the collection.

Clear

Removes all objects from the collection.

Contains

Determines whether a CellRange object is a member of the collection.

IndexOf

Overloaded. Gets the index of a CellRange object in the collection.

Insert

Inserts a CellRange object in the collection at a specified index.

Remove

Removes a CellRange object from the collection.

RemoveAt

Removed the object at a specified index from the collection.

Top

See Also
Reference
CellRangeCollection Class
C1.Win.C1FlexGrid Namespace

CellRangeCollection Constructor
Grid that owns the collection.

387

Initializes a new instance of a CellRangeCollection.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal flexGrid As C1FlexGrid _
)
C#
public CellRangeCollection(
C1FlexGrid flexGrid
)

Parameters
flexGrid
Grid that owns the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members

Methods
For a list of all members of this type, see CellRangeCollection members.

Public Methods
Name

Description

Add

Overloaded. Adds a new CellRange object to the collection.

388

Clear

Removes all objects from the collection.

Contains

Determines whether a CellRange object is a member of the collection.

IndexOf

Overloaded. Gets the index of a CellRange object in the collection.

Insert

Inserts a CellRange object in the collection at a specified index.

Remove

Removes a CellRange object from the collection.

RemoveAt

Removed the object at a specified index from the collection.

Top

See Also
Reference
CellRangeCollection Class
C1.Win.C1FlexGrid Namespace

Add Method
Adds a new CellRange object to the collection.

Overload List
Overload

Description

Add(CellRange)

Adds a new CellRange object to the collection.

Add(CellRange,Boolean) Adds a new CellRange object to the collection, optionally removing other
overlapping ranges from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
389

Reference
CellRangeCollection Class
CellRangeCollection Members
Add(CellRange) Method
Object to add to the collection.
Adds a new CellRange object to the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Add( _
ByVal value As CellRange _
) As Integer
C#
public int Add(
CellRange value
)

Parameters
value
Object to add to the collection.

Return Value
The index of the object in the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

390

CellRangeCollection Class
CellRangeCollection Members
Overload List
Add(CellRange,Boolean) Method
Object to add to the collection.
Whether to remove overlapping ranges from the collection before adding the new range.
Adds a new CellRange object to the collection, optionally removing other overlapping ranges from
the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Add( _
ByVal value As CellRange, _
ByVal clearOverlappingRanges As Boolean _
) As Integer
C#
public int Add(
CellRange value,
bool clearOverlappingRanges
)

Parameters
value
Object to add to the collection.
clearOverlappingRanges
Whether to remove overlapping ranges from the collection before adding the new range.

Return Value
The index of the object in the collection.

Requirements

391

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members
Overload List

Clear Method
Removes all objects from the collection.

Syntax
Visual Basic (Declaration)
Public Sub Clear()
C#
public void Clear()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members

Contains Method
Object to locate in the collection.
Determines whether a CellRange object is a member of the collection.

Syntax

392

Visual Basic (Declaration)


Public Function Contains( _
ByVal item As CellRange _
) As Boolean
C#
public bool Contains(
CellRange item
)

Parameters
item
Object to locate in the collection.

Return Value
True if the object is a member of the collection, false otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members

IndexOf Method
Gets the index of a CellRange object in the collection.

Overload List
Overload

Description

IndexOf(CellRange) Gets the index of a CellRange object in the collection.

393

IndexOf(Int32,Int32) Gets the index of the first CellRange object in the collection that contains the
specified row and column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members
IndexOf(CellRange) Method
Object to locate in the collection.
Gets the index of a CellRange object in the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function IndexOf( _
ByVal item As CellRange _
) As Integer
C#
public int IndexOf(
CellRange item
)

Parameters
item
Object to locate in the collection.

Return Value
The index of the object in the collection, or -1 if the object is not a member of the collection.

394

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members
Overload List
IndexOf(Int32,Int32) Method
Index of the row contained in the range.
Index of the column contained in the range.
Gets the index of the first CellRange object in the collection that contains the specified row and
column.

Syntax
Visual Basic (Declaration)
Public Overloads Function IndexOf( _
ByVal row As Integer, _
ByVal col As Integer _
) As Integer
C#
public int IndexOf(
int row,
int col
)

Parameters
row
Index of the row contained in the range.
col

395

Index of the column contained in the range.

Return Value
The index of the object in the collection, or -1 if no range could be found containing the
specified row and column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members
Overload List

Insert Method
Inserts a CellRange object in the collection at a specified index.

Syntax
Visual Basic (Declaration)
Public Sub Insert( _
ByVal index As Integer, _
ByVal value As CellRange _
)
C#
public void Insert(
int index,
CellRange value
)

Parameters
index
value

396

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members

Remove Method
Object to remove from the collection.
Removes a CellRange object from the collection.

Syntax
Visual Basic (Declaration)
Public Sub Remove( _
ByVal obj As CellRange _
)
C#
public void Remove(
CellRange obj
)

Parameters
obj
Object to remove from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

397

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members

RemoveAt Method
Index of the object to remove from the collection.
Removed the object at a specified index from the collection.

Syntax
Visual Basic (Declaration)
Public Sub RemoveAt( _
ByVal index As Integer _
)
C#
public void RemoveAt(
int index
)

Parameters
index
Index of the object to remove from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members

398

Properties
For a list of all members of this type, see CellRangeCollection members.

Public Properties
Name

Description

Count

Gets the number of CellRange objects in the collection.

Item

Gets or sets the CellRange object at a specified index.

Top

See Also
Reference
CellRangeCollection Class
C1.Win.C1FlexGrid Namespace

Count Property
Gets the number of CellRange objects in the collection.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Count As Integer
C#
public int Count {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

399

CellRangeCollection Class
CellRangeCollection Members

Item Property
Gets or sets the CellRange object at a specified index.

Syntax
Visual Basic (Declaration)
Public ReadOnly Default Property Item( _
ByVal index As Integer _
) As CellRange
C#
public CellRange this[
int index
]; {get;}

Parameters
index

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellRangeCollection Class
CellRangeCollection Members

CellStyle
Example

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.

Object Model

400

Syntax
Visual Basic (Declaration)
Public Class CellStyle
C#
public class CellStyle

Remarks
The C1FlexGridBase.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 CellStyleCollection.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.
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 (CellStyleCollection.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.

401

C#

// create style with red background


CellStyle cs = _flex.Styles.Add("red");
Style.BackColor = Color.Red;
// create style with green background
cs = _flex.Styles.Add("green");
Style.BackColor = Color.Green;
// create style with bold font
cs = _flex.Styles.Add("bold");
Style.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"];

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.CellStyle

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Members
C1.Win.C1FlexGrid Namespace

Overview
Example

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.

Object Model
402

Syntax
Visual Basic (Declaration)
Public Class CellStyle
C#
public class CellStyle

Remarks
The C1FlexGridBase.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 CellStyleCollection.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.
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 (CellStyleCollection.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.

403

C#

// create style with red background


CellStyle cs = _flex.Styles.Add("red");
Style.BackColor = Color.Red;
// create style with green background
cs = _flex.Styles.Add("green");
Style.BackColor = Color.Green;
// create style with bold font
cs = _flex.Styles.Add("bold");
Style.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"];

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.CellStyle

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by CellStyle.

Public Properties

404

Name

Description

BackColor

Gets or sets the color used to paint the cell background.

BackgroundImage

Gets or sets the style's background image.

BackgroundImageLayout Gets or sets the a value that determines how the style will scale and
position background image.
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

405

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.

StringFormat

Gets the StringFormat element used for rendering strings when the
C1FlexGridBase.UseCompatibleTextRendering property is set to
true.

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 long strings should automatically wrap within


the cell.

Top

Public Methods
Name

Description

BuildString

Overloaded. Returns a compact string representation of this CellStyle.

Clear

Overloaded. Clears selected elements from this style.

406

Equals

Determines whether two CellStyle objects are equal.

GetContentRectangle Gets the content portion of a cell's rectangle.


GetHashCode

Serves as a hash function for a particular type, suitable for use in hashing
algorithms and data structures like a hash table.

GetImageRectangle

Gets the image portion of a cell's rectangle.

GetTextRectangle

Gets the text portion of a cell's rectangle.

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


System.Drawing.Graphics object using this style.

Top

See Also
Reference
CellStyle Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see CellStyle members.

Public Methods
Name

Description

BuildString

Overloaded. Returns a compact string representation of this CellStyle.

Clear

Overloaded. Clears selected elements from this style.

407

Equals

Determines whether two CellStyle objects are equal.

GetContentRectangle Gets the content portion of a cell's rectangle.


GetHashCode

Serves as a hash function for a particular type, suitable for use in hashing
algorithms and data structures like a hash table.

GetImageRectangle

Gets the image portion of a cell's rectangle.

GetTextRectangle

Gets the text portion of a cell's rectangle.

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


System.Drawing.Graphics object using this style.

Top

See Also
Reference
CellStyle Class
C1.Win.C1FlexGrid Namespace

BuildString Method
Returns a compact string representation of this CellStyle.

Overload List
Overload

Description

BuildString()

Returns a compact string representation of this CellStyle.

BuildString(StyleElementFlags) Returns a string representation of this CellStyle.

Requirements
408

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members
BuildString() Method
Example

Returns a compact string representation of this CellStyle.

Syntax
Visual Basic (Declaration)
Public Overloads Function BuildString() As String
C#
public string BuildString()

Return Value
A string containing the settings of all style elements defined in this CellStyle.

Remarks
This method is used to persist grid styles and can be used to define and save 'skins'.
See the CellStyleCollection.BuildString and CellStyleCollection.ParseString methods.
The string returned contains definitions only for the style elements that are defined by this
CellStyle. Elements inherited from other styles are not included. To build a string containing specific
elements, use the BuildString(StyleElementFlags) method instead.

Example
The code below creates a style with a custom font and background color and builds a string that
represents the new style. Then it uses the string to initialize a second style.

C#

409

// create style with custom font and back color


CellStyle cs = _flex.Styles.Add("s1");
cs.Font = new Font("Arial", 12, FontStyle.Bold);
cs.BackColor = Color.Beige;
// save style definition into a string
string styleDef = cs.BuildString();
// use string to initialize another style
CellStyle csNew = _flex.Styles.Add("s2");
csNew.ParseString(styleDef);
// compare styles
Debug.Assert(csNew.Font.Equals(cs.Font));
Debug.Assert(csNew.BackColor.Equals(cs.BackColor));

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members
Overload List
BuildString(StyleElementFlags) Method
Example

StyleElementFlags that specifies which style elements should be included in the string.
Returns a string representation of this CellStyle.

Syntax
Visual Basic (Declaration)
Public Overloads Function BuildString( _
ByVal elements As StyleElementFlags _
) As String
C#
public string BuildString(

410

StyleElementFlags elements
)

Parameters
elements
StyleElementFlags that specifies which style elements should be included in the string.

Return Value
A string containing the settings of the specified style elements.

Remarks
This method is used to persist grid styles and can be used to define and save 'skins'.
See the CellStyleCollection.BuildString and CellStyleCollection.ParseString methods.

Example
The code below shows the effect of specifying different values for the elements parameter. It
builds one compact string containing only the elements actually defined in a style, and
another including all style elements.

C#

// build compact and a long style definition strings


string s1 = _flex.Styles.Fixed.BuildString();
string s2 = _flex.Styles.Fixed.BuildString(StyleElementFlags.All);
// show both style definitions
Console.WriteLine("{0}: {1}", s1.Length, s1);
Console.WriteLine("{0}: {1}", s2.Length, s2);

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members
Overload List

411

Clear Method
Clears selected elements from this style.

Overload List
Overload

Description

Clear(StyleElementFlags) Clears selected elements from this style.


Clear()

Clears all elements in this style.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members
Clear(StyleElementFlags) Method
Clears selected elements from this style.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Clear( _
ByVal flags As StyleElementFlags _
)
C#
public void Clear(
StyleElementFlags flags
)

Parameters

412

flags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members
Overload List
Clear() Method
Clears all elements in this style.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Clear()
C#
public void Clear()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members
Overload List

Equals Method
Style to compare with this style.

413

Determines whether two CellStyle objects are equal.

Syntax
Visual Basic (Declaration)
Public Overrides Function Equals( _
ByVal o As Object _
) As Boolean
C#
public override bool Equals(
object o
)

Parameters
o
Style to compare with this style.

Return Value
True if the two styles are equal, false otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

GetContentRectangle Method
Cell rectangle.
Gets the content portion of a cell's rectangle.

Syntax
414

Visual Basic (Declaration)


Public Function GetContentRectangle( _
ByVal rc As Rectangle _
) As Rectangle
C#
public Rectangle GetContentRectangle(
Rectangle rc
)

Parameters
rc
Cell rectangle.

Return Value
A rectangle that represents the content portion of a cell, discounting the area taken up by the
cell borders.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

GetHashCode Method
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data
structures like a hash table.

Syntax
Visual Basic (Declaration)

415

Public Overrides Function GetHashCode() As Integer


C#
public override int GetHashCode()

Return Value
A hash code for the style instance.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

GetImageRectangle Method
Cell rectangle.
Image to be displayed on the cell.
Gets the image portion of a cell's rectangle.

Syntax
Visual Basic (Declaration)
Public Function GetImageRectangle( _
ByVal rc As Rectangle, _
ByVal img As Image _
) As Rectangle
C#
public Rectangle GetImageRectangle(
Rectangle rc,
Image img

416

Parameters
rc
Cell rectangle.
img
Image to be displayed on the cell.

Return Value
A rectangle that represents the image portion of a cell, discounting the area taken up by
the cell borders and padding.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

GetTextRectangle Method
Cell rectangle.
Image that shares the cell space with the text.
Gets the text portion of a cell's rectangle.

Syntax
Visual Basic (Declaration)
Public Function GetTextRectangle( _
ByVal rc As Rectangle, _
ByVal img As Image _
) As Rectangle

417

C#
public Rectangle GetTextRectangle(
Rectangle rc,
Image img
)

Parameters
rc
Cell rectangle.
img
Image that shares the cell space with the text.

Return Value
A rectangle that represents the text portion of a cell, discounting the area taken up by
the cell borders, padding, and images.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

MergeWith Method
Example

Copies all elements defined in a source style to this style.

Syntax
Visual Basic (Declaration)
Public Sub MergeWith( _

418

ByVal sourceStyle As CellStyle _


)
C#
public void MergeWith(
CellStyle sourceStyle
)

Parameters
sourceStyle

Remarks
This method is used to create styles preserving existing style elements such as DataType or
Format.

Example
The code below changes a column so it looks like a fixed column, without modifying the
column's data type, alignment, etc.

C#

// create a new style


CellStyle cs = _flex.Styles.Add("newStyle");
// set data type, alignment
cs.DataType = typeof(int);
cs.TextAlign = TextAlignEnum.CenterCenter;
// copy remaining elements from "Fixed" style
cs.MergeWith(_flex.Styles.Fixed);
// assign new style to grid column
_flex.Cols[col].Style = cs;

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

419

CellStyle Class
CellStyle Members

ParseString Method
Rebuilds this style based on a description contained in a string.

Syntax
Visual Basic (Declaration)
Public Function ParseString( _
ByVal str As String _
) As Boolean
C#
public bool ParseString(
string str
)

Parameters
str

Return Value
True if the string was successfully parsed, false otherwise.

Remarks
This method is used to persist grid styles and can be used to define and save 'skins'.
See the CellStyleCollection.BuildString and CellStyleCollection.ParseString methods.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

420

CellStyle Class
CellStyle Members

Render Method
Renders a string and an image into a System.Drawing.Graphics object using this style.

Overload List
Overload

Description

Render(Graphics,Rectangle,String,Image,DrawCellFlags) Renders a string and an image into a


System.Drawing.Graphics object using this
style.
Render(Graphics,Rectangle,String,Image)

Renders a string and an image into a


System.Drawing.Graphics object using this
style.

Render(Graphics,Rectangle,String)

Renders a string and an image into a


System.Drawing.Graphics object using this
style.

Render(Graphics,Rectangle,Image)

Renders a string and an image into a


System.Drawing.Graphics object using this
style.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

421

Render(Graphics,Rectangle,String,Image,DrawCellFlags) Method
System.Drawing.Graphics object to render into.
Area where the element will be displayed.
Text to render.
Image to render.
Combination of DrawCellFlags that determines which elements will be rendered.
Renders a string and an image into a System.Drawing.Graphics object using this style.

Syntax
Visual Basic (Declaration)
Public Overloads 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
)

Parameters
g
System.Drawing.Graphics object to render into.
rc
Area where the element will be displayed.
str

422

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP
SP3, Windows Server 2008 (Server Core not supported), Windows Server
2008 R2 (Server Core supported with SP1 or later), Windows Server 2003
SP2

See Also
Reference
CellStyle Class
CellStyle Members
Overload List
Render(Graphics,Rectangle,String,Image) Method
System.Drawing.Graphics object to render into.
Area where the element will be displayed.
Text to render.
Image to render.
Renders a string and an image into a System.Drawing.Graphics object using this style.

Syntax
Visual Basic (Declaration)

423

Public Overloads 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
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference

424

CellStyle Class
CellStyle Members
Overload List
Render(Graphics,Rectangle,String) Method
System.Drawing.Graphics object to render into.
Area where the element will be displayed.
Text to render.
Renders a string and an image into a System.Drawing.Graphics object using this style.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Render( _
ByVal g As Graphics, _
ByVal rc As Rectangle, _
ByVal str As String _
)
C#
public void Render(
Graphics g,
Rectangle rc,
string str
)

Parameters
g
System.Drawing.Graphics object to render into.
rc
Area where the element will be displayed.
str
Text to render.

Requirements
425

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,


Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members
Overload List
Render(Graphics,Rectangle,Image) Method
System.Drawing.Graphics object to render into.
Area where the element will be displayed.
Image to render.
Renders a string and an image into a System.Drawing.Graphics object using this style.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Render( _
ByVal g As Graphics, _
ByVal rc As Rectangle, _
ByVal img As Image _
)
C#
public void Render(
Graphics g,
Rectangle rc,
Image img
)

Parameters
g
System.Drawing.Graphics object to render into.

426

rc
Area where the element will be displayed.
img
Image to render.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members
Overload List

Properties
For a list of all members of this type, see CellStyle members.

Public Properties
Name

Description

BackColor

Gets or sets the color used to paint the cell background.

BackgroundImage

Gets or sets the style's background image.

BackgroundImageLayout Gets or sets the a value that determines how the style will scale and
position background image.
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

427

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.

StringFormat

Gets the StringFormat element used for rendering strings when the
C1FlexGridBase.UseCompatibleTextRendering property is set to
true.

TextAlign

Gets or sets the text alignment.

428

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 long strings should automatically wrap within


the cell.

Top

See Also
Reference
CellStyle Class
C1.Win.C1FlexGrid Namespace

BackColor Property
Gets or sets the color used to paint the cell background.

Syntax
Visual Basic (Declaration)
Public Property BackColor As Color
C#
public Color BackColor {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

429

CellStyle Class
CellStyle Members

BackgroundImage Property
Gets or sets the style's background image.

Syntax
Visual Basic (Declaration)
Public Property BackgroundImage As Image
C#
public Image BackgroundImage {get; set;}

Remarks
This property works with BackgroundImageLayout to determine whether and how background
images are rendered in cells.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

BackgroundImageLayout Property
Gets or sets the a value that determines how the style will scale and position background image.

Syntax
Visual Basic (Declaration)
Public Property BackgroundImageLayout As ImageAlignEnum

430

C#
public ImageAlignEnum BackgroundImageLayout {get; set;}

Remarks
This property works with BackgroundImage to determine whether and how background images are
rendered in cells.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

Border Property
Gets the CellBorder object associated with this style.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Border As CellBorder
C#
public CellBorder Border {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

431

CellStyle Class
CellStyle Members

ComboList Property
Gets or sets a pipe-delimited list of valid values.

Syntax
Visual Basic (Declaration)
Public Property ComboList As String
C#
public string ComboList {get; set;}

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 C1FlexGridBase.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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

432

DataMap Property
Gets or sets an System.Collections.IDictionary used to associate cell values with display values.

Syntax
Visual Basic (Declaration)
Public Property DataMap As IDictionary
C#
public IDictionary DataMap {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

DataType Property
Gets or sets the data type for the style.

Syntax

433

Visual Basic (Declaration)


Public Property DataType As Type
C#
public Type DataType {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

DefinedElements Property
Gets or sets which elements are defined in this style.

Syntax
Visual Basic (Declaration)
Public Property DefinedElements As StyleElementFlags
C#
public StyleElementFlags DefinedElements {get; set;}

Remarks
Elements that are not defined in a particular style are automatically inherited from the ancestor
style (usually the Normal style). For example, if you create a custom style that defines the Font

434

property, all other elements (back color, alignment, and so on) are inherited from the ancestor style,
which may be the Normal style or another custom style assigned to a row or column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

Display Property
Gets or sets whether to show images, text, or both.

Syntax
Visual Basic (Declaration)
Public Property Display As DisplayEnum
C#
public DisplayEnum Display {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

EditMask Property
Gets or sets the mask string used to edit values.

435

Syntax
Visual Basic (Declaration)
Public Property EditMask As String
C#
public string EditMask {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

Editor Property
Gets or sets the custom editor used to edit cells that have this style.

Syntax
Visual Basic (Declaration)
Public Property Editor As Control
C#
public Control Editor {get; set;}

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 that have a given CellStyle. 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.

436

For details, see the C1FlexGridBase.Editor property.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

Font Property
Gets or sets the font used to paint text in the cell.

Syntax
Visual Basic (Declaration)
Public Property Font As Font
C#
public Font Font {get; set;}

Remarks
Setting the control's Font property automatically sets the Font property of the Normal style.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

437

ForeColor Property
Gets or sets the color of the text in the cell.

Syntax
Visual Basic (Declaration)
Public Property ForeColor As Color
C#
public Color ForeColor {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

Format Property
Gets or sets the format string used to display values.

Syntax
Visual Basic (Declaration)
Public Property Format As String
C#
public string Format {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

438

See Also
Reference
CellStyle Class
CellStyle Members

ImageAlign Property
Gets or sets the image alignment.

Syntax
Visual Basic (Declaration)
Public Property ImageAlign As ImageAlignEnum
C#
public ImageAlignEnum ImageAlign {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

ImageMap Property
Gets or sets an System.Collections.IDictionary used to associate cell values with images.

Syntax
Visual Basic (Declaration)
Public Property ImageMap As IDictionary
C#

439

public IDictionary ImageMap {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

ImageSpacing Property
Gets or sets the space between images and text in a cell, in pixels.

Syntax
Visual Basic (Declaration)
Public Property ImageSpacing As Integer
C#
public int ImageSpacing {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

Margins Property
Gets or sets the margins between the edges of the cell and its contents, in pixels.

Syntax
440

Visual Basic (Declaration)


Public Property Margins As Margins
C#
public Margins Margins {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

Name Property
Gets or sets the style name.

Syntax
Visual Basic (Declaration)
Public Property Name As String
C#
public string Name {get; set;}

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 '}').

Requirements

441

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

StringFormat Property
Gets the StringFormat element used for rendering strings when the
C1FlexGridBase.UseCompatibleTextRendering property is set to true.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property StringFormat As StringFormat
C#
public StringFormat StringFormat {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

TextAlign Property
Gets or sets the text alignment.

Syntax

442

Visual Basic (Declaration)


Public Property TextAlign As TextAlignEnum
C#
public TextAlignEnum TextAlign {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

TextDirection Property
Gets or sets the text direction.

Syntax
Visual Basic (Declaration)
Public Property TextDirection As TextDirectionEnum
C#
public TextDirectionEnum TextDirection {get; set;}

Remarks
Cells containing vertical text can wrap and be auto sized as usual.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

443

See Also
Reference
CellStyle Class
CellStyle Members

TextEffect Property
Gets or sets the 3D effect used to paint text.

Syntax
Visual Basic (Declaration)
Public Property TextEffect As TextEffectEnum
C#
public TextEffectEnum TextEffect {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

Trimming Property
Gets or sets how long strings are trimmed to fit the cell.

Syntax
Visual Basic (Declaration)
Public Property Trimming As StringTrimming
C#

444

public StringTrimming Trimming {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

UserData Property
Gets or sets arbitrary user data associated with this style.

Syntax
Visual Basic (Declaration)
Public Property UserData As Object
C#
public object UserData {get; set;}

Remarks
This data is not used by the control, and can be used to store any data that is useful to the
application.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

445

CellStyle Class
CellStyle Members

WordWrap Property
Gets or sets whether long strings should automatically wrap within the cell.

Syntax
Visual Basic (Declaration)
Public Property WordWrap As Boolean
C#
public bool WordWrap {get; set;}

Remarks
This property determines whether the grid should automatically break long strings that contain
spaces and display them in multiple lines.
String that contain hard line breaks (vbCrLf or "\n\r") are always displayed in multiple lines.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyle Class
CellStyle Members

CellStyleCollection
Collection of CellStyle objects defined for a grid.

Object Model

Syntax
446

Visual Basic (Declaration)


Public Class CellStyleCollection
C#
public class CellStyleCollection

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.CellStyleCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Members
C1.Win.C1FlexGrid Namespace

Overview
Collection of CellStyle objects defined for a grid.

Object Model

Syntax
Visual Basic (Declaration)
Public Class CellStyleCollection
C#
public class CellStyleCollection

Inheritance Hierarchy
447

System.Object
C1.Win.C1FlexGrid.CellStyleCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by CellStyleCollection.

Public Properties
Name

Description

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.

FilterEditor

Gets the style used to paint the column filter editors.

Fixed

Gets the style used to paint fixed cells.

Focus

Gets the style used to paint the current cell when the control has
focus.

448

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 CellStyle by index.

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.

SelectedColumnHeader Gets the style used to paint selected column headers.


SelectedRowHeader

Gets the style used to paint selected column headers.

Top

Public Methods
Name

Description

Add

Overloaded. Adds a new 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.

449

ParseString

Parses a string containing style definitions.

Remove

Overloaded. Removes a custom style from the collection.

Top

See Also
Reference
CellStyleCollection Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see CellStyleCollection members.

Public Methods
Name

Description

Add

Overloaded. Adds a new 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.

Top

See Also

450

Reference
CellStyleCollection Class
C1.Win.C1FlexGrid Namespace

Add Method
Adds a new CellStyle object to the collection.

Overload List
Overload

Description

Add(String,CellStyle) Adds a new CellStyle object to the collection.


Add(String,String)

Adds new CellStyle object to the collection.

Add(String)

Adds a new empty CellStyle object to the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members
Add(String,CellStyle) Method
Name of the new style.
Base style, used to initialize the properties of the new style.
Adds a new CellStyle object to the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Add( _

451

ByVal name As String, _


ByVal basedOn As CellStyle _
) As CellStyle
C#
public CellStyle Add(
string name,
CellStyle basedOn
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members
Overload List
Add(String,String) Method
Name of the new style.

452

Name of the base style, used to initialize the properties of the new style.
Adds new CellStyle object to the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Add( _
ByVal name As String, _
ByVal basedOn As String _
) As CellStyle
C#
public CellStyle Add(
string name,
string basedOn
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference

453

CellStyleCollection Class
CellStyleCollection Members
Overload List
Add(String) Method
Name of the new style.
Adds a new empty CellStyle object to the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Add( _
ByVal name As String _
) As CellStyle
C#
public CellStyle Add(
string name
)

Parameters
name
Name of the new style.

Return Value
The new CellStyle object.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

454

CellStyleCollection Class
CellStyleCollection Members
Overload List

BuildString Method
Whether styles with no attributes should be included.
Builds and returns a compact string representation of the style collection.

Syntax
Visual Basic (Declaration)
Public Function BuildString( _
ByVal includeEmpty As Boolean _
) As String
C#
public string BuildString(
bool includeEmpty
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

455

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Clear Method
Clear all styles (even those in use) and reset the built-in styles.

Syntax
Visual Basic (Declaration)
Public Sub Clear()
C#
public void Clear()

Remarks
The Clear method also removes any custom styles assigned to rows, columns, and cells.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

ClearUnused Method
Clear all unused styles.

Syntax
Visual Basic (Declaration)

456

Public Sub ClearUnused()


C#
public void ClearUnused()

Remarks
Unused styles are unnamed styles that were created and are no longer assigned to any grid
elements.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Contains Method
Name of the style to look for.
Checks whether the collection contains a given style.

Syntax
Visual Basic (Declaration)
Public Function Contains( _
ByVal name As String _
) As Boolean
C#
public bool Contains(
string name
)

Parameters

457

name
Name of the style to look for.

Return Value
True if the collection contains a style called name, false otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

IndexOf Method
Style object to look for.
Gets the index of a style in the collection.

Syntax
Visual Basic (Declaration)
Public Function IndexOf( _
ByVal style As CellStyle _
) As Integer
C#
public int IndexOf(
CellStyle style
)

Parameters
style
Style object to look for.

458

Return Value
Index of the style in the collection, or -1 if the style is not a member of the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

ParseString Method
String containing style definitions.
Parses a string containing style definitions.

Syntax
Visual Basic (Declaration)
Public Function ParseString( _
ByVal styleDef As String _
) As Boolean
C#
public bool ParseString(
string styleDef
)

Parameters
styleDef
String containing style definitions.

Return Value
True if the string was parsed successfully, false otherwise.

459

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Remove Method
Removes a custom style from the collection.

Overload List
Overload

Description

Remove(Int32)

Removes a custom style from the collection.

Remove(String)

Removes a custom style from the collection.

Remove(CellStyle) Removes a custom style from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

460

CellStyleCollection Class
CellStyleCollection Members
Remove(Int32) Method
Index of the style to be removed.
Removes a custom style from the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Remove( _
ByVal index As Integer _
)
C#
public void Remove(
int index
)

Parameters
index
Index of the style to be removed.

Remarks
Built-in styles can't be removed.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members
Overload List

461

Remove(String) Method
Name of the style to be removed.
Removes a custom style from the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Remove( _
ByVal name As String _
)
C#
public void Remove(
string name
)

Parameters
name
Name of the style to be removed.

Remarks
Built-in styles can't be removed.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members
Overload List
Remove(CellStyle) Method
Style to be removed from the collection.

462

Removes a custom style from the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Remove( _
ByVal style As CellStyle _
)
C#
public void Remove(
CellStyle style
)

Parameters
style
Style to be removed from the collection.

Remarks
Built-in styles can't be removed.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members
Overload List

Properties
For a list of all members of this type, see CellStyleCollection members.

Public Properties
463

Name

Description

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.

FilterEditor

Gets the style used to paint the column filter editors.

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 CellStyle by index.

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.

SelectedColumnHeader Gets the style used to paint selected column headers.


SelectedRowHeader

Gets the style used to paint selected column headers.

464

Top

See Also
Reference
CellStyleCollection Class
C1.Win.C1FlexGrid Namespace

Alternate Property
Gets the style used to paint scrollable cells in alternate rows.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Alternate As CellStyle
C#
public CellStyle Alternate {get;}

Remarks
This style is empty by default, so all scrollable cells are rendered using the Normal style.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Count Property
Gets the number of CellStyle objects in the collection.

Syntax

465

Visual Basic (Declaration)


Public ReadOnly Property Count As Integer
C#
public int Count {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Editor Property
Gets the style used to paint the cell being edited.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Editor As CellStyle
C#
public CellStyle Editor {get;}

Remarks
This style is empty by default, so cells being edited are rendered using the Focus style.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

466

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

EmptyArea Property
Gets the style used to paint the area of the grid below and to the right of all the cells.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property EmptyArea As CellStyle
C#
public CellStyle EmptyArea {get;}

Remarks
Only the CellStyle.BackColor and CellStyle.Border elements of this style are used. They define the
appearance of the space between the last cell and the edges of the control.
The CellBorder.Color value defines the color of the lines drawn around the edge of the sheet and
between frozen and scrollable cells.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

FilterEditor Property
Gets the style used to paint the column filter editors.

467

Syntax
Visual Basic (Declaration)
Public ReadOnly Property FilterEditor As CellStyle
C#
public CellStyle FilterEditor {get;}

Remarks
This style is only used if the grid's C1FlexGridBase.AllowFiltering property is set to true.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Fixed Property
Gets the style used to paint fixed cells.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Fixed As CellStyle
C#
public CellStyle Fixed {get;}

Requirements

468

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Focus Property
Gets the style used to paint the current cell when the control has focus.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Focus As CellStyle
C#
public CellStyle Focus {get;}

Remarks
This style is empty by default, so focused cells are rendered using the Normal style.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Frozen Property
Gets the style used to paint frozen cells (frozen cells are editable and selectable, but not scrollable).

469

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Frozen As CellStyle
C#
public CellStyle Frozen {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Highlight Property
Gets the style used to paint highlighted selected cells.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Highlight As CellStyle
C#
public CellStyle Highlight {get;}

Remarks
Use the C1FlexGridBase.HighLight property to determine whether cells should be highlighted
when the control does not have the focus.
Use the C1FlexGridBase.SelectionMode property to determine what types of selection are
allowed.

470

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Item Property
Gets a CellStyle by index.

Overload List
Overload

Description

Item(Int32)

Gets a CellStyle by index.

Item(CellStyleEnum) Gets a built-in CellStyle by style type.


Item(String)

Gets a CellStyle by name.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members
Item(Int32) Property
Gets a CellStyle by index.

471

Syntax
Visual Basic (Declaration)
Public Overloads ReadOnly Property Item( _
ByVal index As Integer _
) As CellStyle
C#
public CellStyle Item(
int index
) {get;}

Parameters
index

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members
Overload List
Item(CellStyleEnum) Property
Gets a built-in CellStyle by style type.

Syntax
Visual Basic (Declaration)
Public Overloads ReadOnly Property Item( _
ByVal index As CellStyleEnum _
) As CellStyle

472

C#
public CellStyle Item(
CellStyleEnum index
) {get;}

Parameters
index

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members
Overload List
Item(String) Property
Gets a CellStyle by name.

Syntax
Visual Basic (Declaration)
Public Overloads ReadOnly Property Item( _
ByVal name As String _
) As CellStyle
C#
public CellStyle Item(
string name
) {get;}

Parameters
name

473

Remarks
If the specified name doesn't exist, this indexer returns null.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members
Overload List

NewRow Property
Gets the style used to paint cells in the new row template at the bottom of the grid.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property NewRow As CellStyle
C#
public CellStyle NewRow {get;}

Remarks
The new row template is only present when the C1FlexGridBase.AllowAddNew property is set to
true.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

474

Reference
CellStyleCollection Class
CellStyleCollection Members

Normal Property
Gets the default style used to paint scrollable cells.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Normal As CellStyle
C#
public CellStyle Normal {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Search Property
Gets the style used to paint the cell selected while auto-searching.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Search As CellStyle
C#
public CellStyle Search {get;}

Remarks
475

Use the C1FlexGridBase.AutoSearch property to enable auto-searching.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

SelectedColumnHeader Property
Gets the style used to paint selected column headers.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property SelectedColumnHeader As CellStyle
C#
public CellStyle SelectedColumnHeader {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

SelectedRowHeader Property
Gets the style used to paint selected column headers.

476

Syntax
Visual Basic (Declaration)
Public ReadOnly Property SelectedRowHeader As CellStyle
C#
public CellStyle SelectedRowHeader {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellStyleCollection Class
CellStyleCollection Members

Column
Class that represents a grid column.

Object Model

Syntax
Visual Basic (Declaration)
Public Class Column
Inherits RowCol
C#
public class Column : RowCol

Remarks

477

This class does not have a public constructor. You can add and remove columns using methods in
the grid's C1FlexGridBase.Cols property, which exposes the column collection.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowCol
C1.Win.C1FlexGrid.Column

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Members
C1.Win.C1FlexGrid Namespace

Overview
Class that represents a grid column.

Object Model

Syntax
Visual Basic (Declaration)
Public Class Column
Inherits RowCol
C#
public class Column : RowCol

Remarks

478

This class does not have a public constructor. You can add and remove columns using methods in
the grid's C1FlexGridBase.Cols property, which exposes the column collection.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowCol
C1.Win.C1FlexGrid.Column

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by Column.

Public Properties
Name

Description

ActiveFilter

Gets the IC1ColumnFilter that is currently filtering this column.

AllowDragging

Gets or sets whether the user can drag this row or column with the mouse.
(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowEditing

Gets or sets whether cells on this row or column can be edited by the user.
(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowFiltering

Gets or sets this type of filter to use for this column.

479

AllowMerging

Specifies whether adjacent cells with similar contents will be merged.


(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowResizing

Gets or sets whether the user can resize this row or column with the mouse.
(Inherited from C1.Win.C1FlexGrid.RowCol)

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

Gets or sets a list of items to be used by the drop-down editor. (Inherited


from C1.Win.C1FlexGrid.RowCol)

DataIndex

Gets the position of the column in the data source object.

DataMap

Gets or sets an System.Collections.IDictionary object used to translate data


values into display values for this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

DataType

Gets or sets the type of object stored in this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

EditMask

Gets or sets the input mask to use when editing cells on this column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

Editor

Gets or sets the custom editor used to edit cells in this column. (Inherited
from C1.Win.C1FlexGrid.RowCol)

Filter

Gets or sets the IC1ColumnFilter responsible for filtering this column.

Format

Gets or sets a string that specifies how to format the data on this column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

Grid

Gets a reference to the C1FlexGridBase control that owns this row or

480

column. (Inherited from C1.Win.C1FlexGrid.RowCol)


ImageAlign

Gets or sets an ImageAlignEnum value that determines how images are


aligned in scrollable cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

ImageAlignFixed Gets or sets an ImageAlignEnum value that determines how images are
aligned in fixed cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)
ImageAndText

Gets or sets a value that determines whether images found in this row or
column's RowCol.ImageMap should be displayed instead of or in addition to
the cell text. (Inherited from C1.Win.C1FlexGrid.RowCol)

ImageMap

Gets or sets an System.Collections.IDictionary object used to translate data


values into images for this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

Index

Overridden. Gets the index of this column in the Column collection.

IsCollapsed

Gets whether this row is collapsed. (Inherited from


C1.Win.C1FlexGrid.RowCol)

IsVisible

Gets whether this row is currently visible to the user. (Inherited from
C1.Win.C1FlexGrid.RowCol)

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.

481

Selected

Overridden. Gets or sets whether this column is selected.

Sort

Specifies how this column should be sorted when the C1FlexGridBase.Sort


method is called with a SortFlags.UseColSort flag.

Style

Gets or sets a custom CellStyle associated with this row or column. (Inherited
from C1.Win.C1FlexGrid.RowCol)

StyleDisplay

Gets the style used to display this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

StyleFixed

Gets the stock CellStyle used to paint fixed cells in this row or column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

StyleFixedDisplay Gets the style used to display fixed cells on this row or column. (Inherited
from C1.Win.C1FlexGrid.RowCol)
StyleFixedNew

Gets the custom style associated with fixed cells on this row or column,
creating a new one of necessary. (Inherited from C1.Win.C1FlexGrid.RowCol)

StyleNew

Gets or sets a custom CellStyle associated with this row or column, creating a
new style if necessary. (Inherited from C1.Win.C1FlexGrid.RowCol)

TextAlign

Gets or sets a TextAlignEnum value that determines how text is aligned in


scrollable cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

TextAlignFixed

Gets or sets a TextAlignEnum value that determines how text is aligned in


fixed cells on this row or column. (Inherited from C1.Win.C1FlexGrid.RowCol)

UserData

Gets or sets user data associated with this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

Visible

Gets or sets whether a Row or Column is visible. (Inherited from


C1.Win.C1FlexGrid.RowCol)

482

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.

Top

Public Methods
Name

Description

Clear

Overridden. Clears this Column.

Invalidate

Overridden. Invalidates this column, causing it to be repainted.

Move

Overridden. Moves a Column to a new position in the collection.

Top

See Also
Reference
Column Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see Column members.

Public Methods
Name

Description

Clear

Overridden. Clears this Column.

Invalidate

Overridden. Invalidates this column, causing it to be repainted.

Move

Overridden. Moves a Column to a new position in the collection.

Top

483

See Also
Reference
Column Class
C1.Win.C1FlexGrid Namespace

Clear Method
ClearFlags value specifying which elements of the Column should be cleared.
Clears this Column.

Syntax
Visual Basic (Declaration)
Public Overrides Sub Clear( _
ByVal clearFlags As ClearFlags _
)
C#
public override void Clear(
ClearFlags clearFlags
)

Parameters
clearFlags
ClearFlags value specifying which elements of the Column should be cleared.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

484

Invalidate Method
Invalidates this column, causing it to be repainted.

Syntax
Visual Basic (Declaration)
Public Overrides Sub Invalidate()
C#
public override void Invalidate()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Move Method
An integer specifying the column's new position.
Moves a Column to a new position in the collection.

Syntax
Visual Basic (Declaration)
Public Overrides Sub Move( _
ByVal indexNew As Integer _
)
C#
public override void Move(
int indexNew

485

Parameters
indexNew
An integer specifying the column's new position.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Properties
For a list of all members of this type, see Column members.

Public Properties
Name

Description

ActiveFilter

Gets the IC1ColumnFilter that is currently filtering this column.

AllowDragging

Gets or sets whether the user can drag this row or column with the mouse.
(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowEditing

Gets or sets whether cells on this row or column can be edited by the user.
(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowFiltering

Gets or sets this type of filter to use for this column.

AllowMerging

Specifies whether adjacent cells with similar contents will be merged.


(Inherited from C1.Win.C1FlexGrid.RowCol)

486

AllowResizing

Gets or sets whether the user can resize this row or column with the mouse.
(Inherited from C1.Win.C1FlexGrid.RowCol)

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

Gets or sets a list of items to be used by the drop-down editor. (Inherited


from C1.Win.C1FlexGrid.RowCol)

DataIndex

Gets the position of the column in the data source object.

DataMap

Gets or sets an System.Collections.IDictionary object used to translate data


values into display values for this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

DataType

Gets or sets the type of object stored in this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

EditMask

Gets or sets the input mask to use when editing cells on this column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

Editor

Gets or sets the custom editor used to edit cells in this column. (Inherited
from C1.Win.C1FlexGrid.RowCol)

Filter

Gets or sets the IC1ColumnFilter responsible for filtering this column.

Format

Gets or sets a string that specifies how to format the data on this column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

Grid

Gets a reference to the C1FlexGridBase control that owns this row or


column. (Inherited from C1.Win.C1FlexGrid.RowCol)

ImageAlign

Gets or sets an ImageAlignEnum value that determines how images are

487

aligned in scrollable cells on this row or column. (Inherited from


C1.Win.C1FlexGrid.RowCol)
ImageAlignFixed Gets or sets an ImageAlignEnum value that determines how images are
aligned in fixed cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)
ImageAndText

Gets or sets a value that determines whether images found in this row or
column's RowCol.ImageMap should be displayed instead of or in addition to
the cell text. (Inherited from C1.Win.C1FlexGrid.RowCol)

ImageMap

Gets or sets an System.Collections.IDictionary object used to translate data


values into images for this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

Index

Overridden. Gets the index of this column in the Column collection.

IsCollapsed

Gets whether this row is collapsed. (Inherited from


C1.Win.C1FlexGrid.RowCol)

IsVisible

Gets whether this row is currently visible to the user. (Inherited from
C1.Win.C1FlexGrid.RowCol)

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

Overridden. Gets or sets whether this column is selected.

488

Sort

Specifies how this column should be sorted when the C1FlexGridBase.Sort


method is called with a SortFlags.UseColSort flag.

Style

Gets or sets a custom CellStyle associated with this row or column. (Inherited
from C1.Win.C1FlexGrid.RowCol)

StyleDisplay

Gets the style used to display this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

StyleFixed

Gets the stock CellStyle used to paint fixed cells in this row or column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

StyleFixedDisplay Gets the style used to display fixed cells on this row or column. (Inherited
from C1.Win.C1FlexGrid.RowCol)
StyleFixedNew

Gets the custom style associated with fixed cells on this row or column,
creating a new one of necessary. (Inherited from C1.Win.C1FlexGrid.RowCol)

StyleNew

Gets or sets a custom CellStyle associated with this row or column, creating a
new style if necessary. (Inherited from C1.Win.C1FlexGrid.RowCol)

TextAlign

Gets or sets a TextAlignEnum value that determines how text is aligned in


scrollable cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

TextAlignFixed

Gets or sets a TextAlignEnum value that determines how text is aligned in


fixed cells on this row or column. (Inherited from C1.Win.C1FlexGrid.RowCol)

UserData

Gets or sets user data associated with this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

Visible

Gets or sets whether a Row or Column is visible. (Inherited from


C1.Win.C1FlexGrid.RowCol)

Width

Gets or sets the width of this column, in pixels (the value -1 represents the

489

default column width).


WidthDisplay

Gets or sets the display width for this column, in pixels.

Top

See Also
Reference
Column Class
C1.Win.C1FlexGrid Namespace

ActiveFilter Property
Gets the IC1ColumnFilter that is currently filtering this column.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property ActiveFilter As IC1ColumnFilter
C#
public IC1ColumnFilter ActiveFilter {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

AllowFiltering Property
Example

Gets or sets this type of filter to use for this column.

490

Syntax
Visual Basic (Declaration)
Public Property AllowFiltering As AllowFiltering
C#
public AllowFiltering AllowFiltering {get; set;}

Remarks
The grid has an C1FlexGridBase.AllowFiltering property that determines whether columns can be
filtered by the user. If that property is set to true, then filters are created automatically for each
column based on the setting of the column's AllowFiltering property.
The grid provides condition and value filters. Condition filters allow users to specify conditions such
as 'value > 10'. Value filters allow users to select values that should be displayed from a list of
values present in the data source. All filters can be customized in code as shown in the examples
below.

Example
The code below customizes the filters for two columns. The "ShipRegion" column is initialized to
show only two states, AK and CA. The "UnitPrice" column is initialized to show only items with unit
price greater than $30. After the column filters have been initialized, the code calls the
C1FlexGridBase.ApplyFilters method to apply the filters.

C#

// initialize "ShipRegion" column filter to show only two values: "AK" and "CA"
var col = _flex.Cols["ShipRegion"];
col.AllowFiltering = AllowFiltering.ByValue;
var vf = col.Filter as ValueFilter;
vf.ShowValues = new object[] { "AK", "CA" };
// initialize "UnitPrice" column filter to show only values greater than $30
col = _flex.Cols["UnitPrice"];
col.AllowFiltering = AllowFiltering.ByCondition;
var cf = col.Filter as ConditionFilter;
cf.Condition1.Operator = ConditionOperator.GreaterThan;
cf.Condition1.Parameter = 30;
// apply both column filters to the data
_flex.ApplyFilters();

Requirements

491

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

AllowSorting Property
Gets or sets whether this column can be sorted by clicking on the column header.

Syntax
Visual Basic (Declaration)
Public Property AllowSorting As Boolean
C#
public bool AllowSorting {get; set;}

Remarks
The grid has an C1FlexGridBase.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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Caption Property
Gets or sets the text of the column's header cell.

492

Syntax
Visual Basic (Declaration)
Public Property Caption As String
C#
public string Caption {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

DataIndex Property
Gets the position of the column in the data source object.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property DataIndex As Integer
C#
public int DataIndex {get;}

Remarks
This property returns -1 for fixed and unbound columns.

Requirements

493

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Filter Property
Gets or sets the IC1ColumnFilter responsible for filtering this column.

Syntax
Visual Basic (Declaration)
Public Property Filter As IC1ColumnFilter
C#
public IC1ColumnFilter Filter {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Index Property
Gets the index of this column in the Column collection.

Syntax
Visual Basic (Declaration)

494

Public Overrides ReadOnly Property Index As Integer


C#
public override int Index {get;}

Remarks
Returns -1 if the column is not a member of the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Item Property
Gets or sets the cell value specified by the row index in this column.

Syntax
Visual Basic (Declaration)
Public Default Property Item( _
ByVal rowIndex As Integer _
) As Object
C#
public object this[
int rowIndex
]; {get; set;}

Parameters
rowIndex

495

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Left Property
Gets the position of the left of this column, in pixels, relative to the grid.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Left As Integer
C#
public int Left {get;}

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 C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.ScrollPosition property.
To retrieve the size and position of a cell, use the C1FlexGridBase.GetCellRect method.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

496

Column Class
Column Members

Name Property
Gets or sets the name of this column.

Syntax
Visual Basic (Declaration)
Public Property Name As String
C#
public string Name {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Right Property
Gets the position of the right of this column, in pixels, relative to the grid.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Right As Integer

497

C#
public int Right {get;}

Remarks
The value returned corresponds to the sum of the Left and WidthDisplay properties.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

SafeIndex Property
Gets the index of this column in the Column collection.

Syntax
Visual Basic (Declaration)
Public Overridable ReadOnly Property SafeIndex As Integer
C#
public virtual int SafeIndex {get;}

Remarks
This property is similar to the Index property, except it throws an exception if the Column is not a
member of the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

498

See Also
Reference
Column Class
Column Members

Selected Property
Gets or sets whether this column is selected.

Syntax
Visual Basic (Declaration)
Public Overrides Property Selected As Boolean
C#
public override bool Selected {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Sort Property
Specifies how this column should be sorted when the C1FlexGridBase.Sort method is called with a
SortFlags.UseColSort flag.

Syntax
Visual Basic (Declaration)
Public Property Sort As SortFlags

499

C#
public SortFlags Sort {get; set;}

Remarks
Use this property when you want to sort multiple columns in different orders. For example, you
could set the Sort property to SortFlags.Ascending for columns 1, 2, and 3, and to
SortFlags.Descending for columns 4, 5, and 6. You would then call the grid's C1FlexGridBase.Sort
method with the sort parameter set to SortFlags.UseColSort to perform the sort using the order
specified for each column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

Width Property
Gets or sets the width of this column, in pixels (the value -1 represents the default column width).

Syntax
Visual Basic (Declaration)
Public Property Width As Integer
C#
public int Width {get; set;}

Remarks
Setting this property to -1 causes the grid to use the default column width for this column (see the
RowColCollection.DefaultSize property).

500

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Column Class
Column Members

WidthDisplay Property
Gets or sets the display width for this column, in pixels.

Syntax
Visual Basic (Declaration)
Public Property WidthDisplay As Integer
C#
public int WidthDisplay {get; set;}

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).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

501

Column Class
Column Members

ColumnCollection
Collection of grid Column objects.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ColumnCollection
Inherits RowColCollection
C#
public class ColumnCollection : RowColCollection

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowColCollection
C1.Win.C1FlexGrid.ColumnCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnCollection Members
C1.Win.C1FlexGrid Namespace

Overview
Collection of grid Column objects.

Object Model
502

Syntax
Visual Basic (Declaration)
Public Class ColumnCollection
Inherits RowColCollection
C#
public class ColumnCollection : RowColCollection

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowColCollection
C1.Win.C1FlexGrid.ColumnCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnCollection Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by ColumnCollection.

Public Properties
Name

Description

Count

Overridden. Gets or sets the number of Column objects in this collection.

503

DefaultSize

Gets or sets the default size of the rows or columns in the collection (in
pixels). (Inherited from C1.Win.C1FlexGrid.RowColCollection)

Fixed

Overridden. Gets or sets the number of fixed columns in this collection.

Frozen

Gets or sets the number of frozen rows or columns in the collection.


(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Grid

Gets a reference to the C1FlexGridBase control that owns this collection.


(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Item

Gets the Column at the specified index.

MaxSize

Gets or sets the maximum size for rows and columns in the collection.
(Inherited from C1.Win.C1FlexGrid.RowColCollection)

MinSize

Gets or sets the minimum size for rows and columns in the collection.
(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Selected

Gets a collection of Column objects that are currently selected.

Top

Public Methods
Name

Description

Add

Overloaded. Appends a new Column object to this collection.

BuildString

Gets a string build a string that contains a complete description of the


column collection, suitable for persisting the control state.

Contains

Overloaded. Gets a value that determines whether the collection contains a


Column with the given name.

GetNext

Gets the index of the next visible row or column. (Inherited from

504

C1.Win.C1FlexGrid.RowColCollection)
GetPrevious

Gets the index of the previous visible row or column. (Inherited from
C1.Win.C1FlexGrid.RowColCollection)

IndexOf

Overloaded. 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

Overridden. Moves a Column object to a new position in the collection.

MoveRange

Overridden. Moves a range of Column objects to a new position in the


collection.

ParseString

Parses a string containg a description of the column collection (usually


obtained by calling the BuildString method) and applies it to a grid.

Remove

Overloaded. Removes a Column object from the collection.

RemoveRange

Removes a range of Column objects from the collection.

Top

See Also
Reference
ColumnCollection Class
C1.Win.C1FlexGrid Namespace

Methods
>
Name
Add

Description
Overloaded. Appends a new Column object to this collection.

505

BuildString

Contains

GetNext

GetPrevious

Gets a string build a string that contains a complete description of the


column collection, suitable for persisting the control state.
Overloaded. Gets a value that determines whether the collection contains a
Column with the given name.
Gets the index of the next visible row or column. (Inherited from
C1.Win.C1FlexGrid.RowColCollection)
Gets the index of the previous visible row or column. (Inherited from
C1.Win.C1FlexGrid.RowColCollection)

IndexOf

Overloaded. 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

Overridden. Moves a Column object to a new position in the collection.

MoveRange

ParseString

Overridden. Moves a range of Column objects to a new position in the


collection.
Parses a string containg a description of the column collection (usually
obtained by calling the BuildString method) and applies it to a grid.

Remove

Overloaded. Removes a Column object from the collection.

RemoveRange

Removes a range of Column objects from the collection.

Top

See Also
Reference
ColumnCollection Class
C1.Win.C1FlexGrid Namespace

Add Method
Appends a new Column object to this collection.

Overload List

506

Overload

Description

Add()

Appends a new Column object to this collection.

Add(Int32)

Appends a given number of Column objects to the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
Add() Method
Appends a new Column object to this collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Add() As Column
C#
public Column Add()

Return Value
A reference to the Column that was added to the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
507

Reference
ColumnCollection Class
ColumnCollection Members
Overload List
Add(Int32) Method
Number of columns to add to the collection.
Appends a given number of Column objects to the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Add( _
ByVal count As Integer _
)
C#
public void Add(
int count
)

Parameters
count
Number of columns to add to the collection.

Remarks
This method adds the new columns to the end of the collection. To insert columns at specific
positions, use the Insert or InsertRange methods.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
508

ColumnCollection Class
ColumnCollection Members
Overload List

BuildString Method
Whether to include default values in the description.
Gets a string build a string that contains a complete description of the column collection, suitable
for persisting the control state.

Syntax
Visual Basic (Declaration)
Public Function BuildString( _
ByVal includeDefault As Boolean _
) As String
C#
public string BuildString(
bool includeDefault
)

Parameters
includeDefault
Whether to include default values in the description.

Return Value
A string that describes the column collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

509

ColumnCollection Class
ColumnCollection Members

Contains Method
Gets a value that determines whether the collection contains a Column with the given name.

Overload List
Overload

Description

Contains(String)

Gets a value that determines whether the collection contains a Column with the
given name.

Contains(RowCol)

Determines whether the collection contains a given row or column. (Inherited


from C1.Win.C1FlexGrid.RowColCollection)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
Contains(String) Method
Column name to look for (case-insensitive).
Gets a value that determines whether the collection contains a Column with the given name.

Syntax
Visual Basic (Declaration)
Public Overloads Function Contains( _
ByVal columnName As String _
) As Boolean

510

C#
public bool Contains(
string columnName
)

Parameters
columnName
Column name to look for (case-insensitive).

Return Value
True if the collection contains a column with the given name, False otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
Overload List

IndexOf Method
Gets the index of the Column with the specified name.

Overload List
Overload

Description

IndexOf(String)

Gets the index of the Column with the specified name.

IndexOf(String,Boolean) Gets the index of the Column with the specified name, optionally throwing
an exception if the column is not found.

Requirements
511

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
IndexOf(String) Method
Column name to look for (case-insensitive).
Gets the index of the Column with the specified name.

Syntax
Visual Basic (Declaration)
Public Overloads Function IndexOf( _
ByVal columnName As String _
) As Integer
C#
public int IndexOf(
string columnName
)

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.

Requirements

512

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
Overload List
IndexOf(String,Boolean) Method
Example

Column name to look for (case-insensitive).


Whether to throw and exception if the column cannot be found.
Gets the index of the Column with the specified name, optionally throwing an exception if the
column is not found.

Syntax
Visual Basic (Declaration)
Public Overloads Function IndexOf( _
ByVal columnName As String, _
ByVal throwIfNotFound As Boolean _
) As Integer
C#
public int IndexOf(
string columnName,
bool throwIfNotFound
)

Parameters
columnName
Column name to look for (case-insensitive).
throwIfNotFound

513

Whether to throw and exception if the column cannot be found.

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.

Remarks
If the throwIfNotFound parameter is set to true and a column named columnName
cannot be found, the control throws an System.ArgumentOutOfRangeException. This
makes it easier to write compact code that relies on column names.

Example
The example below uses the IndexOf method to convert column names into indices.
Note that if the column names are invalid, the exception will be thrown by the IndexOf
method (column not found) rather than in the following method, where it would not be
as clear (invalid index).

C#

int columnIndex = _flex.Cols.IndexOf("total");


_flex.AutoSizeCol(columnIndex);

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
Overload List

Insert Method
The position where the new column will be inserted.
Adds a new Column object to this collection at a specified position.

Syntax

514

Visual Basic (Declaration)


Public Function Insert( _
ByVal index As Integer _
) As Column
C#
public Column Insert(
int index
)

Parameters
index
The position where the new column will be inserted.

Return Value
A reference to the Column that was inserted to the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members

InsertRange Method
The position where the new range will be inserted.
The number of columns to add.
Adds a range of Column objects to the collection at a specified position.

Syntax

515

Visual Basic (Declaration)


Public Sub InsertRange( _
ByVal index As Integer, _
ByVal count As Integer _
)
C#
public void InsertRange(
int index,
int count
)

Parameters
index
The position where the new range will be inserted.
count
The number of columns to add.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members

Move Method
Index of the column to be moved.
New position for the column.
Moves a Column object to a new position in the collection.

Syntax
516

Visual Basic (Declaration)


Public Overrides Sub Move( _
ByVal indexOld As Integer, _
ByVal indexNew As Integer _
)
C#
public override void Move(
int indexOld,
int indexNew
)

Parameters
indexOld
Index of the column to be moved.
indexNew
New position for the column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members

MoveRange Method
The index of the first column in the range that will be moved.
The number of columns that will be moved.
New position for the first column in the range.
Moves a range of Column objects to a new position in the collection.

517

Syntax
Visual Basic (Declaration)
Public Overrides Sub MoveRange( _
ByVal index As Integer, _
ByVal count As Integer, _
ByVal indexNew As Integer _
)
C#
public override void MoveRange(
int index,
int count,
int indexNew
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members

518

ParseString Method
Grid that receives the column collection.
String that contains the column collection definition.
Parses a string containg a description of the column collection (usually obtained by calling the
BuildString method) and applies it to a grid.

Syntax
Visual Basic (Declaration)
Public Function ParseString( _
ByVal grid As C1FlexGridBase, _
ByVal str As String _
) As Boolean
C#
public bool ParseString(
C1FlexGridBase grid,
string str
)

Parameters
grid
Grid that receives the column collection.
str
String that contains the column collection definition.

Return Value
True if the column definition was applied successfully.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
519

Reference
ColumnCollection Class
ColumnCollection Members

Remove Method
Removes a Column object from the collection.

Overload List
Overload

Description

Remove(Int32)

Removes a Column object from the collection.

Remove(Column)

Removes a Column object from the collection.

Remove(String)

Removes a Column object from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
Remove(Int32) Method
The index of the column to remove from the collection.
Removes a Column object from the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Remove( _
ByVal index As Integer _

520

) As Column
C#
public Column Remove(
int index
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
Overload List
Remove(Column) Method
The column to remove.
Removes a Column object from the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Remove( _
ByVal column As Column _
) As Column

521

C#
public Column Remove(
Column column
)

Parameters
column
The column to remove.

Return Value
A reference to the Column that was removed from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
Overload List
Remove(String) Method
Name of the column to remove.
Removes a Column object from the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Remove( _
ByVal columnName As String _
) As Column
C#

522

public Column Remove(


string columnName
)

Parameters
columnName
Name of the column to remove.

Return Value
A reference to the Column that was removed from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members
Overload List

RemoveRange Method
The index of the first column to remove from the collection.
The number of columns to remove from the collection.
Removes a range of Column objects from the collection.

Syntax
Visual Basic (Declaration)
Public Sub RemoveRange( _
ByVal index As Integer, _
ByVal count As Integer _
)

523

C#
public void RemoveRange(
int index,
int count
)

Parameters
index
The index of the first column to remove from the collection.
count
The number of columns to remove from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members

Properties
For a list of all members of this type, see ColumnCollection members.

Public Properties
Name

Description

Count

Overridden. Gets or sets the number of Column objects in this collection.

DefaultSize

Gets or sets the default size of the rows or columns in the collection (in
pixels). (Inherited from C1.Win.C1FlexGrid.RowColCollection)

524

Fixed

Overridden. Gets or sets the number of fixed columns in this collection.

Frozen

Gets or sets the number of frozen rows or columns in the collection.


(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Grid

Gets a reference to the C1FlexGridBase control that owns this collection.


(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Item

Gets the Column at the specified index.

MaxSize

Gets or sets the maximum size for rows and columns in the collection.
(Inherited from C1.Win.C1FlexGrid.RowColCollection)

MinSize

Gets or sets the minimum size for rows and columns in the collection.
(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Selected

Gets a collection of Column objects that are currently selected.

Top

See Also
Reference
ColumnCollection Class
C1.Win.C1FlexGrid Namespace

Count Property
Gets or sets the number of Column objects in this collection.

Syntax
Visual Basic (Declaration)
Public Overrides Property Count As Integer
C#
public override int Count {get; set;}

525

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members

Fixed Property
Gets or sets the number of fixed columns in this collection.

Syntax
Visual Basic (Declaration)
Public Overrides Property Fixed As Integer
C#
public override int Fixed {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members

526

Item Property
Gets the Column at the specified index.

Syntax
Visual Basic (Declaration)
Public Shadows ReadOnly Default Property Item( _
ByVal index As Integer _
) As Column
C#
public new Column this[
int index
]; {get;}

Parameters
index

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members

Selected Property
Gets a collection of Column objects that are currently selected.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Selected As ColumnCollection

527

C#
public ColumnCollection Selected {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnCollection Class
ColumnCollection Members

ColumnFilter
Represents a filter that contains a ValueFilter and a ConditionFilter.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ColumnFilter
Implements IC1ColumnFilter
C#
public class ColumnFilter : IC1ColumnFilter

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.ColumnFilter

Requirements

528

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnFilter Members
C1.Win.C1FlexGrid Namespace

Overview
Represents a filter that contains a ValueFilter and a ConditionFilter.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ColumnFilter
Implements IC1ColumnFilter
C#
public class ColumnFilter : IC1ColumnFilter

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.ColumnFilter

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

529

ColumnFilter Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by ColumnFilter.

Public Constructors
Name

Description

ColumnFilter Constructor
Top

Public Properties
Name

Description

ConditionFilter

Gets the ConditionFilter contained in this ColumnFilter.

IsActive

Gets or sets a value that determines whether the filter is active.

ValueFilter

Gets the ValueFilter contained in this ColumnFilter.

Top

Public Methods
Name

Description

Apply

Applies the filter to a value.

GetEditor

Gets the editor used to modify the filter at run time.

Reset

Resets the filter making it inactive.

Top

See Also
530

Reference
ColumnFilter Class
C1.Win.C1FlexGrid Namespace

ColumnFilter Constructor

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public ColumnFilter()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnFilter Class
ColumnFilter Members

Methods
>
Name

Description

Apply

Applies the filter to a value.

GetEditor

Gets the editor used to modify the filter at run time.

Reset

Resets the filter making it inactive.

Top

See Also
Reference

531

ColumnFilter Class
C1.Win.C1FlexGrid Namespace

Apply Method
Value to be filtered.
Applies the filter to a value.

Syntax
Visual Basic (Declaration)
Public Function Apply( _
ByVal value As Object _
) As Boolean
C#
public bool Apply(
object value
)

Parameters
value
Value to be filtered.

Return Value
True if the value satisfies the filter; False otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
ColumnFilter Class
ColumnFilter Members

532

GetEditor Method
Gets the editor used to modify the filter at run time.

Syntax
Visual Basic (Declaration)
Public Function GetEditor() As IC1ColumnFilterEditor
C#
public IC1ColumnFilterEditor GetEditor()

Return Value
A IC1ColumnFilterEditor that is used to edit the filter at run time.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnFilter Class
ColumnFilter Members

Reset Method
Resets the filter making it inactive.

Syntax
Visual Basic (Declaration)
Public Sub Reset()
C#
public void Reset()

Requirements

533

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnFilter Class
ColumnFilter Members

Properties
For a list of all members of this type, see ColumnFilter members.

Public Properties
Name

Description

ConditionFilter

Gets the ConditionFilter contained in this ColumnFilter.

IsActive

Gets or sets a value that determines whether the filter is active.

ValueFilter

Gets the ValueFilter contained in this ColumnFilter.

Top

See Also
Reference
ColumnFilter Class
C1.Win.C1FlexGrid Namespace

ConditionFilter Property
Gets the ConditionFilter contained in this ColumnFilter.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property ConditionFilter As ConditionFilter

534

C#
public ConditionFilter ConditionFilter {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnFilter Class
ColumnFilter Members

IsActive Property
Gets or sets a value that determines whether the filter is active.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property IsActive As Boolean
C#
public bool IsActive {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnFilter Class
ColumnFilter Members

ValueFilter Property
Gets the ValueFilter contained in this ColumnFilter.

535

Syntax
Visual Basic (Declaration)
Public ReadOnly Property ValueFilter As ValueFilter
C#
public ValueFilter ValueFilter {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ColumnFilter Class
ColumnFilter Members

ComboBoxEditor
Helper class that provides information about a currently active ComboBox editor.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ComboBoxEditor
C#
public class ComboBoxEditor

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.ComboBoxEditor

536

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ComboBoxEditor Members
C1.Win.C1FlexGrid Namespace

Overview
Helper class that provides information about a currently active ComboBox editor.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ComboBoxEditor
C#
public class ComboBoxEditor

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.ComboBoxEditor

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

537

Reference
ComboBoxEditor Members
C1.Win.C1FlexGrid Namespace

Members
Properties

The following tables list the members exposed by ComboBoxEditor.

Public Properties
Name

Description

Items

Gets the collection of items in the currently active ComboBox editor.

SelectedIndex

Gets or sets the selected index in the currently active ComboBox editor.

SelectedItem

Gets or sets the selected item in the currently active ComboBox editor.

SelectedKey

Gets the key that corresponds to the selected item in the currently active
ComboBox editor.

Top

See Also
Reference
ComboBoxEditor Class
C1.Win.C1FlexGrid Namespace

Properties
For a list of all members of this type, see ComboBoxEditor members.

Public Properties
Name

Description

Items

Gets the collection of items in the currently active ComboBox editor.

538

SelectedIndex

Gets or sets the selected index in the currently active ComboBox editor.

SelectedItem

Gets or sets the selected item in the currently active ComboBox editor.

SelectedKey

Gets the key that corresponds to the selected item in the currently active
ComboBox editor.

Top

See Also
Reference
ComboBoxEditor Class
C1.Win.C1FlexGrid Namespace

Items Property
Gets the collection of items in the currently active ComboBox editor.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Items As IList
C#
public IList Items {get;}

Remarks
If there's no active editor, or if the editor is not a ComboBox, the value returned is null.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

539

ComboBoxEditor Class
ComboBoxEditor Members

SelectedIndex Property
Gets or sets the selected index in the currently active ComboBox editor.

Syntax
Visual Basic (Declaration)
Public Property SelectedIndex As Integer
C#
public int SelectedIndex {get; set;}

Remarks
If there's no active editor, or if the editor is not a ComboBox, the value returned is -1.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ComboBoxEditor Class
ComboBoxEditor Members

SelectedItem Property
Gets or sets the selected item in the currently active ComboBox editor.

Syntax
Visual Basic (Declaration)
Public Property SelectedItem As Object
C#

540

public object SelectedItem {get; set;}

Remarks
If there's no active editor, or if the editor is not a ComboBox, the value returned is null.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ComboBoxEditor Class
ComboBoxEditor Members

SelectedKey Property
Gets the key that corresponds to the selected item in the currently active ComboBox editor.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property SelectedKey As Object
C#
public object SelectedKey {get;}

Remarks
If there's no active editor, if the editor is not a ComboBox, or if the cell being edited does not have
an associated DataMap, the value returned is null.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
541

Reference
ComboBoxEditor Class
ComboBoxEditor Members

Condition
Represents a condition within a ConditionFilter.

Object Model

Syntax
Visual Basic (Declaration)
Public Class Condition
C#
public class Condition

Remarks
Each ConditionFilter contains up to two conditions that can be combined with 'And' or 'Or'
operators.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.Condition

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Condition Members
C1.Win.C1FlexGrid Namespace

542

Overview
Represents a condition within a ConditionFilter.

Object Model

Syntax
Visual Basic (Declaration)
Public Class Condition
C#
public class Condition

Remarks
Each ConditionFilter contains up to two conditions that can be combined with 'And' or 'Or'
operators.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.Condition

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Condition Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by Condition.

543

Public Properties
Name

Description

IsActive

Gets a value that indicates whether the condition is active.

Operator

Gets or sets the operator used by this condition.

Parameter

Gets or sets the parameter used by this condition.

Top

Public Methods
Name

Description

Apply

Applies the condition to a given value.

Clear

Clears this condition by setting the Operator to 'None' and the Parameter to
null.

Top

See Also
Reference
Condition Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see Condition members.

Public Methods
Name

Description

Apply

Applies the condition to a given value.

544

Clear

Clears this condition by setting the Operator to 'None' and the Parameter to
null.

Top

See Also
Reference
Condition Class
C1.Win.C1FlexGrid Namespace

Apply Method
Value to test.
Applies the condition to a given value.

Syntax
Visual Basic (Declaration)
Public Function Apply( _
ByVal value As Object _
) As Boolean
C#
public bool Apply(
object value
)

Parameters
value
Value to test.

Return Value
True if the value satisfies the condition, false otherwise.

Requirements

545

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Condition Class
Condition Members

Clear Method
Clears this condition by setting the Operator to 'None' and the Parameter to null.

Syntax
Visual Basic (Declaration)
Public Sub Clear()
C#
public void Clear()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Condition Class
Condition Members

Properties
For a list of all members of this type, see Condition members.

Public Properties
Name

Description

546

IsActive

Gets a value that indicates whether the condition is active.

Operator

Gets or sets the operator used by this condition.

Parameter

Gets or sets the parameter used by this condition.

Top

See Also
Reference
Condition Class
C1.Win.C1FlexGrid Namespace

IsActive Property
Gets a value that indicates whether the condition is active.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property IsActive As Boolean
C#
public bool IsActive {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Condition Class
Condition Members

Operator Property
Gets or sets the operator used by this condition.

547

Syntax
Visual Basic (Declaration)
Public Property Operator As ConditionOperator
C#
public ConditionOperator Operator {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Condition Class
Condition Members

Parameter Property
Gets or sets the parameter used by this condition.

Syntax
Visual Basic (Declaration)
Public Property Parameter As Object
C#
public object Parameter {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

548

Reference
Condition Class
Condition Members

ConditionFilter
Represents a filter based on one or two logical conditions.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ConditionFilter
Implements IC1ColumnFilter
C#
public class ConditionFilter : IC1ColumnFilter

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.ConditionFilter

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Members
C1.Win.C1FlexGrid Namespace

Overview
Represents a filter based on one or two logical conditions.

549

Object Model

Syntax
Visual Basic (Declaration)
Public Class ConditionFilter
Implements IC1ColumnFilter
C#
public class ConditionFilter : IC1ColumnFilter

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.ConditionFilter

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by ConditionFilter.

Public Constructors
Name

Description

550

ConditionFilter Constructor Initializes a new instance of a ConditionFilter.


Top

Public Properties
Name

Description

AndConditions

Gets or sets whether the filter conditions should be combined with an 'And'
or with an 'Or' operator.

Condition1

Gets the first filter condition.

Condition2

Gets the second filter condition.

IsActive

Gets or sets a value that determines whether the filter is active.

Top

Public Methods
Name

Description

Apply

Applies the filter to a value.

Clone

Creates a clone of this ConditionFilter.

GetEditor

Gets the editor used to modify the filter at run time.

Reset

Resets the filter making it inactive.

Top

See Also
Reference
ConditionFilter Class
C1.Win.C1FlexGrid Namespace

551

ConditionFilter Constructor
Initializes a new instance of a ConditionFilter.

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public ConditionFilter()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Class
ConditionFilter Members

Methods
For a list of all members of this type, see ConditionFilter members.

Public Methods
Name

Description

Apply

Applies the filter to a value.

Clone

Creates a clone of this ConditionFilter.

GetEditor

Gets the editor used to modify the filter at run time.

Reset

Resets the filter making it inactive.

Top

552

See Also
Reference
ConditionFilter Class
C1.Win.C1FlexGrid Namespace

Apply Method
Value to be filtered.
Applies the filter to a value.

Syntax
Visual Basic (Declaration)
Public Function Apply( _
ByVal value As Object _
) As Boolean
C#
public bool Apply(
object value
)

Parameters
value
Value to be filtered.

Return Value
True if the value satisfies the filter; False otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

553

ConditionFilter Class
ConditionFilter Members

Clone Method
Creates a clone of this ConditionFilter.

Syntax
Visual Basic (Declaration)
Public Function Clone() As ConditionFilter
C#
public ConditionFilter Clone()

Return Value
A clone of this ConditionFilter.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Class
ConditionFilter Members

GetEditor Method
Gets the editor used to modify the filter at run time.

Syntax
Visual Basic (Declaration)
Public Function GetEditor() As IC1ColumnFilterEditor
C#

554

public IC1ColumnFilterEditor GetEditor()

Return Value
A System.Windows.Forms.Control that is used to modify the filter at run time.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Class
ConditionFilter Members

Reset Method
Resets the filter making it inactive.

Syntax
Visual Basic (Declaration)
Public Sub Reset()
C#
public void Reset()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Class
ConditionFilter Members

555

Properties
For a list of all members of this type, see ConditionFilter members.

Public Properties
Name

Description

AndConditions

Gets or sets whether the filter conditions should be combined with an 'And'
or with an 'Or' operator.

Condition1

Gets the first filter condition.

Condition2

Gets the second filter condition.

IsActive

Gets or sets a value that determines whether the filter is active.

Top

See Also
Reference
ConditionFilter Class
C1.Win.C1FlexGrid Namespace

AndConditions Property
Gets or sets whether the filter conditions should be combined with an 'And' or with an 'Or'
operator.

Syntax
Visual Basic (Declaration)
Public Property AndConditions As Boolean
C#
public bool AndConditions {get; set;}

Requirements

556

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Class
ConditionFilter Members

Condition1 Property
Gets the first filter condition.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Condition1 As Condition
C#
public Condition Condition1 {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Class
ConditionFilter Members

Condition2 Property
Gets the second filter condition.

Syntax
Visual Basic (Declaration)

557

Public ReadOnly Property Condition2 As Condition


C#
public Condition Condition2 {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Class
ConditionFilter Members

IsActive Property
Gets or sets a value that determines whether the filter is active.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property IsActive As Boolean
C#
public bool IsActive {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ConditionFilter Class
ConditionFilter Members

558

DragRowColEventArgs
Provides data for the C1FlexGridBase.BeforeDragColumn, C1FlexGridBase.BeforeDragRow,
C1FlexGridBase.AfterDragColumn, and C1FlexGridBase.AfterDragRow events.

Object Model

Syntax
Visual Basic (Declaration)
Public Class DragRowColEventArgs
Inherits System.EventArgs
C#
public class DragRowColEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.DragRowColEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
DragRowColEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.BeforeDragColumn, C1FlexGridBase.BeforeDragRow,
C1FlexGridBase.AfterDragColumn, and C1FlexGridBase.AfterDragRow events.

Object Model
559

Syntax
Visual Basic (Declaration)
Public Class DragRowColEventArgs
Inherits System.EventArgs
C#
public class DragRowColEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.DragRowColEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
DragRowColEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by DragRowColEventArgs.

Public Constructors
Name

Description

DragRowColEventArgs Constructor Initializes a new instance of the DragRowColEventArgs

560

class.
Top

Public Fields
Name

Description

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.

Top

See Also
Reference
DragRowColEventArgs Class
C1.Win.C1FlexGrid Namespace

DragRowColEventArgs Constructor
The original index of the row that was dragged by the user.
The original index of the column that was dragged by the user.
The new index of the column or row.
Initializes a new instance of the DragRowColEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal row As Integer, _

561

ByVal col As Integer, _


ByVal position As Integer _
)
C#
public DragRowColEventArgs(
int row,
int col,
int position
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
DragRowColEventArgs Class
DragRowColEventArgs Members

Fields
For a list of all members of this type, see DragRowColEventArgs members.

Public Fields

562

Name

Description

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.

Top

See Also
Reference
DragRowColEventArgs Class
C1.Win.C1FlexGrid Namespace

Cancel Field
Gets or sets a value indicating whether the drag operation should be canceled.

Syntax
Visual Basic (Declaration)
Public Cancel As Boolean
C#
public bool Cancel

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

563

DragRowColEventArgs Class
DragRowColEventArgs Members

Col Field
Gets the original index of the column that was dragged by the user.

Syntax
Visual Basic (Declaration)
Public ReadOnly Col As Integer
C#
public readonly int Col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
DragRowColEventArgs Class
DragRowColEventArgs Members

Position Field
Gets the new index of the column or row that was dragged by the user.

Syntax
Visual Basic (Declaration)
Public Position As Integer
C#
public int Position

Requirements

564

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
DragRowColEventArgs Class
DragRowColEventArgs Members

Row Field
Gets the original index of the row that was dragged by the user.

Syntax
Visual Basic (Declaration)
Public ReadOnly Row As Integer
C#
public readonly int Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
DragRowColEventArgs Class
DragRowColEventArgs Members

GetErrorInfoEventArgs
Provides data for the C1FlexGridBase.GetCellErrorInfo and C1FlexGridBase.GetRowErrorInfo
events.

Object Model

565

Syntax
Visual Basic (Declaration)
Public Class GetErrorInfoEventArgs
Inherits System.EventArgs
C#
public class GetErrorInfoEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.GetErrorInfoEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetErrorInfoEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.GetCellErrorInfo and C1FlexGridBase.GetRowErrorInfo
events.

Object Model

Syntax
Visual Basic (Declaration)

566

Public Class GetErrorInfoEventArgs


Inherits System.EventArgs
C#
public class GetErrorInfoEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.GetErrorInfoEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetErrorInfoEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by GetErrorInfoEventArgs.

Public Constructors
Name

Description

GetErrorInfoEventArgs Constructor Initializes a new instance of the GetErrorInfoEventArgs


class.
Top

Public Fields

567

Name

Description

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.

Top

See Also
Reference
GetErrorInfoEventArgs Class
C1.Win.C1FlexGrid Namespace

GetErrorInfoEventArgs Constructor
The row index when error information is needed for a cell or row.
The column index when error information is needed for a cell or row.
Initializes a new instance of the GetErrorInfoEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal row As Integer, _
ByVal col As Integer _
)
C#
public GetErrorInfoEventArgs(
int row,
int col
)

Parameters

568

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GetErrorInfoEventArgs Class
GetErrorInfoEventArgs Members

Fields
For a list of all members of this type, see GetErrorInfoEventArgs members.

Public Fields
Name

Description

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.

Top

See Also
Reference
GetErrorInfoEventArgs Class
C1.Win.C1FlexGrid Namespace

569

Col Field
Gets the index of the column that may contain errors (or -1 if checking for row errors).

Syntax
Visual Basic (Declaration)
Public ReadOnly Col As Integer
C#
public readonly int Col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetErrorInfoEventArgs Class
GetErrorInfoEventArgs Members

ErrorText Field
Gets or sets a message that describes the error.

Syntax
Visual Basic (Declaration)
Public ErrorText As String
C#
public string ErrorText

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

570

See Also
Reference
GetErrorInfoEventArgs Class
GetErrorInfoEventArgs Members

Row Field
Gets the index of the row that may contain errors.

Syntax
Visual Basic (Declaration)
Public ReadOnly Row As Integer
C#
public readonly int Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetErrorInfoEventArgs Class
GetErrorInfoEventArgs Members

GetLocalizedStringEventArgs
Provides data for the C1FlexGridBase.GetLocalizedString event.

Object Model

Syntax
Visual Basic (Declaration)

571

Public Class GetLocalizedStringEventArgs


Inherits System.EventArgs
C#
public class GetLocalizedStringEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.GetLocalizedStringEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetLocalizedStringEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.GetLocalizedString event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GetLocalizedStringEventArgs
Inherits System.EventArgs
C#
public class GetLocalizedStringEventArgs : System.EventArgs

572

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.GetLocalizedStringEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetLocalizedStringEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by GetLocalizedStringEventArgs.

Public Constructors
Name

Description

GetLocalizedStringEventArgs Constructor Initializes a new instance of a


GetLocalizedStringEventArgs.
Top

Public Fields
Name

Description

Component

Component being localized.

ComponentName Gets the name of the component being localized.

573

Parent

Parent of the component being localized.

Value

Gets or sets the value of the localized string.

Top

See Also
Reference
GetLocalizedStringEventArgs Class
C1.Win.C1FlexGrid Namespace

GetLocalizedStringEventArgs Constructor
Value to be localized.
Name of the component being localized.
Parent of the component being localized.
Component being localized.
Initializes a new instance of a GetLocalizedStringEventArgs.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal value As String, _
ByVal componentName As String, _
ByVal parent As Control, _
ByVal component As Component _
)
C#
public GetLocalizedStringEventArgs(
string value,
string componentName,
Control parent,
Component component
)

574

Parameters
value
Value to be localized.
componentName
Name of the component being localized.
parent
Parent of the component being localized.
component
Component being localized.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GetLocalizedStringEventArgs Class
GetLocalizedStringEventArgs Members

Fields
For a list of all members of this type, see GetLocalizedStringEventArgs members.

Public Fields
Name

Description

Component

Component being localized.

ComponentName Gets the name of the component being localized.


Parent

Parent of the component being localized.

575

Value

Gets or sets the value of the localized string.

Top

See Also
Reference
GetLocalizedStringEventArgs Class
C1.Win.C1FlexGrid Namespace

Component Field
Component being localized.

Syntax
Visual Basic (Declaration)
Public ReadOnly Component As Component
C#
public readonly Component Component

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetLocalizedStringEventArgs Class
GetLocalizedStringEventArgs Members

ComponentName Field
Gets the name of the component being localized.

Syntax
Visual Basic (Declaration)

576

Public ReadOnly ComponentName As String


C#
public readonly string ComponentName

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetLocalizedStringEventArgs Class
GetLocalizedStringEventArgs Members

Parent Field
Parent of the component being localized.

Syntax
Visual Basic (Declaration)
Public ReadOnly Parent As Control
C#
public readonly Control Parent

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetLocalizedStringEventArgs Class
GetLocalizedStringEventArgs Members

577

Value Field
Gets or sets the value of the localized string.

Syntax
Visual Basic (Declaration)
Public Value As String
C#
public string Value

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GetLocalizedStringEventArgs Class
GetLocalizedStringEventArgs Members

GridChangedEventArgs
Provides data for the C1FlexGridBase.GridChanged event handler.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridChangedEventArgs
Inherits System.EventArgs
C#
public class GridChangedEventArgs : System.EventArgs

578

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.GridChangedEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridChangedEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.GridChanged event handler.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridChangedEventArgs
Inherits System.EventArgs
C#
public class GridChangedEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.GridChangedEventArgs

579

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridChangedEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by GridChangedEventArgs.

Public Fields
Name

Description

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.

Top

See Also
Reference
GridChangedEventArgs Class
C1.Win.C1FlexGrid Namespace

580

Fields
For a list of all members of this type, see GridChangedEventArgs members.

Public Fields
Name

Description

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.

Top

See Also
Reference
GridChangedEventArgs Class
C1.Win.C1FlexGrid Namespace

c1 Field
Range of cells affected by the event.

Syntax
Visual Basic (Declaration)
Public ReadOnly c1 As Integer
C#
public readonly int c1

Requirements

581

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridChangedEventArgs Class
GridChangedEventArgs Members

c2 Field
Range of cells affected by the event.

Syntax
Visual Basic (Declaration)
Public ReadOnly c2 As Integer
C#
public readonly int c2

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridChangedEventArgs Class
GridChangedEventArgs Members

GridChangedType Field
The type of action that caused the event to fire.

Syntax
Visual Basic (Declaration)

582

Public ReadOnly GridChangedType As GridChangedTypeEnum


C#
public readonly GridChangedTypeEnum GridChangedType

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridChangedEventArgs Class
GridChangedEventArgs Members

r1 Field
Range of cells affected by the event.

Syntax
Visual Basic (Declaration)
Public ReadOnly r1 As Integer
C#
public readonly int r1

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridChangedEventArgs Class
GridChangedEventArgs Members

583

r2 Field
Range of cells affected by the event.

Syntax
Visual Basic (Declaration)
Public ReadOnly r2 As Integer
C#
public readonly int r2

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridChangedEventArgs Class
GridChangedEventArgs Members

GridErrorEventArgs
Provides data for the C1FlexGridBase.GridError event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridErrorEventArgs
Inherits System.EventArgs
C#
public class GridErrorEventArgs : System.EventArgs

584

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.GridErrorEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridErrorEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.GridError event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridErrorEventArgs
Inherits System.EventArgs
C#
public class GridErrorEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.GridErrorEventArgs

585

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridErrorEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by GridErrorEventArgs.

Public Constructors
Name

Description

GridErrorEventArgs Constructor Initializes a new instance of the GridErrorEventArgs class.


Top

Public Fields
Name

Description

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.

Top

586

See Also
Reference
GridErrorEventArgs Class
C1.Win.C1FlexGrid Namespace

GridErrorEventArgs Constructor
The row index of the cell where the error was detected.
The column index of the cell where the error was detected.
The Exception object that contains information about the error.
Whether the error was handled internally and no exception should be thrown.
Initializes a new instance of the GridErrorEventArgs class.

Syntax
Visual Basic (Declaration)
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
)

Parameters
row
The row index of the cell where the error was detected.
col

587

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GridErrorEventArgs Class
GridErrorEventArgs Members

Fields
For a list of all members of this type, see GridErrorEventArgs members.

Public Fields
Name

Description

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.

Top

See Also

588

Reference
GridErrorEventArgs Class
C1.Win.C1FlexGrid Namespace

Col Field
Gets the column index of the cell where the error was detected.

Syntax
Visual Basic (Declaration)
Public ReadOnly Col As Integer
C#
public readonly int Col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridErrorEventArgs Class
GridErrorEventArgs Members

Exception Field
Gets the Exception object that contains information about the error.

Syntax
Visual Basic (Declaration)
Public ReadOnly Exception As Exception
C#
public readonly Exception Exception

Requirements
589

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridErrorEventArgs Class
GridErrorEventArgs Members

Handled Field
Gets or sets a value indicating whether the error situation has been handled by the control.

Syntax
Visual Basic (Declaration)
Public Handled As Boolean
C#
public bool Handled

Remarks
If this value is set to False, the grid will throw the exception.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridErrorEventArgs Class
GridErrorEventArgs Members

Row Field
Gets the row index of the cell where the error was detected.

590

Syntax
Visual Basic (Declaration)
Public ReadOnly Row As Integer
C#
public readonly int Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridErrorEventArgs Class
GridErrorEventArgs Members

GridGlyphs
Represents a collection of glyphs (images) indexed by glyph type (GlyphEnum type).

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridGlyphs
C#
public class GridGlyphs

Remarks
The GridGlyphs collection contains the images used by the grid to indicate column sorting
direction, collapsed and expanded outline groups, check boxes, cursors, error information, etc.

591

You can use the C1FlexGridBase.Glyphs property get or set these images.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.GridGlyphs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridGlyphs Members
C1.Win.C1FlexGrid Namespace

Overview
Represents a collection of glyphs (images) indexed by glyph type (GlyphEnum type).

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridGlyphs
C#
public class GridGlyphs

Remarks
The GridGlyphs collection contains the images used by the grid to indicate column sorting
direction, collapsed and expanded outline groups, check boxes, cursors, error information, etc.
You can use the C1FlexGridBase.Glyphs property get or set these images.

592

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.GridGlyphs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridGlyphs Members
C1.Win.C1FlexGrid Namespace

Members
Properties

The following tables list the members exposed by GridGlyphs.

Public Properties
Name

Description

Item

Gets or sets the glyph for a particular GlyphEnum value.

Top

See Also
Reference
GridGlyphs Class
C1.Win.C1FlexGrid Namespace

Properties
For a list of all members of this type, see GridGlyphs members.

Public Properties

593

Name

Description

Item

Gets or sets the glyph for a particular GlyphEnum value.

Top

See Also
Reference
GridGlyphs Class
C1.Win.C1FlexGrid Namespace

Item Property
Gets or sets the glyph for a particular GlyphEnum value.

Syntax
Visual Basic (Declaration)
Public Default Property Item( _
ByVal glyph As GlyphEnum _
) As Image
C#
public Image this[
GlyphEnum glyph
]; {get; set;}

Parameters
glyph

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

594

See Also
Reference
GridGlyphs Class
GridGlyphs Members

GridPrinter
Represents a class that encapsulates the control printing functionality, including page and printer
settings, headers, and footers.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridPrinter
C#
public class GridPrinter

Remarks
See also the C1FlexGridBase.PrintGrid method.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.GridPrinter

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

595

GridPrinter Members
C1.Win.C1FlexGrid Namespace

Overview
Represents a class that encapsulates the control printing functionality, including page and printer
settings, headers, and footers.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridPrinter
C#
public class GridPrinter

Remarks
See also the C1FlexGridBase.PrintGrid method.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.GridPrinter

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridPrinter Members
C1.Win.C1FlexGrid Namespace

596

Members
Properties

The following tables list the members exposed by GridPrinter.

Public Properties
Name

Description

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 (the first page is numbered
one).

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
C1FlexGridBase.PrintGrid method. See the PrintGridFlags enumeration for
details.

PrintPreviewDialog Gets a reference to the PrintPreviewDialog used to display the grid's print
preview.
Top

See Also
Reference

597

GridPrinter Class
C1.Win.C1FlexGrid Namespace

Properties
>
Name

Description

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

PrintDocument

Gets the number of the page being printed (the first page is numbered
one).
Gets the System.Drawing.Printing.PrintDocument object that specifies page
and printer settings.
Gets or sets the flags that specify printing options to use with the

PrintGridFlags

C1FlexGridBase.PrintGrid method. See the PrintGridFlags enumeration for


details.

PrintPreviewDialog

Gets a reference to the PrintPreviewDialog used to display the grid's print


preview.

Top

See Also
Reference
GridPrinter Class
C1.Win.C1FlexGrid Namespace

Footer Property
Gets or sets a string that contains the page footers.

Syntax

598

Visual Basic (Declaration)


Public Property Footer As String
C#
public string Footer {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridPrinter Class
GridPrinter Members

FooterFont Property
Specifies the font to use for rendering page footers.

Syntax
Visual Basic (Declaration)
Public Property FooterFont As Font
C#
public Font FooterFont {get; set;}

Remarks
599

See also the Footer property.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridPrinter Class
GridPrinter Members

Header Property
Example

Gets or sets a string that contains the page headers.

Syntax
Visual Basic (Declaration)
Public Property Header As String
C#
public string Header {get; set;}

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.

600

C#

_flex.Header = "\t\tPage {0} of {1}";


_flex.HeaderFont = new Font("Tahoma", 10);
_flex.PrintGrid("Header");

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridPrinter Class
GridPrinter Members

HeaderFont Property
Specifies the font to use for rendering page headers.

Syntax
Visual Basic (Declaration)
Public Property HeaderFont As Font
C#
public Font HeaderFont {get; set;}

Remarks
See also the Header property.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

601

GridPrinter Class
GridPrinter Members

PageCount Property
Gets the total number of the pages in the print document.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property PageCount As Integer
C#
public int PageCount {get;}

Remarks
The value returned is accurate only while the document is printing. Before or after a document is
done printing, this property returns zero.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridPrinter Class
GridPrinter Members

PageNumber Property
Gets the number of the page being printed (the first page is numbered one).

Syntax
Visual Basic (Declaration)
Public ReadOnly Property PageNumber As Integer

602

C#
public int PageNumber {get;}

Remarks
Applications typically use this property to provide user feedback while printing grids.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridPrinter Class
GridPrinter Members

PrintDocument Property
Gets the System.Drawing.Printing.PrintDocument object that specifies page and printer settings.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property PrintDocument As PrintDocument
C#
public PrintDocument PrintDocument {get;}

Remarks
The PrintDocument class is part of the .NET framework, defined in the System.Drawing.Printing
namespace. It contains properties that specify printer and page settings for the document.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

603

See Also
Reference
GridPrinter Class
GridPrinter Members

PrintGridFlags Property
Gets or sets the flags that specify printing options to use with the C1FlexGridBase.PrintGrid
method. See the PrintGridFlags enumeration for details.

Syntax
Visual Basic (Declaration)
Public Property PrintGridFlags As PrintGridFlags
C#
public PrintGridFlags PrintGridFlags {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridPrinter Class
GridPrinter Members

PrintPreviewDialog Property
Example

Gets a reference to the PrintPreviewDialog used to display the grid's print preview.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property PrintPreviewDialog As PrintPreviewDialog

604

C#
public PrintPreviewDialog PrintPreviewDialog {get;}

Remarks
Use this property to customize the size and position of the preview dialog when printing the grid
with the PrintGridFlags.ShowPrintDialog option.

Example
The code below uses the PrintPreviewDialog property to display the preview dialog with a custom
caption and in a maximized state:

C#

Form dlg = _flex.PrintParameters.PrintPreviewDialog as Form;


dlg.Text = "Custom Caption";
dlg.StartPosition = FormStartPosition.Manual;
dlg.WindowState = FormWindowState.Maximized;
_flex.PrintGrid("test", PrintGridFlags.ShowPreviewDialog);

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridPrinter Class
GridPrinter Members

GridRendererOffice2007
Represents the base abstract class for Office2007 style renderers.

Object Model

Syntax

605

Visual Basic (Declaration)


Public Class GridRendererOffice2007
Inherits C1FlexGridRenderer
C#
public class GridRendererOffice2007 : C1FlexGridRenderer

Remarks
The easiest way to create a new high-quality renderer is to derive from this class and provide a
constructor that initializes the 25 colors that define the renderer.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2007Black
C1.Win.C1FlexGrid.GridRendererOffice2007Blue
C1.Win.C1FlexGrid.GridRendererOffice2007Silver
C1.Win.C1FlexGrid.GridRendererOffice2010Black
C1.Win.C1FlexGrid.GridRendererOffice2010Blue
C1.Win.C1FlexGrid.GridRendererOffice2010Silver

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Members
C1.Win.C1FlexGrid Namespace

Overview
Represents the base abstract class for Office2007 style renderers.

Object Model

606

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2007
Inherits C1FlexGridRenderer
C#
public class GridRendererOffice2007 : C1FlexGridRenderer

Remarks
The easiest way to create a new high-quality renderer is to derive from this class and provide a
constructor that initializes the 25 colors that define the renderer.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2007Black
C1.Win.C1FlexGrid.GridRendererOffice2007Blue
C1.Win.C1FlexGrid.GridRendererOffice2007Silver
C1.Win.C1FlexGrid.GridRendererOffice2010Black
C1.Win.C1FlexGrid.GridRendererOffice2010Blue
C1.Win.C1FlexGrid.GridRendererOffice2010Silver

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Members
C1.Win.C1FlexGrid Namespace

607

Members
Properties Methods

The following tables list the members exposed by GridRendererOffice2007.

Public Constructors
Name

Description

GridRendererOffice2007 Constructor Overloaded.


Top

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
Highlight

Gets or sets the color used to paint the background of highlighted cells.

TracksMouse

Overridden. Gets a value that determines whether this renderer renders hot
cells differently than normal cells.

TracksSelection

Overridden. Gets a value that determines whether this renderer tracks the
selection to paint highlighted column and row headers.

Top

Public Methods
Name

Description

GetBackgroundBrush Overridden. Gets the background brush for a cell.


GetBorderPen

Overridden. Gets a pen used to paint the cell borders.

608

OnDrawCell

Overloaded. Overridden. Draws a single grid cell of a specific type.

Top

See Also
Reference
GridRendererOffice2007 Class
C1.Win.C1FlexGrid Namespace

GridRendererOffice2007 Constructor

Overload List
Overload

Description

GridRendererOffice2007

Initializes a

Constructor(Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,Co new
lor,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color)

instance of
a
GridRender
erOffice200
7.

GridRendererOffice2007 Constructor(Color[])

Initializes a
new
instance of
a
GridRender
erOffice200
7 using a
specified
color
palette.

Requirements

609

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Class
GridRendererOffice2007 Members

GridRendererOffice2007
Constructor(Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color,C
olor,Color,Color,Color,Color,Color,Color,Color,Color,Color,Color)
Background color for highlighted cells.
Color of the border around the top left fixed cell.
Color of the background for the top left fixed cell.
First color of the gradient background for the image in the top left fixed cell.
Second color of the gradient background for the image in the top left fixed cell.
First color of the gradient background for column headers.
Second color of the gradient background for column headers.
Color of the border around column headers.
First color of the gradient background for selected column headers.
Second color of the gradient background for selected column headers.
Color of the border around selected column headers.
First color of the gradient background for hot column headers.
Second color of the gradient background for hot column headers.
Color of the border around hot column headers.
First color of the gradient background for selected hot column headers.
Second color of the gradient background for selected hot column headers.
Color of the border around hot selected column headers.
Color of the background for row headers.

610

Color of the border around row headers.


Color of the background for selected row headers.
Color of the border around selected row headers.
Color of the background for hot row headers.
Color of the border around hot row headers.
Color of the background for hot selected row headers.
Color of the border around selected hot row headers.
Initializes a new instance of a GridRendererOffice2007.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal clrHighlight As Color, _
ByVal clrTopLeftBorder As Color, _
ByVal clrTopLeft As Color, _
ByVal clrImg1 As Color, _
ByVal clrImg2 As Color, _
ByVal clrCol1 As Color, _
ByVal clrCol2 As Color, _
ByVal clrColBorder As Color, _
ByVal clrColSel1 As Color, _
ByVal clrColSel2 As Color, _
ByVal clrSelBorder As Color, _
ByVal clrColHot1 As Color, _
ByVal clrColHot2 As Color, _
ByVal clrHotBorder As Color, _
ByVal clrColSelHot1 As Color, _
ByVal clrColSelHot2 As Color, _
ByVal clrSelHotBorder As Color, _
ByVal clrRow As Color, _
ByVal clrRowBorder As Color, _
ByVal clrRowSel As Color, _
ByVal clrRowSelBorder As Color, _

611

ByVal clrRowHot As Color, _


ByVal clrRowHotBorder As Color, _
ByVal clrRowSelHot As Color, _
ByVal clrRowSelHotBorder As Color _
)
C#
public GridRendererOffice2007(
Color clrHighlight,
Color clrTopLeftBorder,
Color clrTopLeft,
Color clrImg1,
Color clrImg2,
Color clrCol1,
Color clrCol2,
Color clrColBorder,
Color clrColSel1,
Color clrColSel2,
Color clrSelBorder,
Color clrColHot1,
Color clrColHot2,
Color clrHotBorder,
Color clrColSelHot1,
Color clrColSelHot2,
Color clrSelHotBorder,
Color clrRow,
Color clrRowBorder,
Color clrRowSel,
Color clrRowSelBorder,
Color clrRowHot,
Color clrRowHotBorder,
Color clrRowSelHot,
Color clrRowSelHotBorder
)

Parameters
clrHighlight
Background color for highlighted cells.

612

clrTopLeftBorder
Color of the border around the top left fixed cell.
clrTopLeft
Color of the background for the top left fixed cell.
clrImg1
First color of the gradient background for the image in the top left fixed cell.
clrImg2
Second color of the gradient background for the image in the top left fixed cell.
clrCol1
First color of the gradient background for column headers.
clrCol2
Second color of the gradient background for column headers.
clrColBorder
Color of the border around column headers.
clrColSel1
First color of the gradient background for selected column headers.
clrColSel2
Second color of the gradient background for selected column headers.
clrSelBorder
Color of the border around selected column headers.
clrColHot1
First color of the gradient background for hot column headers.
clrColHot2
Second color of the gradient background for hot column headers.
clrHotBorder
Color of the border around hot column headers.

613

clrColSelHot1
First color of the gradient background for selected hot column headers.
clrColSelHot2
Second color of the gradient background for selected hot column headers.
clrSelHotBor
der
Color of the border around hot selected column headers.
clrRow
Color of the background for row headers.
cl
r
R
o
w
B
o
r
d
e
r
Color of the border around row headers.
c
l
r
R
o
w
S
e
l
Color of the background for selected row headers.
c
l
r

614

R
o
w
S
e
l
B
o
r
d
e
r
Color of the border around selected row headers.
c
l
r
R
o
w
H
o
t
Color of the background for hot row headers.

Color of the border around hot row headers.

615

Color of the background for hot selected row headers.

Color of the border around selected hot row headers.

616

617

618

619

620

621

Reference

622

623

GridRendererOffice2007 Constructor(Color[])
Array with 25 colors to be used as a palette.
Initializes a new instance of a GridRendererOffice2007 using a specified color palette.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal p() As Color _
)
C#
public GridRendererOffice2007(
Color[] p
)

Parameters
p
Array with 25 colors to be used as a palette.

Requirements
624

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Class
GridRendererOffice2007 Members
Overload List

Methods
For a list of all members of this type, see GridRendererOffice2007 members.

Public Methods
Name

Description

GetBackgroundBrush Overridden. Gets the background brush for a cell.


GetBorderPen

Overridden. Gets a pen used to paint the cell borders.

OnDrawCell

Overloaded. Overridden. Draws a single grid cell of a specific type.

Top

See Also
Reference
GridRendererOffice2007 Class
C1.Win.C1FlexGrid Namespace

GetBackgroundBrush Method
C1FlexGridBase that contains the cell.
C1FlexGridRenderer.CellType value that describes the type of cell being rendered.
System.Drawing.Rectangle that defines the cell bounds.
Gets the background brush for a cell.

Syntax
625

Visual Basic (Declaration)


Public Overrides Function GetBackgroundBrush( _
ByVal flex As C1FlexGridBase, _
ByVal cellType As C1FlexGridRenderer.CellType, _
ByVal r As Rectangle _
) As Brush
C#
public override Brush GetBackgroundBrush(
C1FlexGridBase flex,
C1FlexGridRenderer.CellType cellType,
Rectangle r
)

Parameters
flex
C1FlexGridBase that contains the cell.
cellType
C1FlexGridRenderer.CellType value that describes the type of cell being rendered.
r
System.Drawing.Rectangle that defines the cell bounds.

Return Value
A System.Drawing.Brush used to paint the cell.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Class
GridRendererOffice2007 Members

626

GetBorderPen Method
C1FlexGridRenderer.CellType that describes the type of cell being rendered.
Gets a pen used to paint the cell borders.

Syntax
Visual Basic (Declaration)
Public Overrides Function GetBorderPen( _
ByVal cellType As C1FlexGridRenderer.CellType _
) As Pen
C#
public override Pen GetBorderPen(
C1FlexGridRenderer.CellType cellType
)

Parameters
cellType
C1FlexGridRenderer.CellType that describes the type of cell being rendered.

Return Value
A System.Drawing.Pen used to paint the cell borders.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Class
GridRendererOffice2007 Members

OnDrawCell Method
Draws a single grid cell of a specific type.

627

Overload List
Overload

Description

OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs,CellTy Draws a single grid cell of a specific


pe)

type.

OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs)

Draws a grid cell of any type.


(Inherited from
C1.Win.C1FlexGrid.C1FlexGridRender
er)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Class
GridRendererOffice2007 Members
OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs,CellType) Method
C1FlexGridBase that contains the cell being drawn.
OwnerDrawCellEventArgs that provides information about the cell being drawn.
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.
Draws a single grid cell of a specific type.

Syntax
Visual Basic (Declaration)
Public Overloads Overrides Sub OnDrawCell( _
ByVal flex As C1FlexGridBase, _
ByVal e As OwnerDrawCellEventArgs, _

628

ByVal cellType As C1FlexGridRenderer.CellType _


)
C#
public override void OnDrawCell(
C1FlexGridBase flex,
OwnerDrawCellEventArgs e,
C1FlexGridRenderer.CellType cellType
)

Parameters
flex
C1FlexGridBase that contains the cell being drawn.
e
OwnerDrawCellEventArgs that provides information about the cell being drawn.
cellType
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Class
GridRendererOffice2007 Members
Overload List

Properties
For a list of all members of this type, see GridRendererOffice2007 members.

Public Properties

629

Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
Highlight

Gets or sets the color used to paint the background of highlighted cells.

TracksMouse

Overridden. Gets a value that determines whether this renderer renders hot
cells differently than normal cells.

TracksSelection

Overridden. Gets a value that determines whether this renderer tracks the
selection to paint highlighted column and row headers.

Top

See Also
Reference
GridRendererOffice2007 Class
C1.Win.C1FlexGrid Namespace

Highlight Property
Gets or sets the color used to paint the background of highlighted cells.

Syntax
Visual Basic (Declaration)
Public Property Highlight As Color
C#
public Color Highlight {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

630

See Also
Reference
GridRendererOffice2007 Class
GridRendererOffice2007 Members

TracksMouse Property
Gets a value that determines whether this renderer renders hot cells differently than normal cells.

Syntax
Visual Basic (Declaration)
Public Overrides ReadOnly Property TracksMouse As Boolean
C#
public override bool TracksMouse {get;}

Remarks
Hot cells are cells currently under the mouse. If a renderer tracks the mouse, then it will be called as
the mouse moves over the grid.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Class
GridRendererOffice2007 Members

TracksSelection Property
Gets a value that determines whether this renderer tracks the selection to paint highlighted column
and row headers.

Syntax

631

Visual Basic (Declaration)


Public Overrides ReadOnly Property TracksSelection As Boolean
C#
public override bool TracksSelection {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007 Class
GridRendererOffice2007 Members

GridRendererOffice2007Black
C1FlexGridRenderer that implements the Office2007 Black visual style.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2007Black
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2007Black : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer

632

C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2007Black

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007Black Members
C1.Win.C1FlexGrid Namespace

Overview
C1FlexGridRenderer that implements the Office2007 Black visual style.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2007Black
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2007Black : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2007Black

Requirements

633

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007Black Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by GridRendererOffice2007Black.

Public Constructors
Name

Description

GridRendererOffice2007Black Constructor Initializes a new instance of a


GridRendererOffice2007Black.
Top

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
Highlight

Gets or sets the color used to paint the background of highlighted cells.
(Inherited from C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksMouse

Gets a value that determines whether this renderer renders hot cells
differently than normal cells. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksSelection

Gets a value that determines whether this renderer tracks the selection to

634

paint highlighted column and row headers. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)
Top

Public Methods
Name

Description

GetBackgroundBrush Gets the background brush for a cell. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)
GetBorderPen

Gets a pen used to paint the cell borders. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

OnDrawCell

Overloaded. Draws a single grid cell of a specific type. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

See Also
Reference
GridRendererOffice2007Black Class
C1.Win.C1FlexGrid Namespace

GridRendererOffice2007Black Constructor
Initializes a new instance of a GridRendererOffice2007Black.

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public GridRendererOffice2007Black()

Requirements
635

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007Black Class
GridRendererOffice2007Black Members

GridRendererOffice2007Blue
C1FlexGridRenderer that implements the Office2007 Blue visual style.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2007Blue
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2007Blue : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2007Blue

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
636

Reference
GridRendererOffice2007Blue Members
C1.Win.C1FlexGrid Namespace

Overview
C1FlexGridRenderer that implements the Office2007 Blue visual style.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2007Blue
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2007Blue : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2007Blue

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007Blue Members
C1.Win.C1FlexGrid Namespace

637

Members
Properties Methods

The following tables list the members exposed by GridRendererOffice2007Blue.

Public Constructors
Name

Description

GridRendererOffice2007Blue Constructor Initializes a new instance of a


GridRendererOffice2007Blue.
Top

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
Highlight

Gets or sets the color used to paint the background of highlighted cells.
(Inherited from C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksMouse

Gets a value that determines whether this renderer renders hot cells
differently than normal cells. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksSelection

Gets a value that determines whether this renderer tracks the selection to
paint highlighted column and row headers. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

Public Methods
Name

Description

638

GetBackgroundBrush Gets the background brush for a cell. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)
GetBorderPen

Gets a pen used to paint the cell borders. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

OnDrawCell

Overloaded. Draws a single grid cell of a specific type. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

See Also
Reference
GridRendererOffice2007Blue Class
C1.Win.C1FlexGrid Namespace

GridRendererOffice2007Blue Constructor
Initializes a new instance of a GridRendererOffice2007Blue.

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public GridRendererOffice2007Blue()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

639

GridRendererOffice2007Blue Class
GridRendererOffice2007Blue Members

GridRendererOffice2007Silver
C1FlexGridRenderer that implements the Office2007 Silver visual style.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2007Silver
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2007Silver : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2007Silver

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007Silver Members
C1.Win.C1FlexGrid Namespace

Overview
C1FlexGridRenderer that implements the Office2007 Silver visual style.

640

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2007Silver
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2007Silver : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2007Silver

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007Silver Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by GridRendererOffice2007Silver.

Public Constructors

641

Name

Description

GridRendererOffice2007Silver Constructor Initializes a new instance of a


GridRendererOffice2007Silver.
Top

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
Highlight

Gets or sets the color used to paint the background of highlighted cells.
(Inherited from C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksMouse

Gets a value that determines whether this renderer renders hot cells
differently than normal cells. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksSelection

Gets a value that determines whether this renderer tracks the selection to
paint highlighted column and row headers. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

Public Methods
Name

Description

GetBackgroundBrush Gets the background brush for a cell. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)
GetBorderPen

Gets a pen used to paint the cell borders. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

642

OnDrawCell

Overloaded. Draws a single grid cell of a specific type. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

See Also
Reference
GridRendererOffice2007Silver Class
C1.Win.C1FlexGrid Namespace

GridRendererOffice2007Silver Constructor
Initializes a new instance of a GridRendererOffice2007Silver.

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public GridRendererOffice2007Silver()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2007Silver Class
GridRendererOffice2007Silver Members

GridRendererOffice2010Black
C1FlexGridRenderer that implements the Office2010 Black visual style.

Object Model

643

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2010Black
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2010Black : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2010Black

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Black Members
C1.Win.C1FlexGrid Namespace

Overview
C1FlexGridRenderer that implements the Office2010 Black visual style.

Object Model

Syntax
Visual Basic (Declaration)

644

Public Class GridRendererOffice2010Black


Inherits GridRendererOffice2007
C#
public class GridRendererOffice2010Black : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2010Black

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Black Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by GridRendererOffice2010Black.

Public Constructors
Name

Description

GridRendererOffice2010Black Constructor Initializes a new instance of a


GridRendererOffice2007Black.
Top

Public Properties

645

Name

Description

HeaderForeColor Overridden. Gets the foreground color of header cells in the normal state.
Highlight

Gets or sets the color used to paint the background of highlighted cells.
(Inherited from C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksMouse

Gets a value that determines whether this renderer renders hot cells
differently than normal cells. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksSelection

Gets a value that determines whether this renderer tracks the selection to
paint highlighted column and row headers. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

Public Methods
Name

Description

GetBackgroundBrush Gets the background brush for a cell. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)
GetBorderPen

Gets a pen used to paint the cell borders. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

OnDrawCell

Overloaded. Draws a single grid cell of a specific type. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

See Also
Reference
GridRendererOffice2010Black Class
C1.Win.C1FlexGrid Namespace

646

GridRendererOffice2010Black Constructor
Initializes a new instance of a GridRendererOffice2007Black.

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public GridRendererOffice2010Black()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Black Class
GridRendererOffice2010Black Members

Properties
For a list of all members of this type, see GridRendererOffice2010Black members.

Public Properties
Name

Description

HeaderForeColor Overridden. Gets the foreground color of header cells in the normal state.
Highlight

Gets or sets the color used to paint the background of highlighted cells.
(Inherited from C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksMouse

Gets a value that determines whether this renderer renders hot cells
differently than normal cells. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

647

TracksSelection

Gets a value that determines whether this renderer tracks the selection to
paint highlighted column and row headers. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

See Also
Reference
GridRendererOffice2010Black Class
C1.Win.C1FlexGrid Namespace

HeaderForeColor Property
Gets the foreground color of header cells in the normal state.

Syntax
Visual Basic (Declaration)
Public Overrides ReadOnly Property HeaderForeColor As Color
C#
public override Color HeaderForeColor {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Black Class
GridRendererOffice2010Black Members

GridRendererOffice2010Blue
C1FlexGridRenderer that implements the Office2010 Blue visual style.

Object Model

648

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2010Blue
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2010Blue : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2010Blue

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Blue Members
C1.Win.C1FlexGrid Namespace

Overview
C1FlexGridRenderer that implements the Office2010 Blue visual style.

Object Model

Syntax

649

Visual Basic (Declaration)


Public Class GridRendererOffice2010Blue
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2010Blue : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2010Blue

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Blue Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by GridRendererOffice2010Blue.

Public Constructors
Name

Description

GridRendererOffice2010Blue Constructor Initializes a new instance of a


GridRendererOffice2007Blue.
Top

650

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
Highlight

Gets or sets the color used to paint the background of highlighted cells.
(Inherited from C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksMouse

Gets a value that determines whether this renderer renders hot cells
differently than normal cells. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksSelection

Gets a value that determines whether this renderer tracks the selection to
paint highlighted column and row headers. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

Public Methods
Name

Description

GetBackgroundBrush Gets the background brush for a cell. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)
GetBorderPen

Gets a pen used to paint the cell borders. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

OnDrawCell

Overloaded. Draws a single grid cell of a specific type. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

See Also
Reference
651

GridRendererOffice2010Blue Class
C1.Win.C1FlexGrid Namespace

GridRendererOffice2010Blue Constructor
Initializes a new instance of a GridRendererOffice2007Blue.

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public GridRendererOffice2010Blue()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Blue Class
GridRendererOffice2010Blue Members

GridRendererOffice2010Silver
C1FlexGridRenderer that implements the Office2010 Silver visual style.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2010Silver
Inherits GridRendererOffice2007

652

C#
public class GridRendererOffice2010Silver : GridRendererOffice2007

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2010Silver

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Silver Members
C1.Win.C1FlexGrid Namespace

Overview
C1FlexGridRenderer that implements the Office2010 Silver visual style.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererOffice2010Silver
Inherits GridRendererOffice2007
C#
public class GridRendererOffice2010Silver : GridRendererOffice2007

Inheritance Hierarchy
653

System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererOffice2007
C1.Win.C1FlexGrid.GridRendererOffice2010Silver

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Silver Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by GridRendererOffice2010Silver.

Public Constructors
Name

Description

GridRendererOffice2010Silver Constructor Initializes a new instance of a


GridRendererOffice2007Silver.
Top

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
Highlight

Gets or sets the color used to paint the background of highlighted cells.
(Inherited from C1.Win.C1FlexGrid.GridRendererOffice2007)

654

TracksMouse

Gets a value that determines whether this renderer renders hot cells
differently than normal cells. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

TracksSelection

Gets a value that determines whether this renderer tracks the selection to
paint highlighted column and row headers. (Inherited from
C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

Public Methods
Name

Description

GetBackgroundBrush Gets the background brush for a cell. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)
GetBorderPen

Gets a pen used to paint the cell borders. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

OnDrawCell

Overloaded. Draws a single grid cell of a specific type. (Inherited from


C1.Win.C1FlexGrid.GridRendererOffice2007)

Top

See Also
Reference
GridRendererOffice2010Silver Class
C1.Win.C1FlexGrid Namespace

GridRendererOffice2010Silver Constructor
Initializes a new instance of a GridRendererOffice2007Silver.

Syntax
Visual Basic (Declaration)

655

Public Function New()


C#
public GridRendererOffice2010Silver()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererOffice2010Silver Class
GridRendererOffice2010Silver Members

GridRendererSystem
C1FlexGridRenderer that implements the System visual style.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererSystem
Inherits C1FlexGridRenderer
C#
public class GridRendererSystem : C1FlexGridRenderer

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererSystem

Requirements
656

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererSystem Members
C1.Win.C1FlexGrid Namespace

Overview
C1FlexGridRenderer that implements the System visual style.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridRendererSystem
Inherits C1FlexGridRenderer
C#
public class GridRendererSystem : C1FlexGridRenderer

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.C1FlexGridRenderer
C1.Win.C1FlexGrid.GridRendererSystem

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

657

Reference
GridRendererSystem Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by GridRendererSystem.

Public Constructors
Name

Description

GridRendererSystem Constructor
Top

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
TracksMouse

Overridden. Gets a value that determines whether this renderer renders hot
cells differently than normal cells.

TracksSelection

Overridden. Gets a value that determines whether this renderer tracks the
selection to paint highlighted column and row headers.

Top

Public Methods
Name

Description

GetBackgroundBrush Gets a System.Drawing.Brush object used to paint the cell background


for a specific cell type. (Inherited from

658

C1.Win.C1FlexGrid.C1FlexGridRenderer)
GetBorderPen

Gets a System.Drawing.Pen object used to paint the cell borders.


(Inherited from C1.Win.C1FlexGrid.C1FlexGridRenderer)

OnDrawCell

Overloaded. Overridden. Draws a single grid cell of a specific type.

Top

See Also
Reference
GridRendererSystem Class
C1.Win.C1FlexGrid Namespace

GridRendererSystem Constructor

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public GridRendererSystem()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererSystem Class
GridRendererSystem Members

Methods
For a list of all members of this type, see GridRendererSystem members.

659

Public Methods
Name

Description

GetBackgroundBrush Gets a System.Drawing.Brush object used to paint the cell background


for a specific cell type. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
GetBorderPen

Gets a System.Drawing.Pen object used to paint the cell borders.


(Inherited from C1.Win.C1FlexGrid.C1FlexGridRenderer)

OnDrawCell

Overloaded. Overridden. Draws a single grid cell of a specific type.

Top

See Also
Reference
GridRendererSystem Class
C1.Win.C1FlexGrid Namespace

OnDrawCell Method
Draws a single grid cell of a specific type.

Overload List
Overload

Description

OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs,CellTy Draws a single grid cell of a specific


pe)

type.

OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs)

Draws a grid cell of any type.


(Inherited from
C1.Win.C1FlexGrid.C1FlexGridRender
er)

Requirements

660

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererSystem Class
GridRendererSystem Members
OnDrawCell(C1FlexGridBase,OwnerDrawCellEventArgs,CellType) Method
C1FlexGridBase that contains the cell being drawn.
OwnerDrawCellEventArgs that provides information about the cell being drawn.
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.
Draws a single grid cell of a specific type.

Syntax
Visual Basic (Declaration)
Public Overloads Overrides Sub OnDrawCell( _
ByVal flex As C1FlexGridBase, _
ByVal e As OwnerDrawCellEventArgs, _
ByVal cellType As C1FlexGridRenderer.CellType _
)
C#
public override void OnDrawCell(
C1FlexGridBase flex,
OwnerDrawCellEventArgs e,
C1FlexGridRenderer.CellType cellType
)

Parameters
flex
C1FlexGridBase that contains the cell being drawn.
e

661

OwnerDrawCellEventArgs that provides information about the cell being drawn.


cellType
C1FlexGridRenderer.CellType value that determines the type of cell being drawn.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GridRendererSystem Class
GridRendererSystem Members
Overload List

Properties
For a list of all members of this type, see GridRendererSystem members.

Public Properties
Name

Description

HeaderForeColor Gets the foreground color of header cells in the normal state. (Inherited from
C1.Win.C1FlexGrid.C1FlexGridRenderer)
TracksMouse

Overridden. Gets a value that determines whether this renderer renders hot
cells differently than normal cells.

TracksSelection

Overridden. Gets a value that determines whether this renderer tracks the
selection to paint highlighted column and row headers.

Top

See Also
Reference

662

GridRendererSystem Class
C1.Win.C1FlexGrid Namespace

TracksMouse Property
Gets a value that determines whether this renderer renders hot cells differently than normal cells.

Syntax
Visual Basic (Declaration)
Public Overrides ReadOnly Property TracksMouse As Boolean
C#
public override bool TracksMouse {get;}

Remarks
Hot cells are cells currently under the mouse. If a renderer tracks the mouse, then it will be called as
the mouse moves over the grid.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererSystem Class
GridRendererSystem Members

TracksSelection Property
Gets a value that determines whether this renderer tracks the selection to paint highlighted column
and row headers.

Syntax
Visual Basic (Declaration)
Public Overrides ReadOnly Property TracksSelection As Boolean

663

C#
public override bool TracksSelection {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridRendererSystem Class
GridRendererSystem Members

GridTree
The GridTree class encapsulates properties that specify the appearance, position, and behavior of
the outline tree.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridTree
C#
public class GridTree

Remarks
Each grid has a single GridTree object, which can be obtained using the C1FlexGridBase.Tree
property.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.GridTree

664

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridTree Members
C1.Win.C1FlexGrid Namespace

Overview
The GridTree class encapsulates properties that specify the appearance, position, and behavior of
the outline tree.

Object Model

Syntax
Visual Basic (Declaration)
Public Class GridTree
C#
public class GridTree

Remarks
Each grid has a single GridTree object, which can be obtained using the C1FlexGridBase.Tree
property.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.GridTree

Requirements

665

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridTree Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by GridTree.

Public Properties
Name

Description

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.

MaximumLevel

Gets the level of the deepest node in the outline.

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.

Top

Public Methods

666

Name

Description

Clear

Resets the C1FlexGridBase.Tree object.

Show

Expands all nodes up to the specified level, collapses others.

Sort

Overloaded. Sorts all nodes at the given level.

Top

See Also
Reference
GridTree Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see GridTree members.

Public Methods
Name

Description

Clear

Resets the C1FlexGridBase.Tree object.

Show

Expands all nodes up to the specified level, collapses others.

Sort

Overloaded. Sorts all nodes at the given level.

Top

See Also
Reference
GridTree Class
C1.Win.C1FlexGrid Namespace

Clear Method
Resets the C1FlexGridBase.Tree object.

667

Syntax
Visual Basic (Declaration)
Public Sub Clear()
C#
public void Clear()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members

Show Method
The level to show. Any nodes with Node.Level higher than this will be collapsed, others will be
expanded.
Expands all nodes up to the specified level, collapses others.

Syntax
Visual Basic (Declaration)
Public Sub Show( _
ByVal level As Integer _
)
C#
public void Show(
int level
)

Parameters

668

level
The level to show. Any nodes with Node.Level higher than this will be collapsed, others will
be expanded.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members

Sort Method
Sorts all nodes at the given level.

Overload List
Overload

Description

Sort(Int32,SortFlags,Int32,Int32) Sorts all nodes at the given level.


Sort(Int32,IComparer)

Sorts all nodes at the given level using the specified comparer.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members
Sort(Int32,SortFlags,Int32,Int32) Method
Level of the nodes to sort.

669

SortFlags value that controls sort direction and options.


Start of the range of columns to sort.
End of the range of columns to sort.
Sorts all nodes at the given level.

Syntax
Visual Basic (Declaration)
Public Overloads 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
)

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.

670

Remarks
The grid recognizes two types of row: regular rows which contain data, and
node rows which are used to group data. This method only sorts the row
nodes; it does not reorder the data rows within each node.
To sort the data rows, use the grid's C1FlexGridBase.Sort method instead.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members
Overload List
Sort(Int32,IComparer) Method
Level of the nodes to sort.
An System.Collections.IComparer object that compares Node objects.
Sorts all nodes at the given level using the specified comparer.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Sort( _
ByVal level As Integer, _
ByVal comparer As IComparer _
)
C#
public void Sort(
int level,
IComparer comparer

671

Parameters
level
Level of the nodes to sort.
comparer
An System.Collections.IComparer object that compares Node objects.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members
Overload List

Properties
For a list of all members of this type, see GridTree members.

Public Properties
Name

Description

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.

672

MaximumLevel

Gets the level of the deepest node in the outline.

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.

Top

See Also
Reference
GridTree Class
C1.Win.C1FlexGrid Namespace

Column Property
Gets or sets the index of the column where the outline tree is displayed.

Syntax
Visual Basic (Declaration)
Public Property Column As Integer
C#
public int Column {get; set;}

Remarks
By default, this property is set to -1, which causes the tree to be hidden.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
673

GridTree Class
GridTree Members

Indent Property
Gets or sets the indentation, in pixels, of each tree level.

Syntax
Visual Basic (Declaration)
Public Property Indent As Integer
C#
public int Indent {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members

LineColor Property
Gets or sets the color of the lines in the outline tree.

Syntax
Visual Basic (Declaration)
Public Property LineColor As Color

674

C#
public Color LineColor {get; set;}

Remarks
See also the Style property.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members

LineStyle Property
Gets or sets the line style used to draw the outline tree.

Syntax
Visual Basic (Declaration)
Public Property LineStyle As DashStyle
C#
public DashStyle LineStyle {get; set;}

Remarks
By default, this property is set to DashStyle.Dot, which causes the tree to be drawn with dotted
lines. You can change the value of this property to draw the tree using solid lines instead.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

675

See Also
Reference
GridTree Class
GridTree Members

MaximumLevel Property
Gets the level of the deepest node in the outline.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property MaximumLevel As Integer
C#
public int MaximumLevel {get;}

Remarks
This property can be used with methods that take an outline level as a parameter (for example,
Sort(Int32,SortFlags,Int32,Int32) and Show).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members

NodeImageCollapsed Property
Gets or sets the image displayed next to collapsed nodes.

Syntax

676

Visual Basic (Declaration)


Public Property NodeImageCollapsed As Image
C#
public Image NodeImageCollapsed {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members

NodeImageExpanded Property
Gets or sets the image displayed next to expanded nodes.

Syntax
Visual Basic (Declaration)
Public Property NodeImageExpanded As Image
C#
public Image NodeImageExpanded {get; set;}

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.

677

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
GridTree Class
GridTree Members

Style Property
Gets or sets the style of the outline tree.

Syntax
Visual Basic (Declaration)
Public Property Style As TreeStyleFlags
C#
public TreeStyleFlags Style {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

678

GridTree Class
GridTree Members

KeyEditEventArgs
Provides data for the C1FlexGridBase.KeyDownEdit and C1FlexGridBase.KeyUpEdit events.

Object Model

Syntax
Visual Basic (Declaration)
Public Class KeyEditEventArgs
Inherits System.EventArgs
C#
public class KeyEditEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.KeyEditEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.KeyDownEdit and C1FlexGridBase.KeyUpEdit events.

Object Model
679

Syntax
Visual Basic (Declaration)
Public Class KeyEditEventArgs
Inherits System.EventArgs
C#
public class KeyEditEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.KeyEditEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by KeyEditEventArgs.

Public Constructors
Name

Description

KeyEditEventArgs Constructor Initializes a new instance of the KeyEditEventArgs class.

680

Top

Public Fields
Name

Description

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.

Top

See Also
Reference

681

KeyEditEventArgs Class
C1.Win.C1FlexGrid Namespace

KeyEditEventArgs Constructor
The row index of the cell being edited when the key was pressed.
The column index of the cell being edited when the key was pressed.
A System.Windows.Forms.KeyEventArgs object containing the keyboard data.
Initializes a new instance of the KeyEditEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal row As Integer, _
ByVal col As Integer, _
ByVal e As KeyEventArgs _
)
C#
public KeyEditEventArgs(
int row,
int col,
KeyEventArgs e
)

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.

Requirements

682

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,


Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Class
KeyEditEventArgs Members

Fields
For a list of all members of this type, see KeyEditEventArgs members.

Public Fields
Name

Description

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.

683

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.

Top

See Also
Reference
KeyEditEventArgs Class
C1.Win.C1FlexGrid Namespace

Alt Field
Gets a value indicating whether the ALT key was pressed.

Syntax
Visual Basic (Declaration)
Public ReadOnly Alt As Boolean
C#
public readonly bool Alt

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Class
KeyEditEventArgs Members

Col Field
Gets the column index of the cell being edited when the key was pressed.

Syntax

684

Visual Basic (Declaration)


Public ReadOnly Col As Integer
C#
public readonly int Col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Class
KeyEditEventArgs Members

Control Field
Gets a value indicating whether the CTRL key was pressed.

Syntax
Visual Basic (Declaration)
Public ReadOnly Control As Boolean
C#
public readonly bool Control

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

685

KeyEditEventArgs Class
KeyEditEventArgs Members

Handled Field
Gets or sets a value indicating whether the event was handled and should be ignored by the
control.

Syntax
Visual Basic (Declaration)
Public Handled As Boolean
C#
public bool Handled

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Class
KeyEditEventArgs Members

KeyCode Field
Gets the key code for the event, which will be one of the System.Windows.Forms.Keys values.

Syntax
Visual Basic (Declaration)
Public ReadOnly KeyCode As Keys
C#
public readonly Keys KeyCode

Requirements
686

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Class
KeyEditEventArgs Members

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.

Syntax
Visual Basic (Declaration)
Public ReadOnly KeyData As Keys
C#
public readonly Keys KeyData

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Class
KeyEditEventArgs Members

KeyValue Field
Gets the integer representation of the KeyData property.

Syntax

687

Visual Basic (Declaration)


Public ReadOnly KeyValue As Integer
C#
public readonly int KeyValue

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Class
KeyEditEventArgs Members

Modifiers Field
Gets the modifier flags, as defined in Keys. This indicates which combination of modifier keys (CTRL,
SHIFT, and ALT) were pressed.

Syntax
Visual Basic (Declaration)
Public ReadOnly Modifiers As Keys
C#
public readonly Keys Modifiers

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

688

KeyEditEventArgs Class
KeyEditEventArgs Members

Row Field
Gets the row index of the cell being edited when the key was pressed.

Syntax
Visual Basic (Declaration)
Public ReadOnly Row As Integer
C#
public readonly int Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Class
KeyEditEventArgs Members

Shift Field
Gets a value indicating whether the SHIFT key was pressed.

Syntax
Visual Basic (Declaration)
Public ReadOnly Shift As Boolean
C#
public readonly bool Shift

Requirements

689

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyEditEventArgs Class
KeyEditEventArgs Members

KeyPressEditEventArgs
Provides data for the C1FlexGridBase.KeyPressEdit event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class KeyPressEditEventArgs
Inherits System.EventArgs
C#
public class KeyPressEditEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.KeyPressEditEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

690

Reference
KeyPressEditEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.KeyPressEdit event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class KeyPressEditEventArgs
Inherits System.EventArgs
C#
public class KeyPressEditEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.KeyPressEditEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyPressEditEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

691

The following tables list the members exposed by KeyPressEditEventArgs.

Public Constructors
Name

Description

KeyPressEditEventArgs Constructor Initializes a new instance of the KeyPressEditEventArgs


class.
Top

Public Fields
Name

Description

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.

Top

See Also
Reference
KeyPressEditEventArgs Class
C1.Win.C1FlexGrid Namespace

KeyPressEditEventArgs Constructor
The row index of the cell being edited when the key was pressed.
The column index of the cell being edited when the key was pressed.
The character corresponding to the key pressed.
Initializes a new instance of the KeyPressEditEventArgs class.

692

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal row As Integer, _
ByVal col As Integer, _
ByVal key As Char _
)
C#
public KeyPressEditEventArgs(
int row,
int col,
char key
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
KeyPressEditEventArgs Class
KeyPressEditEventArgs Members

693

Fields
For a list of all members of this type, see KeyPressEditEventArgs members.

Public Fields
Name

Description

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.

Top

See Also
Reference
KeyPressEditEventArgs Class
C1.Win.C1FlexGrid Namespace

Col Field
Gets the column index of the cell being edited when the key was pressed.

Syntax
Visual Basic (Declaration)
Public ReadOnly Col As Integer
C#
public readonly int Col

Requirements

694

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyPressEditEventArgs Class
KeyPressEditEventArgs Members

Handled Field
Gets or sets a value indicating whether the event was handled and should be ignored by the
control.

Syntax
Visual Basic (Declaration)
Public Handled As Boolean
C#
public bool Handled

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyPressEditEventArgs Class
KeyPressEditEventArgs Members

KeyChar Field
Gets the character corresponding to the key pressed.

Syntax

695

Visual Basic (Declaration)


Public KeyChar As Char
C#
public char KeyChar

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
KeyPressEditEventArgs Class
KeyPressEditEventArgs Members

Row Field
Gets the row index of the cell being edited when the key was pressed.

Syntax
Visual Basic (Declaration)
Public ReadOnly Row As Integer
C#
public readonly int Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

696

KeyPressEditEventArgs Class
KeyPressEditEventArgs Members

MultiColumnDictionary
Example

Class that implements the IC1MultiColumnDictionary and can be used as a column DataMap to
create multi-column combo editors.

Object Model

Syntax
Visual Basic (Declaration)
Public Class MultiColumnDictionary
Inherits System.Collections.Specialized.ListDictionary
Implements IC1MultiColumnDictionary
C#
public class MultiColumnDictionary :
System.Collections.Specialized.ListDictionary, IC1MultiColumnDictionary

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:
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:

697

This map is bound to an Employees DataTable. The keyColumn parameter is set to "EmployeeID",
causing this field to be 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.

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, Col3|Row2, Col1\tRow3,
Col2";
MultiColumnDictionary map = new MultiColumnDictionary(text, 0, true);
_flex.Cols[1].DataMap = map;

C#

// 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;

Inheritance Hierarchy
System.Object

System.Collections.Specialized.ListDictionary
C1.Win.C1FlexGrid.MultiColumnDictionary

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

698

See Also
Reference
MultiColumnDictionary Members
C1.Win.C1FlexGrid Namespace

Overview
Example

Class that implements the IC1MultiColumnDictionary and can be used as a column DataMap to
create multi-column combo editors.

Object Model

Syntax
Visual Basic (Declaration)
Public Class MultiColumnDictionary
Inherits System.Collections.Specialized.ListDictionary
Implements IC1MultiColumnDictionary
C#
public class MultiColumnDictionary :
System.Collections.Specialized.ListDictionary, IC1MultiColumnDictionary

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:
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.

699

The code below creates a bound data map and assigns it to a grid column:
This map is bound to an Employees DataTable. The keyColumn parameter is set to "EmployeeID",
causing this field to be 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.

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, Col3|Row2, Col1\tRow3,
Col2";
MultiColumnDictionary map = new MultiColumnDictionary(text, 0, true);
_flex.Cols[1].DataMap = map;

C#

// 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;

Inheritance Hierarchy

System.Object
System.Collections.Specialized.ListDictionary
C1.Win.C1FlexGrid.MultiColumnDictionary

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

700

See Also
Reference
MultiColumnDictionary Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by MultiColumnDictionary.

Public Constructors
Name

Description

MultiColumnDictionary Constructor Overloaded.


Top

Public Properties
Name

Description

Count

(Inherited from System.Collections.Specialized.ListDictionary)

IsFixedSize

(Inherited from System.Collections.Specialized.ListDictionary)

IsReadOnly

(Inherited from System.Collections.Specialized.ListDictionary)

IsSynchronized

(Inherited from System.Collections.Specialized.ListDictionary)

Item

(Inherited from System.Collections.Specialized.ListDictionary)

Keys

(Inherited from System.Collections.Specialized.ListDictionary)

SyncRoot

(Inherited from System.Collections.Specialized.ListDictionary)

Values

(Inherited from System.Collections.Specialized.ListDictionary)

701

Top

Public Methods
Name

Description

Add

(Inherited from System.Collections.Specialized.ListDictionary)

Clear

Removes all entries from the MultiColumnDictionary.

Contains

(Inherited from System.Collections.Specialized.ListDictionary)

CopyTo

(Inherited from System.Collections.Specialized.ListDictionary)

GetEnumerator

(Inherited from System.Collections.Specialized.ListDictionary)

Remove

(Inherited from System.Collections.Specialized.ListDictionary)

Top

See Also
Reference
MultiColumnDictionary Class
C1.Win.C1FlexGrid Namespace

MultiColumnDictionary Constructor

Overload List
Overload

Description

MultiColumnDictionary Constructor(String)

Initializes a new instance of an


unbound
MultiColumnDictionary class.

MultiColumnDictionary Constructor(String,Int32,Boolean)

Initializes a new instance of an


unbound

702

MultiColumnDictionary class.
MultiColumnDictionary Constructor(ITypedList,String,String[],Int32) Initializes a new instance of a
bound MultiColumnDictionary
class.
MultiColumnDictionary Constructor(ITypedList,String)

Initializes a new instance of a


bound MultiColumnDictionary
class.

MultiColumnDictionary Constructor(DataTable,String,String[],Int32) Initializes a new instance of a


bound MultiColumnDictionary
class.
MultiColumnDictionary Constructor(DataTable,String)

Initializes a new instance of a


bound MultiColumnDictionary
class.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
MultiColumnDictionary Class
MultiColumnDictionary Members

MultiColumnDictionary Constructor(String)
String that contains the items, delimited by pipe characters ("|"). Each item may contain multiple
columns, delimited by tabs (vbTab or '\t').
Initializes a new instance of an unbound MultiColumnDictionary class.

Syntax

703

Visual Basic (Declaration)


Public Function New( _
ByVal items As String _
)
C#
public MultiColumnDictionary(
string items
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
MultiColumnDictionary Class
MultiColumnDictionary Members
Overload List

MultiColumnDictionary Constructor(String,Int32,Boolean)
String that contains the items. Items are delimited by pipe characters ("|"). Each item may contain
multiple columns, delimited by tabs (vbTab or '\t').
Index of the column that is displayed in the grid.

704

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.
Initializes a new instance of an unbound MultiColumnDictionary class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal items As String, _
ByVal displayColumn As Integer, _
ByVal autoKeys As Boolean _
)
C#
public MultiColumnDictionary(
string items,
int displayColumn,
bool autoKeys
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

705

See Also
Reference
MultiColumnDictionary Class
MultiColumnDictionary Members
Overload List

MultiColumnDictionary Constructor(ITypedList,String,String[],Int32)
Data source object.
Name of the data source column that contains unique keys.
Array with the names of the columns that are included in the map.
Name of the column that is displayed in the grid.
Initializes a new instance of a bound MultiColumnDictionary class.

Syntax
Visual Basic (Declaration)
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
)

Parameters
list
Data source object.

706

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
MultiColumnDictionary Class
MultiColumnDictionary Members
Overload List

MultiColumnDictionary Constructor(ITypedList,String)
Data source object.
Name of the data source column that contains unique keys.
Initializes a new instance of a bound MultiColumnDictionary class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal list As ITypedList, _
ByVal keyColumn As String _
)
C#
public MultiColumnDictionary(

707

ITypedList list,
string keyColumn
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
MultiColumnDictionary Class
MultiColumnDictionary Members
Overload List

MultiColumnDictionary Constructor(DataTable,String,String[],Int32)
Data source object.
Name of the data source column that contains unique keys.
Array with the names of the columns that are included in the map.
Name of the column that is displayed in the grid.
Initializes a new instance of a bound MultiColumnDictionary class.

Syntax

708

Visual Basic (Declaration)


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
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference

709

MultiColumnDictionary Class
MultiColumnDictionary Members
Overload List

MultiColumnDictionary Constructor(DataTable,String)
Data source object.
Name of the data source column that contains unique keys.
Initializes a new instance of a bound MultiColumnDictionary class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal table As DataTable, _
ByVal keyColumn As String _
)
C#
public MultiColumnDictionary(
DataTable table,
string keyColumn
)

Parameters
table
Data source object.
keyColumn
Name of the data source column that contains unique keys.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also

710

Reference
MultiColumnDictionary Class
MultiColumnDictionary Members
Overload List

Methods
For a list of all members of this type, see MultiColumnDictionary members.

Public Methods
Name

Description

Add

(Inherited from System.Collections.Specialized.ListDictionary)

Clear

Removes all entries from the MultiColumnDictionary.

Contains

(Inherited from System.Collections.Specialized.ListDictionary)

CopyTo

(Inherited from System.Collections.Specialized.ListDictionary)

GetEnumerator

(Inherited from System.Collections.Specialized.ListDictionary)

Remove

(Inherited from System.Collections.Specialized.ListDictionary)

Top

See Also
Reference
MultiColumnDictionary Class
C1.Win.C1FlexGrid Namespace

Clear Method
Removes all entries from the MultiColumnDictionary.

Syntax
Visual Basic (Declaration)

711

Public Shadows Sub Clear()


C#
public new void Clear()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
MultiColumnDictionary Class
MultiColumnDictionary Members

Node
The Node class encapsulates properties and methods used for manipulating node rows (collapsing,
expanding, moving, and sorting them).

Object Model

Syntax
Visual Basic (Declaration)
Public Class Node
C#
public class Node

Remarks
You can create node rows using the C1FlexGridBase.Subtotal method or by setting the
Row.IsNode property to true.

Inheritance Hierarchy

712

System.Object
C1.Win.C1FlexGrid.Node

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Members
C1.Win.C1FlexGrid Namespace

Overview
The Node class encapsulates properties and methods used for manipulating node rows (collapsing,
expanding, moving, and sorting them).

Object Model

Syntax
Visual Basic (Declaration)
Public Class Node
C#
public class Node

Remarks
You can create node rows using the C1FlexGridBase.Subtotal method or by setting the
Row.IsNode property to true.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.Node

713

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by Node.

Public Properties
Name

Description

Checked

Gets or sets the checkbox value associated with this node.

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.

FirstChild

Gets the first child node.

FirstSibling

Gets the first sibling node.

FirstVisibleChild

Gets the first visible child node.

714

Image

Gets or sets the image on this node row at the column that contains the
outline tree.

Index

Gets the index of this node in the collection.

Key

Gets or sets the RowCol.UserData associated with this node row.

LastChild

Gets the last child node.

LastSibling

Gets the last sibling node.

Level

Gets or sets the outline level for this node.

NextNode

Gets the next sibling node.

NextVisibleNode Gets the next visible sibling node.


Nodes

Gets an array containing the children of this node.

Parent

Gets the parent node of this node.

PrevNode

Gets the previous sibling node.

PrevVisibleNode Gets the previous visible sibling node.


Row

Returns a reference to the Row object that corresponds to this node.

Top

Public Methods
Name

Description

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

715

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 this node's child nodes in the specified order.

Top

See Also
Reference
Node Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see Node members.

Public Methods
Name

Description

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.

716

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 this node's child nodes in the specified order.

Top

See Also
Reference
Node Class
C1.Win.C1FlexGrid Namespace

AddNode Method
Creates a node row at a specified position relative to this node.

Overload List
Overload

Description

AddNode(NodeTypeEnum,Object,Object,Image) Creates a node row at a specified position relative


to this node.
AddNode(NodeTypeEnum,Object)

Creates a node row at a specified position relative


to this node.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

717

See Also
Reference
Node Class
Node Members
AddNode(NodeTypeEnum,Object,Object,Image) Method
A value from the NodeTypeEnum enumeration that specifies where the new node will be added
with respect to this node (e.g. Child, Sibling).
Value of the Data property for the new node.
Value of the Key property for the new node.
Value of the Image property for the new node.
Creates a node row at a specified position relative to this node.

Syntax
Visual Basic (Declaration)
Public Overloads 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
)

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).

718

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members
Overload List
AddNode(NodeTypeEnum,Object) Method
A value from the NodeTypeEnum enumeration that specifies where the new node will be added
with respect to this node (e.g. Child, Sibling).
Value of the Data property for the new node.
Creates a node row at a specified position relative to this node.

Syntax
Visual Basic (Declaration)
Public Overloads Function AddNode( _
ByVal position As NodeTypeEnum, _
ByVal data As Object _

719

) As Node
C#
public Node AddNode(
NodeTypeEnum position,
object data
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members
Overload List

EnsureVisible Method
Ensures that this node is visible, expanding its parent nodes and scrolling it into view if necessary.

Syntax
Visual Basic (Declaration)

720

Public Sub EnsureVisible()


C#
public void EnsureVisible()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

GetCellRange Method
Returns a CellRange object containing this row and all its child rows.

Syntax
Visual Basic (Declaration)
Public Function GetCellRange() As CellRange
C#
public CellRange GetCellRange()

Return Value
A CellRange object containing this row and all its child rows.

Remarks
The CellRange object returned includes all columns.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

721

See Also
Reference
Node Class
Node Members

GetNode Method
A value from the NodeTypeEnum enumeration that specifies the position relative to this node.
Returns a reference to a node located at a given position relative to this node.

Syntax
Visual Basic (Declaration)
Public Function GetNode( _
ByVal position As NodeTypeEnum _
) As Node
C#
public Node GetNode(
NodeTypeEnum position
)

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).

Requirements

722

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Move Method
Moves a node to a new position.

Overload List
Overload

Description

Move(NodeMoveEnum,Node) Moves a node to a new position.


Move(NodeMoveEnum)

Moves a node to a new position.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members
Move(NodeMoveEnum,Node) Method
A value from the NodeMoveEnum enumeration that specifies where the node will be moved with
respect to its current position.
Node object to use as a target when the moveTo parameter is set to NodeMoveEnum.ChildOf.
Moves a node to a new position.

Syntax
723

Visual Basic (Declaration)


Public Overloads Function Move( _
ByVal moveTo As NodeMoveEnum, _
ByVal targetNode As Node _
) As Boolean
C#
public bool Move(
NodeMoveEnum moveTo,
Node targetNode
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members
Overload List

724

Move(NodeMoveEnum) Method
A value from the NodeMoveEnum enumeration that specifies where the node will be moved with
respect to its current position.
Moves a node to a new position.

Syntax
Visual Basic (Declaration)
Public Overloads Function Move( _
ByVal moveTo As NodeMoveEnum _
) As Boolean
C#
public bool Move(
NodeMoveEnum moveTo
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members
Overload List

725

RemoveNode Method
Removes this node row and all its child rows (nodes and data) from the grid.

Syntax
Visual Basic (Declaration)
Public Sub RemoveNode()
C#
public void RemoveNode()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Select Method
Selects the node.

Syntax
Visual Basic (Declaration)
Public Sub Select()
C#
public void Select()

Remarks
This method sets the control's C1FlexGridBase.Row property.

Requirements
726

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Sort Method
Sorts this node's child nodes in the specified order.

Overload List
Overload

Description

Sort(SortFlags,Int32,Int32) Sorts this node's child nodes in the specified order.


Sort(SortFlags)

Sorts this node's child nodes in the specified order.

Sort(IComparer)

Sorts this node's child nodes using a given


System.Collections.IComparer object to determine the node order.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members
Sort(SortFlags,Int32,Int32) Method
One or more values from the SortFlags enumeration that specify the type of sorting to be applied
(e.g. ascending, descending, case-sensitive, etc).
Start of a range of columns to sort.

727

End of a range of columns to sort.


Sorts this node's child nodes in the specified order.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Sort( _
ByVal order As SortFlags, _
ByVal col1 As Integer, _
ByVal col2 As Integer _
)
C#
public void Sort(
SortFlags order,
int col1,
int col2
)

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.

Remarks
The grid recognizes two types of row: regular rows which contain data, and node
rows which are used to group data. This method only sorts the row nodes; it does
not reorder the data rows within each node.
To sort the data rows, use the grid's C1FlexGridBase.Sort method instead.

728

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members
Overload List
Sort(SortFlags) Method
One or more values from the SortFlags enumeration that specify the type of sorting to be applied
(e.g. ascending, descending, case-sensitive, etc).
Sorts this node's child nodes in the specified order.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Sort( _
ByVal order As SortFlags _
)
C#
public void Sort(
SortFlags order
)

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).

Remarks

729

The grid recognizes two types of row: regular rows which contain data, and node rows which
are used to group data. This method only sorts the row nodes; it does not reorder the data
rows within each node.
To sort the data rows, use the grid's C1FlexGridBase.Sort method instead.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members
Overload List
Sort(IComparer) Method
An object that implements the System.Collections.IComparer interface used to compare Row
objects. This can be used to provide custom sorting.
Sorts this node's child nodes using a given System.Collections.IComparer object to determine the
node order.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Sort( _
ByVal comparer As IComparer _
)
C#
public void Sort(
IComparer comparer
)

Parameters
comparer

730

An object that implements the System.Collections.IComparer interface used to compare


Row objects. This can be used to provide custom sorting.

Remarks
The grid recognizes two types of row: regular rows which contain data, and node rows which
are used to group data. This method only sorts the row nodes; it does not reorder the data
rows within each node.
To sort the data rows, use the grid's C1FlexGridBase.Sort method instead.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members
Overload List

Properties
For a list of all members of this type, see Node members.

Public Properties
Name

Description

Checked

Gets or sets the checkbox value associated with this node.

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.

731

Expanded

Gets or sets whether this node is expanded.

FirstChild

Gets the first child node.

FirstSibling

Gets the first sibling node.

FirstVisibleChild

Gets the first visible child node.

Image

Gets or sets the image on this node row at the column that contains the
outline tree.

Index

Gets the index of this node in the collection.

Key

Gets or sets the RowCol.UserData associated with this node row.

LastChild

Gets the last child node.

LastSibling

Gets the last sibling node.

Level

Gets or sets the outline level for this node.

NextNode

Gets the next sibling node.

NextVisibleNode Gets the next visible sibling node.


Nodes

Gets an array containing the children of this node.

Parent

Gets the parent node of this node.

PrevNode

Gets the previous sibling node.

PrevVisibleNode Gets the previous visible sibling node.


Row

Returns a reference to the Row object that corresponds to this node.

Top

732

See Also
Reference
Node Class
C1.Win.C1FlexGrid Namespace

Checked Property
Gets or sets the checkbox value associated with this node.

Syntax
Visual Basic (Declaration)
Public Property Checked As CheckEnum
C#
public CheckEnum Checked {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Children Property
Gets the number of child nodes under this node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Children As Integer
C#

733

public int Children {get;}

Remarks
Only immediate children are included in the count. Grand-children are not included.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Collapsed Property
Gets or sets whether this node is collapsed.

Syntax
Visual Basic (Declaration)
Public Property Collapsed As Boolean
C#
public bool Collapsed {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

734

Data Property
Gets or sets the data on this node row at the column that contains the outline tree.

Syntax
Visual Basic (Declaration)
Public Property Data As Object
C#
public object Data {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Expanded Property
Gets or sets whether this node is expanded.

Syntax
Visual Basic (Declaration)
Public Property Expanded As Boolean
C#
public bool Expanded {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

735

See Also
Reference
Node Class
Node Members

FirstChild Property
Gets the first child node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property FirstChild As Node
C#
public Node FirstChild {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

FirstSibling Property
Gets the first sibling node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property FirstSibling As Node
C#

736

public Node FirstSibling {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

FirstVisibleChild Property
Gets the first visible child node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property FirstVisibleChild As Node
C#
public Node FirstVisibleChild {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Image Property
Gets or sets the image on this node row at the column that contains the outline tree.

Syntax
737

Visual Basic (Declaration)


Public Property Image As Image
C#
public Image Image {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Index Property
Gets the index of this node in the collection.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Index As Integer
C#
public int Index {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

738

Node Class
Node Members

Key Property
Gets or sets the RowCol.UserData associated with this node row.

Syntax
Visual Basic (Declaration)
Public Property Key As Object
C#
public object Key {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

LastChild Property
Gets the last child node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property LastChild As Node
C#
public Node LastChild {get;}

Requirements

739

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

LastSibling Property
Gets the last sibling node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property LastSibling As Node
C#
public Node LastSibling {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Level Property
Gets or sets the outline level for this node.

Syntax
Visual Basic (Declaration)

740

Public Property Level As Integer


C#
public int Level {get; set;}

Remarks
Higher levels mean deeper nesting. Set the level to zero to create root nodes, or set the level to
negative values to create nodes that do not appear on the outline tree.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

NextNode Property
Gets the next sibling node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property NextNode As Node
C#
public Node NextNode {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
741

Reference
Node Class
Node Members

NextVisibleNode Property
Gets the next visible sibling node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property NextVisibleNode As Node
C#
public Node NextVisibleNode {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Nodes Property
Gets an array containing the children of this node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Nodes As Node()
C#
public Node[] Nodes {get;}

Requirements
742

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

Parent Property
Gets the parent node of this node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Parent As Node
C#
public Node Parent {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

PrevNode Property
Gets the previous sibling node.

Syntax
Visual Basic (Declaration)

743

Public ReadOnly Property PrevNode As Node


C#
public Node PrevNode {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

PrevVisibleNode Property
Gets the previous visible sibling node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property PrevVisibleNode As Node
C#
public Node PrevVisibleNode {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

744

Row Property
Returns a reference to the Row object that corresponds to this node.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Row As Row
C#
public Row Row {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Node Class
Node Members

OwnerDrawCellEventArgs
Provides data for the C1FlexGridBase.OwnerDrawCell event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class OwnerDrawCellEventArgs
Inherits System.EventArgs
C#
public class OwnerDrawCellEventArgs : System.EventArgs

745

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.OwnerDrawCellEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.OwnerDrawCell event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class OwnerDrawCellEventArgs
Inherits System.EventArgs
C#
public class OwnerDrawCellEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.OwnerDrawCellEventArgs

746

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields Properties Methods

The following tables list the members exposed by OwnerDrawCellEventArgs.

Public Constructors
Name

Description

OwnerDrawCellEventArgs Constructor Initializes a new instance of the


OwnerDrawCellEventArgs class.
Top

Public Fields
Name

Description

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.

Handled

Gets or sets whether the event has finished drawing the cell.

747

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.

Top

Public Properties
Name

Description

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.

Top

Public Methods
Name

Description

DrawCell

Overloaded. Causes the grid to paint parts of the cell (background,


foreground, border, etc.)

Top

See Also
Reference
OwnerDrawCellEventArgs Class
C1.Win.C1FlexGrid Namespace

OwnerDrawCellEventArgs Constructor
The C1FlexGridBase control that contains the cell being painted.
The Graphics object where the cell will be painted.
The row index of the cell being painted.
The column index of the cell being painted.

748

The CellStyle that will be used to paint the cell.


The bounds of the cell being painted.
The text that will be displayed in the cell.
The image that will be displayed in the cell.
Initializes a new instance of the OwnerDrawCellEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal view As C1FlexGridBase, _
ByVal g As Graphics, _
ByVal row As Integer, _
ByVal col As Integer, _
ByVal s As CellStyle, _
ByVal rc As Rectangle, _
ByVal text As String, _
ByVal img As Image _
)
C#
public OwnerDrawCellEventArgs(
C1FlexGridBase view,
Graphics g,
int row,
int col,
CellStyle s,
Rectangle rc,
string text,
Image img
)

Parameters
view
The C1FlexGridBase control that contains the cell being painted.

749

g
The Graphics object where the cell will be painted.
row
The row index of the cell being painted.
col
The column index of the cell being painted.
s
The CellStyle that will be used to paint the cell.
rc
The bounds of the cell being painted.
text
The text that will be displayed in the cell.
img
The image that will be displayed in the cell.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or
later, Windows XP SP3, Windows Server 2008 (Server
Core not supported), Windows Server 2008 R2 (Server
Core supported with SP1 or later), Windows Server 2003
SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

Methods
For a list of all members of this type, see OwnerDrawCellEventArgs members.

Public Methods

750

Name

Description

DrawCell

Overloaded. Causes the grid to paint parts of the cell (background,


foreground, border, etc.)

Top

See Also
Reference
OwnerDrawCellEventArgs Class
C1.Win.C1FlexGrid Namespace

DrawCell Method
Causes the grid to paint parts of the cell (background, foreground, border, etc.)

Overload List
Overload

Description

DrawCell(DrawCellFlags) Causes the grid to paint parts of the cell (background, foreground, border,
etc.)
DrawCell()

Causes the grid to paint the whole cell.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members
DrawCell(DrawCellFlags) Method
DrawCellFlags that specifies the parts of the cell.

751

Causes the grid to paint parts of the cell (background, foreground, border, etc.)

Syntax
Visual Basic (Declaration)
Public Overloads Sub DrawCell( _
ByVal flags As DrawCellFlags _
)
C#
public void DrawCell(
DrawCellFlags flags
)

Parameters
flags
DrawCellFlags that specifies the parts of the cell.

Remarks
This method is typically called in C1FlexGridBase.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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
752

Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members
Overload List
DrawCell() Method
Causes the grid to paint the whole cell.

Syntax
Visual Basic (Declaration)
Public Overloads Sub DrawCell()
C#
public void DrawCell()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members
Overload List

Properties
For a list of all members of this type, see OwnerDrawCellEventArgs members.

Public Properties
Name

Description

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.

753

Text

Gets or sets the text that will be displayed in the cell.

Top

See Also
Reference
OwnerDrawCellEventArgs Class
C1.Win.C1FlexGrid Namespace

Image Property
Gets or sets the image that will be displayed in the cell.

Syntax
Visual Basic (Declaration)
Public Property Image As Image
C#
public Image Image {get; set;}

Remarks
Changing this value is an easy way to modify the image displayed in a cell without any custom
drawing code.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

Style Property
Example

754

Sets or sets the CellStyle object used to paint the cell.

Syntax
Visual Basic (Declaration)
Public Property Style As CellStyle
C#
public CellStyle Style {get; set;}

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 C1FlexGridBase.OwnerDrawCell event to highlight cells that indicate low
stock levels.

C#

// 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)

755

if ((short)_flex[e.Row, "UnitsInStock"] < (short)_flex[e.Row,


"ReorderLevel"])
e.Style = _flex.Styles["Critical"];
}
}

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

Text Property
Gets or sets the text that will be displayed in the cell.

Syntax
Visual Basic (Declaration)
Public Property Text As String
C#
public string Text {get; set;}

Remarks
Changing this value is an easy way to modify the text displayed in a cell without any custom
drawing code.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
756

OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

Fields
For a list of all members of this type, see OwnerDrawCellEventArgs members.

Public Fields
Name

Description

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.

Handled

Gets or sets whether the event has finished drawing 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.

Top

See Also
Reference
OwnerDrawCellEventArgs Class
C1.Win.C1FlexGrid Namespace

Bounds Field
Get the rectangle where the cell will be painted (in client coordinates).

Syntax
Visual Basic (Declaration)
Public ReadOnly Bounds As Rectangle

757

C#
public readonly Rectangle Bounds

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

Col Field
Get the column index of the cell being painted.

Syntax
Visual Basic (Declaration)
Public ReadOnly Col As Integer
C#
public readonly int Col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

Graphics Field
Gets the Graphics object used to draw the cell. Use this object to draw custom elements in the cell.

758

Syntax
Visual Basic (Declaration)
Public ReadOnly Graphics As Graphics
C#
public readonly Graphics Graphics

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

Handled Field
Gets or sets whether the event has finished drawing the cell.

Syntax
Visual Basic (Declaration)
Public Handled As Boolean
C#
public bool Handled

Remarks
If this parameter is set to true, the grid assumes the call has been painted by the event handler. If it
is set to false, the grid will paint the cell when the event returns.
Note that calling the DrawCell method automatically sets this parameter to true.

Requirements
759

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

Measuring Field
Gets a value that determines if the event was fired only to measure the cell.

Syntax
Visual Basic (Declaration)
Public ReadOnly Measuring As Boolean
C#
public readonly bool Measuring

Remarks
This occurs while auto-sizing rows and columns, since the event handler may change the value
displayed in the cell while handling this event.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

Row Field
Get the row index of the cell being painted.

760

Syntax
Visual Basic (Declaration)
Public ReadOnly Row As Integer
C#
public readonly int Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventArgs Class
OwnerDrawCellEventArgs Members

PrintDocumentGridRenderer
Example

Represents an object that renders a C1FlexGrid into a paged


System.Drawing.Printing.PrintDocument.

Object Model

Syntax
Visual Basic (Declaration)
Public Class PrintDocumentGridRenderer
C#
public class PrintDocumentGridRenderer

Remarks
761

This class may be used to print multiple grids, along with other custom content, into an existing
System.Drawing.Printing.PrintDocument object.
To use it, create one PrintDocumentGridRenderer for each grid you want to print. Then handle
the document events and call the PrintPage(PrintPageEventArgs) event for the renderers until the
value of the CurrentPage property equals PageCount.
The code below renders two grids into a System.Drawing.Printing.PrintDocument: // print two
grids into an existing PrintDocument private void button1_Click(object
sender, EventArgs e) { using (var dlg = new PrintPreviewDialog()) {
dlg.Document = this.printDocument1; dlg.ShowDialog(this); } } // event
handlers for the PrintDocument object on the form
PrintDocumentGridRenderer _g1, _g2; void printDocument1_BeginPrint(object
sender, System.Drawing.Printing.PrintEventArgs e) { // create and
configure grid renderer for the first grid _g1 = new
PrintDocumentGridRenderer(c1FlexGrid1); _g1.Options =
PrintGridFlags.FitToPageWidth | PrintGridFlags.ExtendLastCol; // create
and configure grid renderer for the second grid _g2 = new
PrintDocumentGridRenderer(c1FlexGrid2); _g2.Options =
PrintGridFlags.FitToPageWidth | PrintGridFlags.ExtendLastCol; } void
printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e) { // render first grid if
(_g1.CurrentPage < _g1.PageCount) { _g1.PrintPage(e); e.HasMorePages =
true; } // render second grid else if (_g2.CurrentPage < _g2.PageCount) {
_g2.PrintPage(e); e.HasMorePages = _g2.CurrentPage < _g2.PageCount; } }

Example
The code below renders two grids into a System.Drawing.Printing.PrintDocument:

C#

// print two grids into an existing PrintDocument


private void button1_Click(object sender, EventArgs e)
{
using (var dlg = new PrintPreviewDialog())
{
dlg.Document = this.printDocument1;
dlg.ShowDialog(this);
}
}
// event handlers for the PrintDocument object on the form
PrintDocumentGridRenderer _g1, _g2;
void printDocument1_BeginPrint(object sender,
System.Drawing.Printing.PrintEventArgs e)
{
// create and configure grid renderer for the first grid
_g1 = new PrintDocumentGridRenderer(c1FlexGrid1);
_g1.Options = PrintGridFlags.FitToPageWidth | PrintGridFlags.ExtendLastCol;

762

// create and configure grid renderer for the second grid


_g2 = new PrintDocumentGridRenderer(c1FlexGrid2);
_g2.Options = PrintGridFlags.FitToPageWidth | PrintGridFlags.ExtendLastCol;
}
void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
// render first grid
if (_g1.CurrentPage < _g1.PageCount)
{
_g1.PrintPage(e);
e.HasMorePages = true;
}
// render second grid
else if (_g2.CurrentPage < _g2.PageCount)
{
_g2.PrintPage(e);
e.HasMorePages = _g2.CurrentPage < _g2.PageCount;
}
}

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.PrintDocumentGridRenderer

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
PrintDocumentGridRenderer Members
C1.Win.C1FlexGrid Namespace

Overview
Example

Represents an object that renders a C1FlexGrid into a paged


System.Drawing.Printing.PrintDocument.

Object Model

763

Syntax
Visual Basic (Declaration)
Public Class PrintDocumentGridRenderer
C#
public class PrintDocumentGridRenderer

Remarks
This class may be used to print multiple grids, along with other custom content, into an existing
System.Drawing.Printing.PrintDocument object.
To use it, create one PrintDocumentGridRenderer for each grid you want to print. Then handle
the document events and call the PrintPage(PrintPageEventArgs) event for the renderers until the
value of the CurrentPage property equals PageCount.
The code below renders two grids into a System.Drawing.Printing.PrintDocument: // print two
grids into an existing PrintDocument private void button1_Click(object
sender, EventArgs e) { using (var dlg = new PrintPreviewDialog()) {
dlg.Document = this.printDocument1; dlg.ShowDialog(this); } } // event
handlers for the PrintDocument object on the form
PrintDocumentGridRenderer _g1, _g2; void printDocument1_BeginPrint(object
sender, System.Drawing.Printing.PrintEventArgs e) { // create and
configure grid renderer for the first grid _g1 = new
PrintDocumentGridRenderer(c1FlexGrid1); _g1.Options =
PrintGridFlags.FitToPageWidth | PrintGridFlags.ExtendLastCol; // create
and configure grid renderer for the second grid _g2 = new
PrintDocumentGridRenderer(c1FlexGrid2); _g2.Options =
PrintGridFlags.FitToPageWidth | PrintGridFlags.ExtendLastCol; } void
printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e) { // render first grid if
(_g1.CurrentPage < _g1.PageCount) { _g1.PrintPage(e); e.HasMorePages =
true; } // render second grid else if (_g2.CurrentPage < _g2.PageCount) {
_g2.PrintPage(e); e.HasMorePages = _g2.CurrentPage < _g2.PageCount; } }

Example
The code below renders two grids into a System.Drawing.Printing.PrintDocument:

C#

764

// print two grids into an existing PrintDocument


private void button1_Click(object sender, EventArgs e)
{
using (var dlg = new PrintPreviewDialog())
{
dlg.Document = this.printDocument1;
dlg.ShowDialog(this);
}
}
// event handlers for the PrintDocument object on the form
PrintDocumentGridRenderer _g1, _g2;
void printDocument1_BeginPrint(object sender,
System.Drawing.Printing.PrintEventArgs e)
{
// create and configure grid renderer for the first grid
_g1 = new PrintDocumentGridRenderer(c1FlexGrid1);
_g1.Options = PrintGridFlags.FitToPageWidth | PrintGridFlags.ExtendLastCol;
// create and configure grid renderer for the second grid
_g2 = new PrintDocumentGridRenderer(c1FlexGrid2);
_g2.Options = PrintGridFlags.FitToPageWidth | PrintGridFlags.ExtendLastCol;
}
void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
// render first grid
if (_g1.CurrentPage < _g1.PageCount)
{
_g1.PrintPage(e);
e.HasMorePages = true;
}
// render second grid
else if (_g2.CurrentPage < _g2.PageCount)
{
_g2.PrintPage(e);
e.HasMorePages = _g2.CurrentPage < _g2.PageCount;
}
}

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.PrintDocumentGridRenderer

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

765

See Also
Reference
PrintDocumentGridRenderer Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by PrintDocumentGridRenderer.

Public Constructors
Name

Description

PrintDocumentGridRenderer Constructor Initializes a new instance of a


PrintDocumentGridRenderer.
Top

Public Properties
Name

Description

CurrentPage

Gets the index of the page being rendered.

FirstPageY

Gets or sets the Y coordinate of the first block of cells rendered on the
document.

Options

Gets or sets the flags that specify printing options to use with the
C1FlexGridBase.PrintGrid method. See the PrintGridFlags enumeration for
details.

PageCount

Gets the total number of pages in the document.

Top

Public Methods

766

Name

Description

PrintPage

Overloaded. Renders the current page into the document.

Setup

Calculates the zoom factor and page breaks in the document.

Top

See Also
Reference
PrintDocumentGridRenderer Class
C1.Win.C1FlexGrid Namespace

PrintDocumentGridRenderer Constructor
C1FlexGridBase that will be painted by this renderer.
Initializes a new instance of a PrintDocumentGridRenderer.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal flex As C1FlexGridBase _
)
C#
public PrintDocumentGridRenderer(
C1FlexGridBase flex
)

Parameters
flex
C1FlexGridBase that will be painted by this renderer.

Requirements

767

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
PrintDocumentGridRenderer Class
PrintDocumentGridRenderer Members

Methods
>
Name

Description

PrintPage

Overloaded. Renders the current page into the document.

Setup

Calculates the zoom factor and page breaks in the document.

Top

See Also
Reference
PrintDocumentGridRenderer Class
C1.Win.C1FlexGrid Namespace

PrintPage Method
Renders the current page into the document.

Overload List
Overload

Description

PrintPage(PrintPageEventArgs)

Renders the current page into the document.

PrintPage(PrintPageEventArgs,Int32) Renders a specific page into the document.

Requirements

768

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
PrintDocumentGridRenderer Class
PrintDocumentGridRenderer Members
PrintPage(PrintPageEventArgs) Method
System.Drawing.Printing.PrintPageEventArgs that provides parameters for rendering the page.
Renders the current page into the document.

Syntax
Visual Basic (Declaration)
Public Overloads Sub PrintPage( _
ByVal e As PrintPageEventArgs _
)
C#
public void PrintPage(
PrintPageEventArgs e
)

Parameters
e
System.Drawing.Printing.PrintPageEventArgs that provides parameters for rendering the
page.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also

769

Reference
PrintDocumentGridRenderer Class
PrintDocumentGridRenderer Members
Overload List
PrintPage(PrintPageEventArgs,Int32) Method
System.Drawing.Printing.PrintPageEventArgs that provides parameters for rendering the page.
Index of the page to print.
Renders a specific page into the document.

Syntax
Visual Basic (Declaration)
Public Overloads Sub PrintPage( _
ByVal e As PrintPageEventArgs, _
ByVal pageIndex As Integer _
)
C#
public void PrintPage(
PrintPageEventArgs e,
int pageIndex
)

Parameters
e
System.Drawing.Printing.PrintPageEventArgs that provides parameters for rendering the
page.
pageIndex
Index of the page to print.

Remarks
This method is used to render specific ranges of pages within the document.

Requirements
770

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
PrintDocumentGridRenderer Class
PrintDocumentGridRenderer Members
Overload List

Setup Method
System.Drawing.Printing.PrintPageEventArgs that contains the page information.
Calculates the zoom factor and page breaks in the document.

Syntax
Visual Basic (Declaration)
Public Sub Setup( _
ByVal e As PrintPageEventArgs _
)
C#
public void Setup(
PrintPageEventArgs e
)

Parameters
e
System.Drawing.Printing.PrintPageEventArgs that contains the page information.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also

771

Reference
PrintDocumentGridRenderer Class
PrintDocumentGridRenderer Members

Properties
>
Name
CurrentPage
FirstPageY

Description
Gets the index of the page being rendered.
Gets or sets the Y coordinate of the first block of cells rendered on the
document.
Gets or sets the flags that specify printing options to use with the

Options

C1FlexGridBase.PrintGrid method. See the PrintGridFlags enumeration for


details.

PageCount

Gets the total number of pages in the document.

Top

See Also
Reference
PrintDocumentGridRenderer Class
C1.Win.C1FlexGrid Namespace

CurrentPage Property
Gets the index of the page being rendered.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property CurrentPage As Integer
C#
public int CurrentPage {get;}

Requirements

772

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
PrintDocumentGridRenderer Class
PrintDocumentGridRenderer Members

FirstPageY Property
Gets or sets the Y coordinate of the first block of cells rendered on the document.

Syntax
Visual Basic (Declaration)
Public Property FirstPageY As Integer
C#
public int FirstPageY {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
PrintDocumentGridRenderer Class
PrintDocumentGridRenderer Members

Options Property
Gets or sets the flags that specify printing options to use with the C1FlexGridBase.PrintGrid
method. See the PrintGridFlags enumeration for details.

Syntax

773

Visual Basic (Declaration)


Public Property Options As PrintGridFlags
C#
public PrintGridFlags Options {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
PrintDocumentGridRenderer Class
PrintDocumentGridRenderer Members

PageCount Property
Gets the total number of pages in the document.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property PageCount As Integer
C#
public int PageCount {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

774

PrintDocumentGridRenderer Class
PrintDocumentGridRenderer Members

RangeEventArgs
Provides data for the C1FlexGridBase.AfterRowColChange, C1FlexGridBase.AfterScroll,
C1FlexGridBase.AfterSelChange, C1FlexGridBase.BeforeRowColChange,
C1FlexGridBase.BeforeScroll, and C1FlexGridBase.BeforeSelChange events.

Object Model

Syntax
Visual Basic (Declaration)
Public Class RangeEventArgs
Inherits System.EventArgs
C#
public class RangeEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.RangeEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RangeEventArgs Members
C1.Win.C1FlexGrid Namespace

775

Overview
Provides data for the C1FlexGridBase.AfterRowColChange, C1FlexGridBase.AfterScroll,
C1FlexGridBase.AfterSelChange, C1FlexGridBase.BeforeRowColChange,
C1FlexGridBase.BeforeScroll, and C1FlexGridBase.BeforeSelChange events.

Object Model

Syntax
Visual Basic (Declaration)
Public Class RangeEventArgs
Inherits System.EventArgs
C#
public class RangeEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.RangeEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RangeEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by RangeEventArgs.

776

Public Constructors
Name

Description

RangeEventArgs Constructor Initializes a new instance of the RangeEventArgs class.


Top

Public Fields
Name

Description

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.

Top

See Also
Reference
RangeEventArgs Class
C1.Win.C1FlexGrid Namespace

RangeEventArgs Constructor
The range selected before the event.
The range that will be selected after the event.
Initializes a new instance of the RangeEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal rgOld As CellRange, _

777

ByVal rgNew As CellRange _


)
C#
public RangeEventArgs(
CellRange rgOld,
CellRange rgNew
)

Parameters
rgOld
The range selected before the event.
rgNew
The range that will be selected after the event.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
RangeEventArgs Class
RangeEventArgs Members

Fields
For a list of all members of this type, see RangeEventArgs members.

Public Fields
Name

Description

Cancel

Gets or sets a value indicating whether the new selection should be


canceled.

778

NewRange

Gets the range that will be selected after the event.

OldRange

Gets the range selected before the event.

Top

See Also
Reference
RangeEventArgs Class
C1.Win.C1FlexGrid Namespace

Cancel Field
Gets or sets a value indicating whether the new selection should be canceled.

Syntax
Visual Basic (Declaration)
Public Cancel As Boolean
C#
public bool Cancel

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RangeEventArgs Class
RangeEventArgs Members

NewRange Field
Gets the range that will be selected after the event.

Syntax

779

Visual Basic (Declaration)


Public ReadOnly NewRange As CellRange
C#
public readonly CellRange NewRange

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RangeEventArgs Class
RangeEventArgs Members

OldRange Field
Gets the range selected before the event.

Syntax
Visual Basic (Declaration)
Public ReadOnly OldRange As CellRange
C#
public readonly CellRange OldRange

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

780

RangeEventArgs Class
RangeEventArgs Members

Row
Class that represents a grid row.

Object Model

Syntax
Visual Basic (Declaration)
Public Class Row
Inherits RowCol
C#
public class Row : RowCol

Remarks
This class does not have a public constructor. You can add and remove rows using methods in the
grid's C1FlexGridBase.Rows property, which exposes the row collection.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowCol
C1.Win.C1FlexGrid.Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

781

Row Members
C1.Win.C1FlexGrid Namespace

Overview
Class that represents a grid row.

Object Model

Syntax
Visual Basic (Declaration)
Public Class Row
Inherits RowCol
C#
public class Row : RowCol

Remarks
This class does not have a public constructor. You can add and remove rows using methods in the
grid's C1FlexGridBase.Rows property, which exposes the row collection.

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowCol
C1.Win.C1FlexGrid.Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

782

Row Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by Row.

Public Properties
Name

Description

AllowDragging

Gets or sets whether the user can drag this row or column with the mouse.
(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowEditing

Gets or sets whether cells on this row or column can be edited by the user.
(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowMerging

Specifies whether adjacent cells with similar contents will be merged.


(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowResizing

Gets or sets whether the user can resize this row or column with the mouse.
(Inherited from C1.Win.C1FlexGrid.RowCol)

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

Gets or sets a list of items to be used by the drop-down editor. (Inherited


from C1.Win.C1FlexGrid.RowCol)

DataIndex

Gets the index of this row in the RowCollection collection, excluding fixed
and node rows.

DataMap

Gets or sets an System.Collections.IDictionary object used to translate data


values into display values for this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

783

DataSource

Gets the object that provides data for this row.

DataType

Gets or sets the type of object stored in this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

EditMask

Gets or sets the input mask to use when editing cells on this column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

Editor

Gets or sets the custom editor used to edit cells in this column. (Inherited
from C1.Win.C1FlexGrid.RowCol)

Format

Gets or sets a string that specifies how to format the data on this column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

Grid

Gets a reference to the C1FlexGridBase control that owns this row or


column. (Inherited from C1.Win.C1FlexGrid.RowCol)

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

Gets or sets an ImageAlignEnum value that determines how images are


aligned in scrollable cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

ImageAlignFixed Gets or sets an ImageAlignEnum value that determines how images are
aligned in fixed cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)
ImageAndText

Gets or sets a value that determines whether images found in this row or
column's RowCol.ImageMap should be displayed instead of or in addition to
the cell text. (Inherited from C1.Win.C1FlexGrid.RowCol)

ImageMap

Gets or sets an System.Collections.IDictionary object used to translate data

784

values into images for this row or column. (Inherited from


C1.Win.C1FlexGrid.RowCol)
Index

Overridden. Gets the index of this row in the RowCollection collection.

IsCollapsed

Gets whether this row is collapsed. (Inherited from


C1.Win.C1FlexGrid.RowCol)

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.

IsVisible

Gets whether this row is currently visible to the user. (Inherited from
C1.Win.C1FlexGrid.RowCol)

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

Overridden. Gets or sets whether this row is selected.

Style

Gets or sets a custom CellStyle associated with this row or column. (Inherited
from C1.Win.C1FlexGrid.RowCol)

StyleDisplay

Gets the style used to display this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

StyleFixed

Gets the stock CellStyle used to paint fixed cells in this row or column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

StyleFixedDisplay Gets the style used to display fixed cells on this row or column. (Inherited
from C1.Win.C1FlexGrid.RowCol)

785

StyleFixedNew

Gets the custom style associated with fixed cells on this row or column,
creating a new one of necessary. (Inherited from C1.Win.C1FlexGrid.RowCol)

StyleNew

Gets or sets a custom CellStyle associated with this row or column, creating a
new style if necessary. (Inherited from C1.Win.C1FlexGrid.RowCol)

TextAlign

Gets or sets a TextAlignEnum value that determines how text is aligned in


scrollable cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

TextAlignFixed

Gets or sets a TextAlignEnum value that determines how text is aligned in


fixed cells on this row or column. (Inherited from C1.Win.C1FlexGrid.RowCol)

Top

Gets the position of the top of this row, in pixels, relative to the grid.

UserData

Gets or sets user data associated with this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

Visible

Gets or sets whether a Row or Column is visible. (Inherited from


C1.Win.C1FlexGrid.RowCol)

Top

Public Methods
Name

Description

Clear

Overridden. Clears this row.

Invalidate

Overridden. Invalidates this row, causing it to be repainted.

Move

Overridden. Moves a row to a new position in the collection.

Top

See Also
Reference
786

Row Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see Row members.

Public Methods
Name

Description

Clear

Overridden. Clears this row.

Invalidate

Overridden. Invalidates this row, causing it to be repainted.

Move

Overridden. Moves a row to a new position in the collection.

Top

See Also
Reference
Row Class
C1.Win.C1FlexGrid Namespace

Clear Method
ClearFlags value specifying which elements of the row should be cleared.
Clears this row.

Syntax
Visual Basic (Declaration)
Public Overrides Sub Clear( _
ByVal clearFlags As ClearFlags _
)
C#
public override void Clear(
ClearFlags clearFlags

787

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.).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

Invalidate Method
Invalidates this row, causing it to be repainted.

Syntax
Visual Basic (Declaration)
Public Overrides Sub Invalidate()
C#
public override void Invalidate()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

788

See Also
Reference
Row Class
Row Members

Move Method
An integer specifying the row's new position.
Moves a row to a new position in the collection.

Syntax
Visual Basic (Declaration)
Public Overrides Sub Move( _
ByVal indexNew As Integer _
)
C#
public override void Move(
int indexNew
)

Parameters
indexNew
An integer specifying the row's new position.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

789

Properties
For a list of all members of this type, see Row members.

Public Properties
Name

Description

AllowDragging

Gets or sets whether the user can drag this row or column with the mouse.
(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowEditing

Gets or sets whether cells on this row or column can be edited by the user.
(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowMerging

Specifies whether adjacent cells with similar contents will be merged.


(Inherited from C1.Win.C1FlexGrid.RowCol)

AllowResizing

Gets or sets whether the user can resize this row or column with the mouse.
(Inherited from C1.Win.C1FlexGrid.RowCol)

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

Gets or sets a list of items to be used by the drop-down editor. (Inherited


from C1.Win.C1FlexGrid.RowCol)

DataIndex

Gets the index of this row in the RowCollection collection, excluding fixed
and node rows.

DataMap

Gets or sets an System.Collections.IDictionary object used to translate data


values into display values for this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

DataSource

Gets the object that provides data for this row.

DataType

Gets or sets the type of object stored in this row or column. (Inherited from

790

C1.Win.C1FlexGrid.RowCol)
EditMask

Gets or sets the input mask to use when editing cells on this column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

Editor

Gets or sets the custom editor used to edit cells in this column. (Inherited
from C1.Win.C1FlexGrid.RowCol)

Format

Gets or sets a string that specifies how to format the data on this column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

Grid

Gets a reference to the C1FlexGridBase control that owns this row or


column. (Inherited from C1.Win.C1FlexGrid.RowCol)

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

Gets or sets an ImageAlignEnum value that determines how images are


aligned in scrollable cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

ImageAlignFixed Gets or sets an ImageAlignEnum value that determines how images are
aligned in fixed cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)
ImageAndText

Gets or sets a value that determines whether images found in this row or
column's RowCol.ImageMap should be displayed instead of or in addition to
the cell text. (Inherited from C1.Win.C1FlexGrid.RowCol)

ImageMap

Gets or sets an System.Collections.IDictionary object used to translate data


values into images for this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

791

Index

Overridden. Gets the index of this row in the RowCollection collection.

IsCollapsed

Gets whether this row is collapsed. (Inherited from


C1.Win.C1FlexGrid.RowCol)

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.

IsVisible

Gets whether this row is currently visible to the user. (Inherited from
C1.Win.C1FlexGrid.RowCol)

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

Overridden. Gets or sets whether this row is selected.

Style

Gets or sets a custom CellStyle associated with this row or column. (Inherited
from C1.Win.C1FlexGrid.RowCol)

StyleDisplay

Gets the style used to display this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

StyleFixed

Gets the stock CellStyle used to paint fixed cells in this row or column.
(Inherited from C1.Win.C1FlexGrid.RowCol)

StyleFixedDisplay Gets the style used to display fixed cells on this row or column. (Inherited
from C1.Win.C1FlexGrid.RowCol)
StyleFixedNew

Gets the custom style associated with fixed cells on this row or column,
creating a new one of necessary. (Inherited from C1.Win.C1FlexGrid.RowCol)

792

StyleNew

Gets or sets a custom CellStyle associated with this row or column, creating a
new style if necessary. (Inherited from C1.Win.C1FlexGrid.RowCol)

TextAlign

Gets or sets a TextAlignEnum value that determines how text is aligned in


scrollable cells on this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

TextAlignFixed

Gets or sets a TextAlignEnum value that determines how text is aligned in


fixed cells on this row or column. (Inherited from C1.Win.C1FlexGrid.RowCol)

Top

Gets the position of the top of this row, in pixels, relative to the grid.

UserData

Gets or sets user data associated with this row or column. (Inherited from
C1.Win.C1FlexGrid.RowCol)

Visible

Gets or sets whether a Row or Column is visible. (Inherited from


C1.Win.C1FlexGrid.RowCol)

Top

See Also
Reference
Row Class
C1.Win.C1FlexGrid Namespace

Bottom Property
Gets the position of the bottom of this row, in pixels, relative to the grid.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Bottom As Integer
C#
public int Bottom {get;}

793

Remarks
The value returned corresponds to the sum of the Top and HeightDisplay properties.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

Caption Property
Gets or sets the text of the first fixed cell in the row.

Syntax
Visual Basic (Declaration)
Public Property Caption As String
C#
public string Caption {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

794

DataIndex Property
Gets the index of this row in the RowCollection collection, excluding fixed and node rows.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property DataIndex As Integer
C#
public int DataIndex {get;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

DataSource Property
Gets the object that provides data for this row.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property DataSource As Object

795

C#
public object DataSource {get;}

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 C1FlexGridBase.GetUnboundValue event.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

Height Property
Gets or sets the height of this row, in pixels (the value -1 represents the default row height).

Syntax
Visual Basic (Declaration)
Public Property Height As Integer
C#
public int Height {get; set;}

Remarks
Setting this property to -1 causes the grid to use the default row height for this row (see the
RowColCollection.DefaultSize property).

796

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

HeightDisplay Property
Gets or sets the display height for this row, in pixels.

Syntax
Visual Basic (Declaration)
Public Property HeightDisplay As Integer
C#
public int HeightDisplay {get; set;}

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).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

797

Row Class
Row Members

Index Property
Gets the index of this row in the RowCollection collection.

Syntax
Visual Basic (Declaration)
Public Overrides ReadOnly Property Index As Integer
C#
public override int Index {get;}

Remarks
This property returns -1 if the Row is not a member of the collection.
See also the SafeIndex and DataIndex properties.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

IsNew Property
Indicates the row is a placeholder for adding new rows to the grid.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property IsNew As Boolean

798

C#
public bool IsNew {get;}

Remarks
This property returns true for the last row on the grid when the C1FlexGridBase.AllowAddNew
property is set to true. This is the row that has an asterisk glyph on the first fixed column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

IsNode Property
Gets or sets whether this row is a node row in an outline.

Syntax
Visual Basic (Declaration)
Public Property IsNode As Boolean
C#
public bool IsNode {get; set;}

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 C1FlexGridBase.Subtotal
method to create outline trees automatically.

Requirements

799

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

Item Property
Gets or sets the cell value specified by the column index in this row.

Overload List
Overload

Description

Item(Int32)

Gets or sets the cell value specified by the column index in this row.

Item(String)

Gets or sets the cell value specified by the column name in this row.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members
Item(Int32) Property
Gets or sets the cell value specified by the column index in this row.

Syntax
Visual Basic (Declaration)

800

Public Overloads Property Item( _


ByVal columnIndex As Integer _
) As Object
C#
public object Item(
int columnIndex
) {get; set;}

Parameters
columnIndex

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members
Overload List
Item(String) Property
Gets or sets the cell value specified by the column name in this row.

Syntax
Visual Basic (Declaration)
Public Overloads Property Item( _
ByVal columnName As String _
) As Object
C#
public object Item(
string columnName

801

) {get; set;}

Parameters
columnName

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members
Overload List

Node Property
Gets the Node object associated with this row.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Node As Node
C#
public Node Node {get;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

802

See Also
Reference
Row Class
Row Members

SafeIndex Property
Gets the index of this row in the RowCollection collection.

Syntax
Visual Basic (Declaration)
Public Overridable ReadOnly Property SafeIndex As Integer
C#
public virtual int SafeIndex {get;}

Remarks
This property is similar to the Index property, except it throws an exception if the Row is not a
member of the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

Selected Property
Gets or sets whether this row is selected.

Syntax

803

Visual Basic (Declaration)


Public Overrides Property Selected As Boolean
C#
public override bool Selected {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

Top Property
Gets the position of the top of this row, in pixels, relative to the grid.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Top As Integer
C#
public int Top {get;}

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 C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.ScrollPosition property.

804

To retrieve the size and position of a cell, use the C1FlexGridBase.GetCellRect method.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Row Class
Row Members

RowCol
Base class for grid rows and columns (Row and Column classes).

Object Model

Syntax
Visual Basic (Declaration)
Public MustInherit Class RowCol
C#
public abstract class RowCol

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowCol
C1.Win.C1FlexGrid.Column
C1.Win.C1FlexGrid.Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

805

See Also
Reference
RowCol Members
C1.Win.C1FlexGrid Namespace

Overview
Base class for grid rows and columns (Row and Column classes).

Object Model

Syntax
Visual Basic (Declaration)
Public MustInherit Class RowCol
C#
public abstract class RowCol

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowCol
C1.Win.C1FlexGrid.Column
C1.Win.C1FlexGrid.Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Members
C1.Win.C1FlexGrid Namespace

806

Members
Properties Methods

The following tables list the members exposed by RowCol.

Public Properties
Name

Description

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 this 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.

Grid

Gets a reference to the C1FlexGridBase control that owns this row or


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

807

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.

IsCollapsed

Gets whether this row is collapsed.

IsVisible

Gets whether this row is currently visible to the user.

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 in this row or column.

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,
creating 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

808

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.

Top

Public Methods
Name

Description

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.

Top

See Also
Reference
RowCol Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see RowCol members.

Public Methods
Name

Description

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.

809

Top

See Also
Reference
RowCol Class
C1.Win.C1FlexGrid Namespace

Clear Method
ClearFlags value specifying which elements of the row or column should be cleared.
Clears the contents of the row or column.

Syntax
Visual Basic (Declaration)
Public Overridable Sub Clear( _
ByVal clearFlags As ClearFlags _
)
C#
public virtual void Clear(
ClearFlags clearFlags
)

Parameters
clearFlags
ClearFlags value specifying which elements of the row or column should be cleared.

Remarks
Use this method to reset column properties to their default values (width, visibility, style, user
data, and so on). This method only clears the column object itself, it does not clear the
contents of the cells in the column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

810

See Also
Reference
RowCol Class
RowCol Members

Invalidate Method
Invalidates an individual row or column, causing it to be repainted.

Syntax
Visual Basic (Declaration)
Public MustOverride Sub Invalidate()
C#
public abstract void Invalidate()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

Move Method
An integer specifying the new position.
Moves this row or column to a new position in the collection.

Syntax
Visual Basic (Declaration)
Public Overridable Sub Move( _
ByVal indexNew As Integer _

811

)
C#
public virtual void Move(
int indexNew
)

Parameters
indexNew
An integer specifying the new position.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

Properties
For a list of all members of this type, see RowCol members.

Public Properties
Name

Description

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.

812

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 this 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.

Grid

Gets a reference to the C1FlexGridBase control that owns this row or


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.

IsCollapsed

Gets whether this row is collapsed.

IsVisible

Gets whether this row is currently visible to the user.

813

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 in this row or column.

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,
creating 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.

Top

See Also
Reference
RowCol Class
C1.Win.C1FlexGrid Namespace

AllowDragging Property
Gets or sets whether the user can drag this row or column with the mouse.

814

Syntax
Visual Basic (Declaration)
Public Overridable Property AllowDragging As Boolean
C#
public virtual bool AllowDragging {get; set;}

Remarks
The grid object also has an C1FlexGridBase.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 C1FlexGridBase.AllowDragging property, then dragging of
individual rows and columns can still be disabled by setting this property to false.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

AllowEditing Property
Gets or sets whether cells on this row or column can be edited by the user.

Syntax
Visual Basic (Declaration)
Public Overridable Property AllowEditing As Boolean
C#
public virtual bool AllowEditing {get; set;}

815

Remarks
The grid object also has an C1FlexGridBase.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 C1FlexGridBase.AllowEditing property, then editing of individual
rows and columns can still be disabled by setting this property to false.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

AllowMerging Property
Specifies whether adjacent cells with similar contents will be merged.

Syntax
Visual Basic (Declaration)
Public Overridable Property AllowMerging As Boolean
C#
public virtual bool AllowMerging {get; set;}

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.

816

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

AllowResizing Property
Gets or sets whether the user can resize this row or column with the mouse.

Syntax
Visual Basic (Declaration)
Public Overridable Property AllowResizing As Boolean
C#
public virtual bool AllowResizing {get; set;}

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 can't 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.

817

The C1FlexGridBase.BeforeResizeRow and C1FlexGridBase.BeforeResizeColumn events fire


before resizing starts, and may be used to prevent resizing of specific rows and columns. The
C1FlexGridBase.AfterResizeRow and C1FlexGridBase.AfterResizeColumn fire after resizing, and
may be used to validate the user's action and to update the display.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

ComboList Property
Gets or sets a list of items to be used by the drop-down editor.

Syntax
Visual Basic (Declaration)
Public Property ComboList As String
C#
public string ComboList {get; set;}

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 C1FlexGridBase.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").

818

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 C1FlexGridBase.CellButtonClick event.
In this case, the user can't 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.
Note that the ComboList property has precedence over the DataMap property. Using both
properties on a single row or column is legal, but it effectively disables the DataMap.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

DataMap Property
Gets or sets an System.Collections.IDictionary object used to translate data values into display
values for this row or column.

Syntax
Visual Basic (Declaration)
Public Property DataMap As IDictionary
C#
public IDictionary DataMap {get; set;}

Remarks

819

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.
Note that the DataMap property has no effect when the ComboList property is also set. Using both
properties on a single row or column is legal, but it effectively disables the DataMap.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

DataType Property
Gets or sets the type of object stored in this row or column.

Syntax
Visual Basic (Declaration)
Public Overridable Property DataType As Type
C#
public virtual Type DataType {get; set;}

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
C1FlexGridBase.GridError event and the cell value will not be changed.

820

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

EditMask Property
Gets or sets the input mask to use when editing cells on this column.

Syntax
Visual Basic (Declaration)
Public Property EditMask As String
C#
public string EditMask {get; set;}

Remarks
The grid also has an C1FlexGridBase.EditMask property that applies to the entire grid. For details
and mask syntax, refer to that property.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

821

See Also
Reference
RowCol Class
RowCol Members

Editor Property
Example

Gets or sets the custom editor used to edit cells in this column.

Syntax
Visual Basic (Declaration)
Public Overridable Property Editor As Control
C#
public virtual Control Editor {get; set;}

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.

C#

822

// 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;

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

Format Property
Gets or sets a string that specifies how to format the data on this column.

Syntax
Visual Basic (Declaration)
Public Property Format As String
C#
public string Format {get; set;}

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 C1FlexGridBase.GetDataDisplay 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.

Requirements

823

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

Grid Property
Gets a reference to the C1FlexGridBase control that owns this row or column.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Grid As C1FlexGridBase
C#
public C1FlexGridBase Grid {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

ImageAlign Property
Gets or sets an ImageAlignEnum value that determines how images are aligned in scrollable cells
on this row or column.

Syntax

824

Visual Basic (Declaration)


Public Property ImageAlign As ImageAlignEnum
C#
public ImageAlignEnum ImageAlign {get; set;}

Remarks
This property gets or sets the alignment value specified by the CellStyle object associated with the
column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

ImageAlignFixed Property
Gets or sets an ImageAlignEnum value that determines how images are aligned in fixed cells on this
row or column.

Syntax
Visual Basic (Declaration)
Public Property ImageAlignFixed As ImageAlignEnum
C#
public ImageAlignEnum ImageAlignFixed {get; set;}

Requirements

825

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

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.

Syntax
Visual Basic (Declaration)
Public Property ImageAndText As Boolean
C#
public bool ImageAndText {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

ImageMap Property
Gets or sets an System.Collections.IDictionary object used to translate data values into images for
this row or column.

Syntax

826

Visual Basic (Declaration)


Public Property ImageMap As IDictionary
C#
public IDictionary ImageMap {get; set;}

Remarks
Use this property to associate data values in this 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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

Index Property
Gets the index of this row or column in its parent collection.

Syntax
Visual Basic (Declaration)
Public Overridable ReadOnly Property Index As Integer
C#
public virtual int Index {get;}

Remarks
This property returns -1 if the row or column is not a member of the collection.

827

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

IsCollapsed Property
Gets whether this row is collapsed.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property IsCollapsed As Boolean
C#
public bool IsCollapsed {get;}

Remarks
Rows are collapsed when one of their parent nodes is collapsed. Collapsed rows are not visible to
the user even if their Visible property is set to true.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

828

IsVisible Property
Gets whether this row is currently visible to the user.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property IsVisible As Boolean
C#
public bool IsVisible {get;}

Remarks
This property returns true if the Visible property is set to true and the row is collapsed (IsCollapsed
property returns false).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

Selected Property
Gets or sets whether this row or column is selected.

Syntax
Visual Basic (Declaration)
Public Overridable Property Selected As Boolean
C#
public virtual bool Selected {get; set;}

829

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

Style Property
Gets or sets a custom CellStyle associated with this row or column.

Syntax
Visual Basic (Declaration)
Public Overridable Property Style As CellStyle
C#
public virtual CellStyle Style {get; set;}

Remarks
If the row or column does not have a custom style, this property returns null.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
830

RowCol Class
RowCol Members

StyleDisplay Property
Gets the style used to display this row or column.

Syntax
Visual Basic (Declaration)
Public Overridable ReadOnly Property StyleDisplay As CellStyle
C#
public virtual CellStyle StyleDisplay {get;}

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,
Frozen).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

StyleFixed Property
Gets the stock CellStyle used to paint fixed cells in this row or column.

Syntax
Visual Basic (Declaration)
Public Overridable Property StyleFixed As CellStyle

831

C#
public virtual CellStyle StyleFixed {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

StyleFixedDisplay Property
Gets the style used to display fixed cells on this row or column.

Syntax
Visual Basic (Declaration)
Public Overridable ReadOnly Property StyleFixedDisplay As CellStyle
C#
public virtual CellStyle StyleFixedDisplay {get;}

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).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

832

RowCol Class
RowCol Members

StyleFixedNew Property
Gets the custom style associated with fixed cells on this row or column, creating a new one of
necessary.

Syntax
Visual Basic (Declaration)
Public Overridable ReadOnly Property StyleFixedNew As CellStyle
C#
public virtual CellStyle StyleFixedNew {get;}

Remarks
If the row or column has a custom style associated with its fixed cells, this property returns that
style. Otherwise, it creates a new CellStyle, assigns it to the row or column, and returns a reference
to the new style.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

StyleNew Property
Example

Gets or sets a custom CellStyle associated with this row or column, creating a new style if necessary.

Syntax

833

Visual Basic (Declaration)


Public Overridable ReadOnly Property StyleNew As CellStyle
C#
public virtual CellStyle StyleNew {get;}

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.

C#

// 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;

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

TextAlign Property
Gets or sets a TextAlignEnum value that determines how text is aligned in scrollable cells on this
row or column.

Syntax
Visual Basic (Declaration)

834

Public Property TextAlign As TextAlignEnum


C#
public TextAlignEnum TextAlign {get; set;}

Remarks
This property gets or sets the alignment value specified by the CellStyle object associated with the
column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

TextAlignFixed Property
Gets or sets a TextAlignEnum value that determines how text is aligned in fixed cells on this row or
column.

Syntax
Visual Basic (Declaration)
Public Property TextAlignFixed As TextAlignEnum
C#
public TextAlignEnum TextAlignFixed {get; set;}

Remarks
This property gets or sets the alignment value specified by the CellStyle object associated with the
fixed cells in the row or column.

Requirements
835

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

UserData Property
Gets or sets user data associated with this row or column.

Syntax
Visual Basic (Declaration)
Public Overridable Property UserData As Object
C#
public virtual object UserData {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

Visible Property
Gets or sets whether a Row or Column is visible.

836

Syntax
Visual Basic (Declaration)
Public Overridable Property Visible As Boolean
C#
public virtual bool Visible {get; set;}

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 C1FlexGridBase.TopRow and
C1FlexGridBase.BottomRow properties.
To determine whether a column is currently within view, check the C1FlexGridBase.LeftCol and
C1FlexGridBase.RightCol properties.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCol Class
RowCol Members

RowColCollection
Base class for grid row and column collections (RowCollection and ColumnCollection classes).

Object Model

Syntax
Visual Basic (Declaration)

837

Public MustInherit Class RowColCollection


C#
public abstract class RowColCollection

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowColCollection
C1.Win.C1FlexGrid.ColumnCollection
C1.Win.C1FlexGrid.RowCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColCollection Members
C1.Win.C1FlexGrid Namespace

Overview
Base class for grid row and column collections (RowCollection and ColumnCollection classes).

Object Model

Syntax
Visual Basic (Declaration)
Public MustInherit Class RowColCollection
C#
public abstract class RowColCollection

Inheritance Hierarchy
838

System.Object
C1.Win.C1FlexGrid.RowColCollection
C1.Win.C1FlexGrid.ColumnCollection
C1.Win.C1FlexGrid.RowCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColCollection Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by RowColCollection.

Public Properties
Name

Description

Count

Gets or sets the number of rows or columns in the collection.

DefaultSize

Gets or sets the default size of the rows or columns in the collection (in
pixels).

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.

Grid

Gets a reference to the C1FlexGridBase control that owns this collection.

MaxSize

Gets or sets the maximum size for rows and columns in the collection.

839

MinSize

Gets or sets the minimum size for rows and columns in the collection.

Top

Public Methods
Name

Description

Contains

Determines whether the collection contains a given row or column.

GetNext

Gets the index of the next visible row or column.

GetPrevious

Gets the index of the previous visible 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.

Top

See Also
Reference
RowColCollection Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see RowColCollection members.

Public Methods
Name

Description

Contains

Determines whether the collection contains a given row or column.

GetNext

Gets the index of the next visible row or column.

GetPrevious

Gets the index of the previous visible row or column.

840

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.

Top

See Also
Reference
RowColCollection Class
C1.Win.C1FlexGrid Namespace

Contains Method
Row or column items to be detected.
Determines whether the collection contains a given row or column.

Syntax
Visual Basic (Declaration)
Public Function Contains( _
ByVal item As RowCol _
) As Boolean
C#
public bool Contains(
RowCol item
)

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.

Requirements

841

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
RowColCollection Class
RowColCollection Members

GetNext Method
Index of the original row or column.
Gets the index of the next visible row or column.

Syntax
Visual Basic (Declaration)
Public Function GetNext( _
ByVal item As Integer _
) As Integer
C#
public int GetNext(
int item
)

Parameters
item
Index of the original row or column.

Return Value
Index of the next visible row or column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

842

See Also
Reference
RowColCollection Class
RowColCollection Members

GetPrevious Method
Index of the original row or column.
Gets the index of the previous visible row or column.

Syntax
Visual Basic (Declaration)
Public Function GetPrevious( _
ByVal item As Integer _
) As Integer
C#
public int GetPrevious(
int item
)

Parameters
item
Index of the original row or column.

Return Value
Index of the previous visible row or column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

843

RowColCollection Class
RowColCollection Members

Move Method
Index of row or column to be moved.
New position.
Moves a row or column to a new position in the collection.

Syntax
Visual Basic (Declaration)
Public Overridable Sub Move( _
ByVal indexOld As Integer, _
ByVal indexNew As Integer _
)
C#
public virtual void Move(
int indexOld,
int indexNew
)

Parameters
indexOld
Index of row or column to be moved.
indexNew
New position.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference

844

RowColCollection Class
RowColCollection Members

MoveRange Method
The index of the first row or column in the range to be moved.
The number of rows or columns that will be moved.
New position.
Moves a range of rows or columns to a new position in the collection.

Syntax
Visual Basic (Declaration)
Public Overridable Sub MoveRange( _
ByVal index As Integer, _
ByVal count As Integer, _
ByVal indexNew As Integer _
)
C#
public virtual void MoveRange(
int index,
int count,
int indexNew
)

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.

Requirements

845

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,


Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
RowColCollection Class
RowColCollection Members

Properties
For a list of all members of this type, see RowColCollection members.

Public Properties
Name

Description

Count

Gets or sets the number of rows or columns in the collection.

DefaultSize

Gets or sets the default size of the rows or columns in the collection (in
pixels).

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.

Grid

Gets a reference to the C1FlexGridBase control that owns this 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.

Top

See Also
Reference
RowColCollection Class
C1.Win.C1FlexGrid Namespace

846

Count Property
Gets or sets the number of rows or columns in the collection.

Syntax
Visual Basic (Declaration)
Public Overridable Property Count As Integer
C#
public virtual int Count {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColCollection Class
RowColCollection Members

DefaultSize Property
Gets or sets the default size of the rows or columns in the collection (in pixels).

Syntax
Visual Basic (Declaration)
Public Property DefaultSize As Integer
C#
public int DefaultSize {get; set;}

Remarks
This value is set automatically when the grid's System.Windows.Forms.Control.Font property
changes.
The default size is used when the row's Height property or columns Width property is set to -1.

847

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColCollection Class
RowColCollection Members

Fixed Property
Gets or sets the number of fixed rows or columns in the collection.

Syntax
Visual Basic (Declaration)
Public Overridable Property Fixed As Integer
C#
public virtual int Fixed {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColCollection Class
RowColCollection Members

Frozen Property
Gets or sets the number of frozen rows or columns in the collection.

Syntax

848

Visual Basic (Declaration)


Public Overridable Property Frozen As Integer
C#
public virtual int Frozen {get; set;}

Remarks
Use the C1FlexGridBase.AllowFreezing property to determine whether the user can freeze rows or
columns with the mouse.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColCollection Class
RowColCollection Members

Grid Property
Gets a reference to the C1FlexGridBase control that owns this collection.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Grid As C1FlexGridBase
C#
public C1FlexGridBase Grid {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

849

See Also
Reference
RowColCollection Class
RowColCollection Members

MaxSize Property
Gets or sets the maximum size for rows and columns in the collection.

Syntax
Visual Basic (Declaration)
Public Property MaxSize As Integer
C#
public int MaxSize {get; set;}

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 C1FlexGridBase.AutoSizeRows or
C1FlexGridBase.AutoSizeCols method.
Setting this property to zero disables it.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColCollection Class
RowColCollection Members

MinSize Property
Gets or sets the minimum size for rows and columns in the collection.

850

Syntax
Visual Basic (Declaration)
Public Property MinSize As Integer
C#
public int MinSize {get; set;}

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 C1FlexGridBase.AutoSizeRows or
C1FlexGridBase.AutoSizeCols method.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColCollection Class
RowColCollection Members

RowColEventArgs
Provides data for the C1FlexGridBase.AfterEdit, C1FlexGridBase.AfterResizeColumn,
C1FlexGridBase.AfterResizeRow, C1FlexGridBase.BeforeEdit,
C1FlexGridBase.BeforePageBreak, C1FlexGridBase.BeforeResizeColumn,
C1FlexGridBase.BeforeResizeRow, C1FlexGridBase.ShowScrollTip,
C1FlexGridBase.CellButtonClick, C1FlexGridBase.ComboCloseUp,
C1FlexGridBase.ComboDropDown, C1FlexGridBase.SetupEditor, and C1FlexGridBase.StartEdit
events.

Object Model

Syntax
851

Visual Basic (Declaration)


Public Class RowColEventArgs
Inherits System.EventArgs
C#
public class RowColEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.RowColEventArgs
C1.Win.C1FlexGrid.ToolTipEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.AfterEdit, C1FlexGridBase.AfterResizeColumn,
C1FlexGridBase.AfterResizeRow, C1FlexGridBase.BeforeEdit,
C1FlexGridBase.BeforePageBreak, C1FlexGridBase.BeforeResizeColumn,
C1FlexGridBase.BeforeResizeRow, C1FlexGridBase.ShowScrollTip,
C1FlexGridBase.CellButtonClick, C1FlexGridBase.ComboCloseUp,
C1FlexGridBase.ComboDropDown, C1FlexGridBase.SetupEditor, and C1FlexGridBase.StartEdit
events.

Object Model

Syntax
852

Visual Basic (Declaration)


Public Class RowColEventArgs
Inherits System.EventArgs
C#
public class RowColEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.RowColEventArgs
C1.Win.C1FlexGrid.ToolTipEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by RowColEventArgs.

Public Constructors
Name

Description

RowColEventArgs Constructor Initializes a new instance of the RowColEventArgs class.


Top

Public Fields

853

Name

Description

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.

Top

See Also
Reference
RowColEventArgs Class
C1.Win.C1FlexGrid Namespace

RowColEventArgs Constructor
Index of the row that caused the event.
Index of the column that caused the event.
Initializes a new instance of the RowColEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal row As Integer, _
ByVal col As Integer _
)
C#
public RowColEventArgs(
int row,
int col
)

Parameters
row

854

Index of the row that caused the event.


col
Index of the column that caused the event.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
RowColEventArgs Class
RowColEventArgs Members

Fields
For a list of all members of this type, see RowColEventArgs members.

Public Fields
Name

Description

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.

Top

See Also
Reference
RowColEventArgs Class
C1.Win.C1FlexGrid Namespace

Cancel Field
Gets or sets a value indicating whether the operation should be canceled.

855

Syntax
Visual Basic (Declaration)
Public Cancel As Boolean
C#
public bool Cancel

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColEventArgs Class
RowColEventArgs Members

Col Field
Gets the index of the column that caused the event.

Syntax
Visual Basic (Declaration)
Public ReadOnly Col As Integer
C#
public readonly int Col

Remarks
This value may be set to -1 if the event was caused by a row.

Requirements

856

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColEventArgs Class
RowColEventArgs Members

Row Field
Gets the index of the row that caused the event.

Syntax
Visual Basic (Declaration)
Public ReadOnly Row As Integer
C#
public readonly int Row

Remarks
This value may be set to -1 if the event was caused by a column.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowColEventArgs Class
RowColEventArgs Members

RowCollection
Collection of grid Row objects.

857

Object Model

Syntax
Visual Basic (Declaration)
Public Class RowCollection
Inherits RowColCollection
C#
public class RowCollection : RowColCollection

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowColCollection
C1.Win.C1FlexGrid.RowCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCollection Members
C1.Win.C1FlexGrid Namespace

Overview
Collection of grid Row objects.

Object Model

Syntax

858

Visual Basic (Declaration)


Public Class RowCollection
Inherits RowColCollection
C#
public class RowCollection : RowColCollection

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.RowColCollection
C1.Win.C1FlexGrid.RowCollection

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCollection Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by RowCollection.

Public Properties
Name

Description

Count

Overridden. Gets or sets the number of rows in the collection.

DefaultSize

Gets or sets the default size of the rows or columns in the collection (in
pixels). (Inherited from C1.Win.C1FlexGrid.RowColCollection)

859

Fixed

Overridden. Gets or sets the number of fixed rows in the collection.

Frozen

Gets or sets the number of frozen rows or columns in the collection.


(Inherited from C1.Win.C1FlexGrid.RowColCollection)

GlyphRow

Gets or sets the index of the row used to display the sorting and filtering
glyphs.

Grid

Gets a reference to the C1FlexGridBase control that owns this collection.


(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Item

Gets the Row at the specified index.

MaxSize

Gets or sets the maximum size for rows and columns in the collection.
(Inherited from C1.Win.C1FlexGrid.RowColCollection)

MinSize

Gets or sets the minimum size for rows and columns in the collection.
(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Selected

Gets a collection of Row objects that are currently selected.

Top

Public Methods
Name

Description

Add

Overloaded. Appends a new Row object to the collection.

AddNode

Appends a new Node row to the row collection.

Contains

Determines whether the collection contains a given row or column.


(Inherited from C1.Win.C1FlexGrid.RowColCollection)

GetNext

Gets the index of the next visible row or column. (Inherited from
C1.Win.C1FlexGrid.RowColCollection)

860

GetPrevious

Gets the index of the previous visible row or column. (Inherited from
C1.Win.C1FlexGrid.RowColCollection)

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

Overridden. Move a Row object to a new position in the collection.

MoveRange

Overridden. 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.

Top

See Also
Reference
RowCollection Class
C1.Win.C1FlexGrid Namespace

Methods
For a list of all members of this type, see RowCollection members.

Public Methods
Name

Description

Add

Overloaded. Appends a new Row object to the collection.

AddNode

Appends a new Node row to the row collection.

Contains

Determines whether the collection contains a given row or column.

861

(Inherited from C1.Win.C1FlexGrid.RowColCollection)


GetNext

Gets the index of the next visible row or column. (Inherited from
C1.Win.C1FlexGrid.RowColCollection)

GetPrevious

Gets the index of the previous visible row or column. (Inherited from
C1.Win.C1FlexGrid.RowColCollection)

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

Overridden. Move a Row object to a new position in the collection.

MoveRange

Overridden. 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.

Top

See Also
Reference
RowCollection Class
C1.Win.C1FlexGrid Namespace

Add Method
Appends a new Row object to the collection.

Overload List
Overload

Description

862

Add()

Appends a new Row object to the collection.

Add(Int32)

Appends a given number of Row objects to the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members
Add() Method
Appends a new Row object to the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Function Add() As Row
C#
public Row Add()

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

863

See Also
Reference
RowCollection Class
RowCollection Members
Overload List
Add(Int32) Method
Number of rows to add to the collection.
Appends a given number of Row objects to the collection.

Syntax
Visual Basic (Declaration)
Public Overloads Sub Add( _
ByVal count As Integer _
)
C#
public void Add(
int count
)

Parameters
count
Number of rows to add to the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

864

RowCollection Class
RowCollection Members
Overload List

AddNode Method
Outline level for the new node row.
Appends a new Node row to the row collection.

Syntax
Visual Basic (Declaration)
Public Function AddNode( _
ByVal level As Integer _
) As Node
C#
public Node AddNode(
int level
)

Parameters
level
Outline level for the new node row.

Return Value
A reference to the Node that was added to the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members

865

Insert Method
The position where the new row will be inserted.
Adds a new Row object to the collection at a specified position.

Syntax
Visual Basic (Declaration)
Public Function Insert( _
ByVal index As Integer _
) As Row
C#
public Row Insert(
int index
)

Parameters
index
The position where the new row will be inserted.

Return Value
A reference to the Row that was added to the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members

InsertNode Method
The position where the new node row will be inserted.
Outline level for the new node row.

866

Adds a new Node row to the row collection at a specified position.

Syntax
Visual Basic (Declaration)
Public Function InsertNode( _
ByVal index As Integer, _
ByVal level As Integer _
) As Node
C#
public Node InsertNode(
int index,
int level
)

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 can't 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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
867

Reference
RowCollection Class
RowCollection Members

InsertRange Method
The position where the new range will be inserted.
The number of rows to add.
Adds a range of rows to the collection at a specified position.

Syntax
Visual Basic (Declaration)
Public Sub InsertRange( _
ByVal index As Integer, _
ByVal count As Integer _
)
C#
public void InsertRange(
int index,
int count
)

Parameters
index
The position where the new range will be inserted.
count
The number of rows to add.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
868

Reference
RowCollection Class
RowCollection Members

Move Method
Index of row to be moved.
New position for the row.
Move a Row object to a new position in the collection.

Syntax
Visual Basic (Declaration)
Public Overrides Sub Move( _
ByVal indexOld As Integer, _
ByVal indexNew As Integer _
)
C#
public override void Move(
int indexOld,
int indexNew
)

Parameters
indexOld
Index of row to be moved.
indexNew
New position for the row.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
869

Reference
RowCollection Class
RowCollection Members

MoveRange Method
The index of the first row in the range that will be moved.
The number of rows that will be moved.
New position for the first row in the range.
Moves a range of rows to a new position in the collection.

Syntax
Visual Basic (Declaration)
Public Overrides Sub MoveRange( _
ByVal index As Integer, _
ByVal count As Integer, _
ByVal indexNew As Integer _
)
C#
public override void MoveRange(
int index,
int count,
int indexNew
)

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.

870

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members

Remove Method
Removes a Row object from the collection.

Overload List
Overload

Description

Remove(Int32)

Removes a Row object from the collection.

Remove(Row)

Removes a Row object from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members
Remove(Int32) Method
The index of the row to remove from the collection.
Removes a Row object from the collection.

Syntax
871

Visual Basic (Declaration)


Public Overloads Function Remove( _
ByVal index As Integer _
) As Row
C#
public Row Remove(
int index
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members
Overload List
Remove(Row) Method
The row to be removed.
Removes a Row object from the collection.

Syntax
Visual Basic (Declaration)

872

Public Overloads Function Remove( _


ByVal row As Row _
) As Row
C#
public Row Remove(
Row row
)

Parameters
row
The row to be removed.

Return Value
A reference to the Row that was removed from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members
Overload List

RemoveRange Method
The index of the first row to remove from the collection.
The number of rows to remove from the collection.
Removes a range of rows from the collection.

Syntax
Visual Basic (Declaration)

873

Public Sub RemoveRange( _


ByVal index As Integer, _
ByVal count As Integer _
)
C#
public void RemoveRange(
int index,
int count
)

Parameters
index
The index of the first row to remove from the collection.
count
The number of rows to remove from the collection.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members

Properties
For a list of all members of this type, see RowCollection members.

Public Properties
Name

Description

Count

Overridden. Gets or sets the number of rows in the collection.

874

DefaultSize

Gets or sets the default size of the rows or columns in the collection (in
pixels). (Inherited from C1.Win.C1FlexGrid.RowColCollection)

Fixed

Overridden. Gets or sets the number of fixed rows in the collection.

Frozen

Gets or sets the number of frozen rows or columns in the collection.


(Inherited from C1.Win.C1FlexGrid.RowColCollection)

GlyphRow

Gets or sets the index of the row used to display the sorting and filtering
glyphs.

Grid

Gets a reference to the C1FlexGridBase control that owns this collection.


(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Item

Gets the Row at the specified index.

MaxSize

Gets or sets the maximum size for rows and columns in the collection.
(Inherited from C1.Win.C1FlexGrid.RowColCollection)

MinSize

Gets or sets the minimum size for rows and columns in the collection.
(Inherited from C1.Win.C1FlexGrid.RowColCollection)

Selected

Gets a collection of Row objects that are currently selected.

Top

See Also
Reference
RowCollection Class
C1.Win.C1FlexGrid Namespace

Count Property
Gets or sets the number of rows in the collection.

Syntax

875

Visual Basic (Declaration)


Public Overrides Property Count As Integer
C#
public override int Count {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members

Fixed Property
Gets or sets the number of fixed rows in the collection.

Syntax
Visual Basic (Declaration)
Public Overrides Property Fixed As Integer
C#
public override int Fixed {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

876

See Also
Reference
RowCollection Class
RowCollection Members

GlyphRow Property
Gets or sets the index of the row used to display the sorting and filtering glyphs.

Syntax
Visual Basic (Declaration)
Public Property GlyphRow As Integer
C#
public int GlyphRow {get; set;}

Remarks
The default value is -1, which causes the sorting and filtering glyphs to be shown on the last fixed
row. If you set this property to a value larger than the number of fixed rows, then the glyphs will not
be displayed.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members

Item Property
Gets the Row at the specified index.

Syntax

877

Visual Basic (Declaration)


Public Shadows ReadOnly Default Property Item( _
ByVal index As Integer _
) As Row
C#
public new Row this[
int index
]; {get;}

Parameters
index

Remarks
Use the Row object returned by this method to set attributes such as row height, visibility,
style, selected state, and so on.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members

Selected Property
Example

Gets a collection of Row objects that are currently selected.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Selected As RowCollection

878

C#
public RowCollection Selected {get;}

Remarks
This property is especially useful when the grid's C1FlexGridBase.SelectionMode property is set to
SelectionModeEnum.ListBox.

Example
The code below removes all selected rows from the grid.
Note that foreach loops can't be used to modify the collections being iterated over. This example
works because the Selected collection is being enumerated while the C1FlexGridBase.Rows
collection is being modified.

C#

// delete all selected rows


foreach (Row r in _flex.Rows.Selected)
{
_flex.Rows.Remove(r);
}

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
RowCollection Class
RowCollection Members

SortColEventArgs
Provides data for the C1FlexGridBase.BeforeSort and C1FlexGridBase.AfterSort events.

Object Model

879

Syntax
Visual Basic (Declaration)
Public Class SortColEventArgs
Inherits System.EventArgs
C#
public class SortColEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.SortColEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SortColEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.BeforeSort and C1FlexGridBase.AfterSort events.

Object Model

Syntax
Visual Basic (Declaration)
Public Class SortColEventArgs

880

Inherits System.EventArgs
C#
public class SortColEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.SortColEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SortColEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by SortColEventArgs.

Public Constructors
Name

Description

SortColEventArgs Constructor Initializes a new instance of the SortColEventArgs class.


Top

Public Fields
Name

Description

881

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

Gets or sets a SortFlags value that determines the sorting order.

Top

See Also
Reference
SortColEventArgs Class
C1.Win.C1FlexGrid Namespace

SortColEventArgs Constructor
The column that is being sorted.
SortFlags value that determines the sorting order.
Initializes a new instance of the SortColEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal col As Integer, _
ByVal order As SortFlags _
)
C#
public SortColEventArgs(
int col,
SortFlags order
)

882

Parameters
col
The column that is being sorted.
order
SortFlags value that determines the sorting order.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
SortColEventArgs Class
SortColEventArgs Members

Fields
For a list of all members of this type, see SortColEventArgs members.

Public Fields
Name

Description

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

Gets or sets a SortFlags value that determines the sorting order.

Top

See Also
883

Reference
SortColEventArgs Class
C1.Win.C1FlexGrid Namespace

Cancel Field
Gets or sets a value indicating whether the drag operation should be canceled.

Syntax
Visual Basic (Declaration)
Public Cancel As Boolean
C#
public bool Cancel

Remarks
Setting this parameter to true cancels the built-in sort operation and leaves the sorting glyph
unchanged.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SortColEventArgs Class
SortColEventArgs Members

Col Field
Gets the column that is being sorted.

Syntax
Visual Basic (Declaration)
Public ReadOnly Col As Integer

884

C#
public readonly int Col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SortColEventArgs Class
SortColEventArgs Members

Handled Field
Gets or sets a value indicating whether the drag operation has been handled by the event handler.

Syntax
Visual Basic (Declaration)
Public Handled As Boolean
C#
public bool Handled

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

885

SortColEventArgs Class
SortColEventArgs Members

Order Field
Gets or sets a SortFlags value that determines the sorting order.

Syntax
Visual Basic (Declaration)
Public Order As SortFlags
C#
public SortFlags Order

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SortColEventArgs Class
SortColEventArgs Members

SubtotalEventArgs
Provides data for the C1FlexGridBase.BeforeSubtotal and C1FlexGridBase.AfterSubtotal events.

Object Model

Syntax
Visual Basic (Declaration)
Public Class SubtotalEventArgs
Inherits System.EventArgs

886

C#
public class SubtotalEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.SubtotalEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.BeforeSubtotal and C1FlexGridBase.AfterSubtotal events.

Object Model

Syntax
Visual Basic (Declaration)
Public Class SubtotalEventArgs
Inherits System.EventArgs
C#
public class SubtotalEventArgs : System.EventArgs

Inheritance Hierarchy

887

System.Object
System.EventArgs
C1.Win.C1FlexGrid.SubtotalEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by SubtotalEventArgs.

Public Constructors
Name

Description

SubtotalEventArgs Constructor Initializes a new instance of a SubtotalEventArgs object.


Top

Public Fields
Name

Description

AggregateValue

Gets or sets the calculated aggregate value for the group.

Bottom

Gets the index of the bottom row in the group.

Cancel

Whether to cancel the creation of the new subtotal row.

Caption

Gets or sets the text to insert in the new subtotal row.

888

Function

Gets the AggregateEnum value that specifies the type of aggregate to


calculate..

GroupFrom

Gets the index of the first column in the range used to detect group breaks.

GroupTo

Gets the index of the last column in the range used to detect group breaks.

IsNewRow

Gets a value that determines whether the subtotal row is a new row or the
subtotal is being added to an existing subtotal row.

Level

Outline level to assign to the new subtotal rows.

NewRowIndex

Gets the index of the new subtotal row.

Style

Gets or sets the CellStyle to be applied to the new subotal row.

Top

Gets the index of the top row in the group.

TotalOn

Gets the index of the column that contains values being aggregated.

Top

See Also
Reference
SubtotalEventArgs Class
C1.Win.C1FlexGrid Namespace

SubtotalEventArgs Constructor
AggregateEnum value that specifies the type of aggregate to calculate.
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.
First column in the range used to detect group breaks.
Last column in the range used to detect group breaks.
Column that contains values being aggregated.

889

Text to insert in the new subtotal row.


Index of the new subtotal row.
Whether the subtotal row is a new row or the subtotal is being added to an existing subtotal row.
Index of the top row in the group.
Index of the bottom row in the group.
Calculated aggregate value for the group.
CellStyle to be applied to the new subotal row.
Initializes a new instance of a SubtotalEventArgs object.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal function As AggregateEnum, _
ByVal level As Integer, _
ByVal groupFrom As Integer, _
ByVal groupTo As Integer, _
ByVal totalOn As Integer, _
ByVal caption As String, _
ByVal newRowIndex As Integer, _
ByVal isNewRow As Boolean, _
ByVal top As Integer, _
ByVal bottom As Integer, _
ByVal aggregateValue As Object, _
ByVal style As CellStyle _
)
C#
public SubtotalEventArgs(
AggregateEnum function,
int level,
int groupFrom,
int groupTo,
int totalOn,

890

string caption,
int newRowIndex,
bool isNewRow,
int top,
int bottom,
object aggregateValue,
CellStyle style
)

Parameters
function
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 being aggregated.
caption
Text to insert in the new subtotal row.
newRowIndex
Index of the new subtotal row.
isNewRow
Whether the subtotal row is a new row or the subtotal is being added to an existing
subtotal row.
top
Index of the top row in the group.

891

bottom
Index of the bottom row in the group.
aggregateValue
Calculated aggregate value for the group.
style
CellStyle to be applied to the new subotal row.

Requirements
Target Platforms: Windows 7,
Windows Vista SP1 or later,
Windows XP SP3, Windows Server
2008 (Server Core not supported),
Windows Server 2008 R2 (Server
Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

Fields
For a list of all members of this type, see SubtotalEventArgs members.

Public Fields
Name

Description

AggregateValue

Gets or sets the calculated aggregate value for the group.

Bottom

Gets the index of the bottom row in the group.

Cancel

Whether to cancel the creation of the new subtotal row.

892

Caption

Gets or sets the text to insert in the new subtotal row.

Function

Gets the AggregateEnum value that specifies the type of aggregate to


calculate..

GroupFrom

Gets the index of the first column in the range used to detect group breaks.

GroupTo

Gets the index of the last column in the range used to detect group breaks.

IsNewRow

Gets a value that determines whether the subtotal row is a new row or the
subtotal is being added to an existing subtotal row.

Level

Outline level to assign to the new subtotal rows.

NewRowIndex

Gets the index of the new subtotal row.

Style

Gets or sets the CellStyle to be applied to the new subotal row.

Top

Gets the index of the top row in the group.

TotalOn

Gets the index of the column that contains values being aggregated.

Top

See Also
Reference
SubtotalEventArgs Class
C1.Win.C1FlexGrid Namespace

AggregateValue Field
Gets or sets the calculated aggregate value for the group.

Syntax
Visual Basic (Declaration)
Public AggregateValue As Object

893

C#
public object AggregateValue

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

Bottom Field
Gets the index of the bottom row in the group.

Syntax
Visual Basic (Declaration)
Public ReadOnly Bottom As Integer
C#
public readonly int Bottom

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

Cancel Field
Whether to cancel the creation of the new subtotal row.

894

Syntax
Visual Basic (Declaration)
Public Cancel As Boolean
C#
public bool Cancel

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

Caption Field
Gets or sets the text to insert in the new subtotal row.

Syntax
Visual Basic (Declaration)
Public Caption As String
C#
public string Caption

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

895

Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

Function Field
Gets the AggregateEnum value that specifies the type of aggregate to calculate..

Syntax
Visual Basic (Declaration)
Public ReadOnly Function As AggregateEnum
C#
public readonly AggregateEnum Function

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

GroupFrom Field
Gets the index of the first column in the range used to detect group breaks.

Syntax
Visual Basic (Declaration)
Public ReadOnly GroupFrom As Integer
C#
public readonly int GroupFrom

Requirements
896

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

GroupTo Field
Gets the index of the last column in the range used to detect group breaks.

Syntax
Visual Basic (Declaration)
Public ReadOnly GroupTo As Integer
C#
public readonly int GroupTo

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

IsNewRow Field
Gets a value that determines whether the subtotal row is a new row or the subtotal is being added
to an existing subtotal row.

Syntax

897

Visual Basic (Declaration)


Public ReadOnly IsNewRow As Boolean
C#
public readonly bool IsNewRow

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

Level Field
Outline level to assign to the new subtotal rows.

Syntax
Visual Basic (Declaration)
Public ReadOnly Level As Integer
C#
public readonly int Level

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

898

SubtotalEventArgs Class
SubtotalEventArgs Members

NewRowIndex Field
Gets the index of the new subtotal row.

Syntax
Visual Basic (Declaration)
Public ReadOnly NewRowIndex As Integer
C#
public readonly int NewRowIndex

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

Style Field
Gets or sets the CellStyle to be applied to the new subotal row.

Syntax
Visual Basic (Declaration)
Public Style As CellStyle
C#
public CellStyle Style

Requirements

899

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

Top Field
Gets the index of the top row in the group.

Syntax
Visual Basic (Declaration)
Public ReadOnly Top As Integer
C#
public readonly int Top

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

TotalOn Field
Gets the index of the column that contains values being aggregated.

Syntax
Visual Basic (Declaration)

900

Public ReadOnly TotalOn As Integer


C#
public readonly int TotalOn

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
SubtotalEventArgs Class
SubtotalEventArgs Members

ToolTipEventArgs
Provides data for the C1FlexGridBase.ShowScrollTip event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ToolTipEventArgs
Inherits RowColEventArgs
C#
public class ToolTipEventArgs : RowColEventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.RowColEventArgs
C1.Win.C1FlexGrid.ToolTipEventArgs

901

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ToolTipEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.ShowScrollTip event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ToolTipEventArgs
Inherits RowColEventArgs
C#
public class ToolTipEventArgs : RowColEventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.RowColEventArgs
C1.Win.C1FlexGrid.ToolTipEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

902

See Also
Reference
ToolTipEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by ToolTipEventArgs.

Public Constructors
Name

Description

ToolTipEventArgs Constructor Initializes a new instance of the ToolTipEventArgs class.


Top

Public Fields
Name

Description

Cancel

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


(Inherited from C1.Win.C1FlexGrid.RowColEventArgs)

Col

Gets the index of the column that caused the event. (Inherited from
C1.Win.C1FlexGrid.RowColEventArgs)

Row

Gets the index of the row that caused the event. (Inherited from
C1.Win.C1FlexGrid.RowColEventArgs)

ToolTipText

Gets or sets the text to be displayed in the tooltip.

Top

See Also
Reference

903

ToolTipEventArgs Class
C1.Win.C1FlexGrid Namespace

ToolTipEventArgs Constructor
Index of the row that caused the event.
Index of the column that caused the event.
Text to display in the ToolTip
Initializes a new instance of the ToolTipEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal row As Integer, _
ByVal col As Integer, _
ByVal toolTipText As String _
)
C#
public ToolTipEventArgs(
int row,
int col,
string toolTipText
)

Parameters
row
Index of the row that caused the event.
col
Index of the column that caused the event.
toolTipText
Text to display in the ToolTip

Requirements

904

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,


Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
ToolTipEventArgs Class
ToolTipEventArgs Members

Fields
For a list of all members of this type, see ToolTipEventArgs members.

Public Fields
Name

Description

Cancel

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


(Inherited from C1.Win.C1FlexGrid.RowColEventArgs)

Col

Gets the index of the column that caused the event. (Inherited from
C1.Win.C1FlexGrid.RowColEventArgs)

Row

Gets the index of the row that caused the event. (Inherited from
C1.Win.C1FlexGrid.RowColEventArgs)

ToolTipText

Gets or sets the text to be displayed in the tooltip.

Top

See Also
Reference
ToolTipEventArgs Class
C1.Win.C1FlexGrid Namespace

ToolTipText Field
Gets or sets the text to be displayed in the tooltip.

Syntax
905

Visual Basic (Declaration)


Public ToolTipText As String
C#
public string ToolTipText

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ToolTipEventArgs Class
ToolTipEventArgs Members

UnboundValueEventArgs
Provides data for the C1FlexGridBase.GetUnboundValue and C1FlexGridBase.SetUnboundValue
events.

Object Model

Syntax
Visual Basic (Declaration)
Public Class UnboundValueEventArgs
Inherits System.EventArgs
C#
public class UnboundValueEventArgs : System.EventArgs

Inheritance Hierarchy

906

System.Object
System.EventArgs
C1.Win.C1FlexGrid.UnboundValueEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
UnboundValueEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.GetUnboundValue and C1FlexGridBase.SetUnboundValue
events.

Object Model

Syntax
Visual Basic (Declaration)
Public Class UnboundValueEventArgs
Inherits System.EventArgs
C#
public class UnboundValueEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.UnboundValueEventArgs

Requirements
907

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
UnboundValueEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by UnboundValueEventArgs.

Public Constructors
Name

Description

UnboundValueEventArgs Constructor Initializes a new instance of the UnboundValueEventArgs


class.
Top

Public Fields
Name

Description

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.

Top

See Also
Reference

908

UnboundValueEventArgs Class
C1.Win.C1FlexGrid Namespace

UnboundValueEventArgs Constructor
Row index for the cell that has an unbound value.
Column index for the cell that has an unbound value.
Unbound value that should be displayed in the cell.
Initializes a new instance of the UnboundValueEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal row As Integer, _
ByVal col As Integer, _
ByVal value As Object _
)
C#
public UnboundValueEventArgs(
int row,
int col,
object value
)

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.

Requirements

909

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,


Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
UnboundValueEventArgs Class
UnboundValueEventArgs Members

Fields
For a list of all members of this type, see UnboundValueEventArgs members.

Public Fields
Name

Description

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.

Top

See Also
Reference
UnboundValueEventArgs Class
C1.Win.C1FlexGrid Namespace

Col Field
Gets the column index for the cell that has an unbound value.

Syntax
Visual Basic (Declaration)
Public ReadOnly Col As Integer

910

C#
public readonly int Col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
UnboundValueEventArgs Class
UnboundValueEventArgs Members

Row Field
Gets the row index for the cell that has an unbound value.

Syntax
Visual Basic (Declaration)
Public ReadOnly Row As Integer
C#
public readonly int Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
UnboundValueEventArgs Class
UnboundValueEventArgs Members

Value Field
Gets or sets the unbound value that should be displayed in the cell.

911

Syntax
Visual Basic (Declaration)
Public Value As Object
C#
public object Value

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
UnboundValueEventArgs Class
UnboundValueEventArgs Members

ValidateEditEventArgs
Provides data for the C1FlexGridBase.ValidateEdit event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ValidateEditEventArgs
Inherits System.EventArgs
C#
public class ValidateEditEventArgs : System.EventArgs

Inheritance Hierarchy

912

System.Object
System.EventArgs
C1.Win.C1FlexGrid.ValidateEditEventArgs

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValidateEditEventArgs Members
C1.Win.C1FlexGrid Namespace

Overview
Provides data for the C1FlexGridBase.ValidateEdit event.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ValidateEditEventArgs
Inherits System.EventArgs
C#
public class ValidateEditEventArgs : System.EventArgs

Inheritance Hierarchy
System.Object
System.EventArgs
C1.Win.C1FlexGrid.ValidateEditEventArgs

Requirements

913

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValidateEditEventArgs Members
C1.Win.C1FlexGrid Namespace

Members
Fields

The following tables list the members exposed by ValidateEditEventArgs.

Public Constructors
Name

Description

ValidateEditEventArgs Constructor Initializes a new instance of the ValidateEditEventArgs


class.
Top

Public Fields
Name

Description

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.

Top

914

See Also
Reference
ValidateEditEventArgs Class
C1.Win.C1FlexGrid Namespace

ValidateEditEventArgs Constructor
The row index of the cell being edited.
The column index of the cell being edited.
The new checkbox state about to be applied to the cell, if any.
Initializes a new instance of the ValidateEditEventArgs class.

Syntax
Visual Basic (Declaration)
Public Function New( _
ByVal row As Integer, _
ByVal col As Integer, _
ByVal check As CheckEnum _
)
C#
public ValidateEditEventArgs(
int row,
int col,
CheckEnum check
)

Parameters
row
The row index of the cell being edited.
col
The column index of the cell being edited.
check

915

The new checkbox state about to be applied to the cell, if any.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
ValidateEditEventArgs Class
ValidateEditEventArgs Members

Fields
For a list of all members of this type, see ValidateEditEventArgs members.

Public Fields
Name

Description

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.

Top

See Also
Reference
ValidateEditEventArgs Class
C1.Win.C1FlexGrid Namespace

916

Cancel Field
Gets or sets a value indicating whether the edit operation should be canceled.

Syntax
Visual Basic (Declaration)
Public Cancel As Boolean
C#
public bool Cancel

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValidateEditEventArgs Class
ValidateEditEventArgs Members

Checkbox Field
If the cell contains a checkbox, the new checkbox state about to be applied to the cell.

Syntax
Visual Basic (Declaration)
Public ReadOnly Checkbox As CheckEnum
C#
public readonly CheckEnum Checkbox

917

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValidateEditEventArgs Class
ValidateEditEventArgs Members

Col Field
Gets the column index of the cell being edited.

Syntax
Visual Basic (Declaration)
Public ReadOnly Col As Integer
C#
public readonly int Col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValidateEditEventArgs Class
ValidateEditEventArgs Members

Row Field
Gets the row index of the cell being edited.

Syntax

918

Visual Basic (Declaration)


Public ReadOnly Row As Integer
C#
public readonly int Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValidateEditEventArgs Class
ValidateEditEventArgs Members

ValueFilter
Represents a filter based on a set of values.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ValueFilter
Implements IC1ColumnFilter
C#
public class ValueFilter : IC1ColumnFilter

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.ValueFilter

919

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValueFilter Members
C1.Win.C1FlexGrid Namespace

Overview
Represents a filter based on a set of values.

Object Model

Syntax
Visual Basic (Declaration)
Public Class ValueFilter
Implements IC1ColumnFilter
C#
public class ValueFilter : IC1ColumnFilter

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.ValueFilter

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
920

Reference
ValueFilter Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by ValueFilter.

Public Constructors
Name

Description

ValueFilter Constructor
Top

Public Properties
Name

Description

IsActive

Gets or sets a value that determines whether the filter is active.

ShowValues

Gets or sets an array with the values that should be included in the output.

Top

Public Methods
Name

Description

Apply

Applies the filter to a value.

GetEditor

Gets the editor used to modify the filter at run time.

Reset

Resets the filter making it inactive.

Top

See Also
921

Reference
ValueFilter Class
C1.Win.C1FlexGrid Namespace

ValueFilter Constructor

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public ValueFilter()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValueFilter Class
ValueFilter Members

Methods
For a list of all members of this type, see ValueFilter members.

Public Methods
Name

Description

Apply

Applies the filter to a value.

GetEditor

Gets the editor used to modify the filter at run time.

Reset

Resets the filter making it inactive.

Top

922

See Also
Reference
ValueFilter Class
C1.Win.C1FlexGrid Namespace

Apply Method
Value to be filtered.
Applies the filter to a value.

Syntax
Visual Basic (Declaration)
Public Function Apply( _
ByVal value As Object _
) As Boolean
C#
public bool Apply(
object value
)

Parameters
value
Value to be filtered.

Return Value
True if the value satisfies the filter; False otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

923

ValueFilter Class
ValueFilter Members

GetEditor Method
Gets the editor used to modify the filter at run time.

Syntax
Visual Basic (Declaration)
Public Function GetEditor() As IC1ColumnFilterEditor
C#
public IC1ColumnFilterEditor GetEditor()

Return Value
A IC1ColumnFilterEditor that is used to edit the filter at run time.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValueFilter Class
ValueFilter Members

Reset Method
Resets the filter making it inactive.

Syntax
Visual Basic (Declaration)
Public Sub Reset()
C#

924

public void Reset()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValueFilter Class
ValueFilter Members

Properties
For a list of all members of this type, see ValueFilter members.

Public Properties
Name

Description

IsActive

Gets or sets a value that determines whether the filter is active.

ShowValues

Gets or sets an array with the values that should be included in the output.

Top

See Also
Reference
ValueFilter Class
C1.Win.C1FlexGrid Namespace

IsActive Property
Gets or sets a value that determines whether the filter is active.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property IsActive As Boolean

925

C#
public bool IsActive {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
ValueFilter Class
ValueFilter Members

ShowValues Property
Gets or sets an array with the values that should be included in the output.

Syntax
Visual Basic (Declaration)
Public Property ShowValues As Object()
C#
public object[] ShowValues {get; set;}

Remarks
Setting this property to null causes the filter to include all values in the output.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

926

ValueFilter Class
ValueFilter Members

Enumerations
AggregateEnum
Specifies the type of aggregate function to calculate with the C1FlexGridBase.Aggregate and
C1FlexGridBase.Subtotal methods.

Syntax
Visual Basic (Declaration)
Public Enum AggregateEnum
Inherits System.Enum
C#
public enum AggregateEnum : System.Enum

Members
Member

Description

Average

Returns the average value of the non-empty cells in a range.

Clear

Clear existing aggregates. This setting is used with the


C1FlexGridBase.Subtotal 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 C1FlexGridBase.Subtotal method


to create an outline tree without any numerical aggregates.

927

Percent

Percent of grand total. This setting is used with the C1FlexGridBase.Subtotal


method to calculate the percentage of the grand total represented by each sub
group. (This setting can't be used with the C1FlexGridBase.Aggregate
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).

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AggregateEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

928

AggregateFlags
Specifies options to use when calculating aggregates with the C1FlexGridBase.Aggregate method.

Syntax
Visual Basic (Declaration)
Public Enum AggregateFlags
Inherits System.Enum
C#
public enum AggregateFlags : System.Enum

Members
Member

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 check boxes 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.

ExcludeCollapsedCells Exclude collapsed rows from the aggregate.


ExcludeHiddenCells

Exclude hidden rows and columns from the aggregate.

ExcludeHiddenRows

Exclude hidden rows from the aggregate.

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.

Inheritance Hierarchy
929

System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AggregateFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

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

Syntax
Visual Basic (Declaration)
Public Enum AllowDraggingEnum
Inherits System.Enum
C#
public enum AllowDraggingEnum : System.Enum

Members
Member

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.

930

Rows

The user may drag rows with the mouse.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AllowDraggingEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

AllowFiltering
Specifies the type of filter to be used for a Column.

Syntax
Visual Basic (Declaration)
Public Enum AllowFiltering
Inherits System.Enum
C#
public enum AllowFiltering : System.Enum

Members
Member

Description

ByCondition

Filter column by conditions using a ConditionFilter.

931

ByValue

Filter column by values using a ValueFilter.

Custom

Filter column using a filter specified by the caller.

Default

Filter column using a ColumnFilter.

None

Do not provide a filter for this column.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AllowFiltering

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

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

Syntax
Visual Basic (Declaration)
Public Enum AllowFreezingEnum
Inherits System.Enum
C#
public enum AllowFreezingEnum : System.Enum

Members
932

Member

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AllowFreezingEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

AllowMergingEnum
Specifies how adjacent cells are merged for display.

Syntax
Visual Basic (Declaration)
Public Enum AllowMergingEnum

933

Inherits System.Enum
C#
public enum AllowMergingEnum : System.Enum

Members
Member

Description

Custom

Use C1FlexGrid.MergedRanges collection to determine which cells are merged.

Default

Use the setting specified for the C1FlexGrid.AllowMerging property.

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AllowMergingEnum

Requirements
934

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

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

Syntax
Visual Basic (Declaration)
Public Enum AllowResizingEnum
Inherits System.Enum
C#
public enum AllowResizingEnum : System.Enum

Members
Member

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.

935

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AllowResizingEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

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

Syntax
Visual Basic (Declaration)
Public Enum AllowSortingEnum
Inherits System.Enum
C#
public enum AllowSortingEnum : System.Enum

936

Members
Member

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AllowSortingEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

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

Syntax
Visual Basic (Declaration)
Public Enum AutoSearchEnum
Inherits System.Enum

937

C#
public enum AutoSearchEnum : System.Enum

Members
Member

Description

FromCursor

Search from the current row.

FromTop

Search from the first scrollable row.

None

No auto-searching.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AutoSearchEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

AutoSizeFlags
Specifies options that control auto-sizing.

Syntax
Visual Basic (Declaration)
Public Enum AutoSizeFlags

938

Inherits System.Enum
C#
public enum AutoSizeFlags : System.Enum

Members
Member

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.AutoSizeFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

BorderDirEnum
Specifies the direction of cell borders.

Syntax

939

Visual Basic (Declaration)


Public Enum BorderDirEnum
Inherits System.Enum
C#
public enum BorderDirEnum : System.Enum

Members
Member

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.BorderDirEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

BorderStyleEnum
Specifies the type of cell border to display.

Syntax
940

Visual Basic (Declaration)


Public Enum BorderStyleEnum
Inherits System.Enum
C#
public enum BorderStyleEnum : System.Enum

Members
Member

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.BorderStyleEnum

Requirements

941

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

C1FlexGridRenderer.CellType
Represents the type of cell being rendered.

Syntax
Visual Basic (Declaration)
Public Enum C1FlexGridRenderer.CellType
Inherits System.Enum
C#
public enum C1FlexGridRenderer.CellType : System.Enum

Members
Member

Description

ColumnHeader

A column header cell.

ColumnHeaderHot

A column header cell currently under the mouse.

ColumnHeaderSelected

A selected column header cell.

ColumnHeaderSelectedHot A selected column header cell currently under the mouse.


Cursor

The cell that contains the cursor.

Highlight

A selected normal cell.

942

Normal

A normal scrollable cell.

RowHeader

A row header cell.

RowHeaderHot

A row header cell currently under the mouse.

RowHeaderSelected

A selected row header cell.

RowHeaderSelectedHot

A selected row header cell currently under the mouse.

TopLeft

The top left fixed cell.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.C1FlexGridRenderer.CellType

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

CellStyleEnum
Example Example

Enumeration used to retrieve CellStyle objects from the C1FlexGridBase.Styles collection.

Syntax
Visual Basic (Declaration)
Public Enum CellStyleEnum

943

Inherits System.Enum
C#
public enum CellStyleEnum : System.Enum

Members
Member

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.

FilterEditor

Style used to paint the filter editors.

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


C1FlexGridBase.Subtotal 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
C1FlexGridBase.AllowAddNew property is set to true.

Normal

Style used to render scrollable normal cells.

944

Search

Style used to render cells that are being selected as the user types (see
the C1FlexGridBase.AutoSearch property).

SelectedColumnHeader Style used to render selected column headers.


SelectedRowHeader

Style used to render selected row headers.

Subtotal0

Style automatically assigned to level-0 nodes created with the


C1FlexGridBase.Subtotal method.

Subtotal1

Style automatically assigned to level-1 nodes created with the


C1FlexGridBase.Subtotal method.

Subtotal2

Style automatically assigned to level-2 nodes created with the


C1FlexGridBase.Subtotal method.

Subtotal3

Style automatically assigned to level-3 nodes created with the


C1FlexGridBase.Subtotal method.

Subtotal4

Style automatically assigned to level-4 nodes created with the


C1FlexGridBase.Subtotal method.

Subtotal5

Style automatically assigned to level-5 nodes created with the


C1FlexGridBase.Subtotal method.

Remarks
Cell styles can be retrieved from the C1FlexGridBase.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:

C#

// s1, s2, and s3 are all references to the grid's Normal style:
CellStyle s1 = _flex.Styles[CellStyleEnum.Normal];
CellStyle s2 = _flex.Styles["Normal"];

945

CellStyle s3 = _flex.Styles.Normal;

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum

C1.Win.C1FlexGrid.CellStyleEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

CheckEnum
Specifies the type of checkbox to draw in a cell.

Syntax
Visual Basic (Declaration)
Public Enum CheckEnum
Inherits System.Enum
C#
public enum CheckEnum : System.Enum

Members
Member

Description

Checked

Check box with a check mark in it.

Grayed

Check box in undefined state.

946

None

No check box.

TSChecked

Tri-state check box with a check mark in it.

TSGrayed

Tri-state check box in undefined state.

TSUnchecked

Tri-state empty check box.

Unchecked

Empty check box.

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.CheckEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

947

ClearFlags
Specifies which elements of the grid should be cleared by the C1FlexGridBase.Clear method.

Syntax
Visual Basic (Declaration)
Public Enum ClearFlags
Inherits System.Enum
C#
public enum ClearFlags : System.Enum

Members
Member

Description

All

All of the above.

Content

Clear cell content, including data, images, and check boxes if any.

Style

Clear custom styles assigned to cells.

UserData

Clear user data associated with cells.

Remarks
This enumeration contains flags that can be combined to customize the sorting process.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.ClearFlags

Requirements

948

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

ClipboardCopyModeEnum
Specifies what parts of the grid should be copied to the clipboard when the
C1FlexGridBase.AutoClipboard property is set to true.

Syntax
Visual Basic (Declaration)
Public Enum ClipboardCopyModeEnum
Inherits System.Enum
C#
public enum ClipboardCopyModeEnum : System.Enum

Members
Member

Description

DataAndAllHeaders

Copy the selected data and include row and column headers.

DataAndColumnHeaders Copy the selected data and include the column headers.
DataAndRowHeaders

Copy the selected data and include the row headers.

DataOnly

Only the selected data is copied.

Disabled

Do not copy any data to the clipboard.

Inheritance Hierarchy

949

System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.ClipboardCopyModeEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

ConditionOperator
Represents operators used in filter conditions.

Syntax
Visual Basic (Declaration)
Public Enum ConditionOperator
Inherits System.Enum
C#
public enum ConditionOperator : System.Enum

Members
Member

Description

BeginsWith

Return true if the string representation of the value begins with the
operator parameter.

Contains

Return true if the string representation of the value contains the operator
parameter.

950

DoesNotContain

Return true if the string representation of the value does not contain the
operator parameter.

EndsWith

Return true if the string representation of the value ends with the
operator parameter.

Equals

Return true if the value equals the operator parameter.

GreaterThan

Return true if the value is greater than the operator parameter.

GreaterThanOrEqualTo Return true if the value is greater than or equal to the operator
parameter.
LessThan

Return true if the value is less than the operator parameter.

LessThanOrEqualTo

Return true if the value is less than or equal to the operator parameter.

None

Disables the operator.

NotEquals

Return true if the value does not equal the operator parameter.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.ConditionOperator

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

951

DisplayEnum
Specifies whether a style should display the cell text, image, both, or none.

Syntax
Visual Basic (Declaration)
Public Enum DisplayEnum
Inherits System.Enum
C#
public enum DisplayEnum : System.Enum

Members
Member

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).

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.DisplayEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

952

See Also
Reference
C1.Win.C1FlexGrid Namespace

DragModeEnum
Specifies the behavior of the control as an OLE drag-drop source.

Syntax
Visual Basic (Declaration)
Public Enum DragModeEnum
Inherits System.Enum
C#
public enum DragModeEnum : System.Enum

Members
Member

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).

AutomaticCo Same as Automatic, except the data is always copied (never moved).
py
AutomaticM Same as Automatic, except the data is always moved (never copied).
ove
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.

Inheritance Hierarchy
953

System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.DragModeEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

DrawCellFlags
Specifies which elements of the cell should be drawn by the grid.

Syntax
Visual Basic (Declaration)
Public Enum DrawCellFlags
Inherits System.Enum
C#
public enum DrawCellFlags : System.Enum

Members
Member

Description

All

Draw all cell elements (background, border, and contents).

Background

Draw the cell background.

Border

Draw the cell border.

954

Content

Draw the cell content (text, images, check boxes, etc).

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 C1FlexGridBase.OwnerDrawCell event to allow custom cell drawing.
The OwnerDrawCellEventArgs parameter passed to the event handler has a
OwnerDrawCellEventArgs.DrawCell 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 C1FlexGridBase.OwnerDrawCell event for an example.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.DrawCellFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

DrawModeEnum
Specifies whether cells should be drawn entirely by the grid or with help from custom drawing
code.

Syntax
Visual Basic (Declaration)

955

Public Enum DrawModeEnum


Inherits System.Enum
C#
public enum DrawModeEnum : System.Enum

Members
Member

Description

Normal

Grid cells are drawn by the grid.

OwnerDraw

The grid fires the C1FlexGridBase.OwnerDrawCell event to allow custom cell


drawing.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.DrawModeEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

DropModeEnum
Specifies the behavior of the control as an OLE drag-drop target.

Syntax
Visual Basic (Declaration)

956

Public Enum DropModeEnum


Inherits System.Enum
C#
public enum DropModeEnum : System.Enum

Members
Member

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 can't be used as a drop target.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.DropModeEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

EditFlags
Specifies options that customize the grid's editing behavior.

Syntax

957

Visual Basic (Declaration)


Public Enum EditFlags
Inherits System.Enum
C#
public enum EditFlags : System.Enum

Members
Member

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.
DelayedCommit

Commit changes to data source only when changing rows or moving focus.

EditOnRequest

Enter edit mode only in response to mouse or keyboard events. Setting this
flag to false causes the grid to enter edit mode when the control gets the
focus or when the user moves the cursor.

ExitOnLeftRightKeys Exit editor if user presses the right arrow key at the end of the content or
the left arrow key at the start of the content.
MultiCheck

Check and uncheck all check boxes in a selection simultaneously.

None

No special behavior.

UseNumericEditor

Use built-in numeric editor when editing numeric types.

Inheritance Hierarchy
System.Object
System.ValueType

958

System.Enum
C1.Win.C1FlexGrid.EditFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

FileFlags
Specifies options for use with the C1FlexGridBase.SaveGrid and C1FlexGridBase.LoadGrid
methods.

Syntax
Visual Basic (Declaration)
Public Enum FileFlags
Inherits System.Enum
C#
public enum FileFlags : System.Enum

Members
Member

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.

IncludeMergedRanges Save and load merged ranges when exporting to or importing from Excel

959

with the C1FlexGridBase.SaveExcel and C1FlexGridBase.LoadExcel


methods.
LoadMergedRanges

Load merged ranges when importing from Excel with the


C1FlexGridBase.LoadExcel method. This flag has no effect when loading
text files, it only affects Excel input.

NoFreezing

Do not freeze rows and columns when exporting to or importing from


Excel with the C1FlexGridBase.SaveExcel and C1FlexGridBase.LoadExcel
methods.

None

Use default settings.

OpenXml

Load or save file in OpenXml (Office 2007) format.

SaveMergedRanges

Save merged ranges when exporting to Excel with the


C1FlexGridBase.SaveExcel method. This flag has no effect when saving
text files, it only affects Excel output.

SelectedRowsOnly

Save only selected rows.

VisibleOnly

Save only visible rows and columns.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.FileFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

960

Reference
C1.Win.C1FlexGrid Namespace

FileFormatEnum
Specifies the type of file to save or load with the C1FlexGridBase.SaveGrid and
C1FlexGridBase.LoadGrid methods.

Syntax
Visual Basic (Declaration)
Public Enum FileFormatEnum
Inherits System.Enum
C#
public enum FileFormatEnum : System.Enum

Members
Member

Description

Excel

Microsoft Excel files (Xls/biff-8 or OpenXml formats).

TextComma

Text file, cells separated with commas.

TextCustom

Text file, cells separated with the character specified by the


C1FlexGridBase.ClipSeparators property.

TextTab

Text file, cells separated with tabs.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.FileFormatEnum

Requirements

961

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

FocusRectEnum
Specifies the appearance of the focus rectangle.

Syntax
Visual Basic (Declaration)
Public Enum FocusRectEnum
Inherits System.Enum
C#
public enum FocusRectEnum : System.Enum

Members
Member

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
BackColor property of the CellStyleCollection.Highlight style.

962

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.FocusRectEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

GlyphEnum
Specifies a type of glyph (image) used by the grid to convey information about a row, column, or
cell.

Syntax
Visual Basic (Declaration)
Public Enum GlyphEnum
Inherits System.Enum
C#
public enum GlyphEnum : System.Enum

Members
Member

Description

Ascending

Indicates column sorted in ascending order (default is hollow triangle pointing


up).

963

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).

FilteredColumn

Indicates that a column has a filter currently active.

FilterEditor

Indicates that a column has a drop-down filter editor.

Grayed

Checkbox in gray (undefined) state.

Unchecked

Checkbox in unchecked state.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.GlyphEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

964

Reference
C1.Win.C1FlexGrid Namespace

GridChangedTypeEnum
Specifies the type of change that occurred when the controls fires the
C1FlexGridBase.GridChanged event.

Syntax
Visual Basic (Declaration)
Public Enum GridChangedTypeEnum
Inherits System.Enum
C#
public enum GridChangedTypeEnum : System.Enum

Members
Member

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.


CellChanged

The value in a cell has changed.

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.

965

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.

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.GridChangedTypeEnum

966

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

HighLightEnum
Specifies whether the grid should highlight the selected range.

Syntax
Visual Basic (Declaration)
Public Enum HighLightEnum
Inherits System.Enum
C#
public enum HighLightEnum : System.Enum

Members
Member

Description

Always

Always highlight the selected range.

Never

Never highlight the selected range.

WithFocus

Highlight the selected range when the control has focus.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.HighLightEnum

967

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

HitTestTypeEnum
Type of grid element at a specific point on the control.

Syntax
Visual Basic (Declaration)
Public Enum HitTestTypeEnum
Inherits System.Enum
C#
public enum HitTestTypeEnum : System.Enum

Members
Member

Description

Cell

The point is on a grid cell. (The cell coordinates are stored in the
HitTestInfo.Row and HitTestInfo.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.

968

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).

FilterIcon

The point is on the filter icon on a column header cell.

None

The point is in the grid's empty area.

OutlineBar

The point is on the outline bar (visible when the grid's C1FlexGridBase.Tree
property has a GridTree.Style that contains the TreeStyleFlags.ButtonBar flag).

OutlineTree

The point is on the collapse/expand button on an outline tree (visible when the
grid's GridTree.Style 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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.HitTestTypeEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

969

ImageAlignEnum
Specifies how images are aligns in grid cells.

Syntax
Visual Basic (Declaration)
Public Enum ImageAlignEnum
Inherits System.Enum
C#
public enum ImageAlignEnum : System.Enum

Members
Member

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.

970

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.

TileStretch

Image is split into a grid, corner parts are copied and center is stretched to
cover the cell.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.ImageAlignEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

KeyActionEnum
Specifies the action to perform when the ENTER and TAB keys are pressed.

971

Syntax
Visual Basic (Declaration)
Public Enum KeyActionEnum
Inherits System.Enum
C#
public enum KeyActionEnum : System.Enum

Members
Member

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, but move the focus to the next control in the tab order
when the last cell in the grid is reached.
This setting applies only to the C1FlexGridBase.KeyActionTab property; when
used with C1FlexGridBase.KeyActionEnter it behaves like MoveAcross.

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.KeyActionEnum

Requirements

972

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

NodeMoveEnum
Specifies the destination of nodes when they are moved with the Node.Move method.

Syntax
Visual Basic (Declaration)
Public Enum NodeMoveEnum
Inherits System.Enum
C#
public enum NodeMoveEnum : System.Enum

Members
Member

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.

973

Up

Move the node to the position before its previous sibling.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.NodeMoveEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

NodeTypeEnum
Specifies a node with respect to another given node.

Syntax
Visual Basic (Declaration)
Public Enum NodeTypeEnum
Inherits System.Enum
C#
public enum NodeTypeEnum : System.Enum

Members
Member

Description

FirstChild

The node's first child.

974

FirstSibling

The node's first sibling (node with same level and same parent).

FirstVisibleChild

The node's first visible child.

FirstVisibleSibling

The node's first visible sibling.

LastChild

The node's last child.

LastSibling

The node's last sibling.

LastVisibleSibling

The node's last visible sibling.

NextSibling

The node's next sibling.

NextVisibleSibling

The node's next visible sibling.

Parent

The node's immediate parent.

PreviousSibling

The node's previous sibling.

PreviousVisibleSibling The node's previous visible sibling.


Root

The node's top-level parent.

Remarks
This enumeration is used with the Node.GetNode method.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.NodeTypeEnum

Requirements

975

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

PrintGridFlags
Contains flags that specify printing options to use with the C1FlexGridBase.PrintGrid method.

Syntax
Visual Basic (Declaration)
Public Enum PrintGridFlags
Inherits System.Enum
C#
public enum PrintGridFlags : System.Enum

Members
Member

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.

976

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.PrintGridFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

ScrollFlags
Specifies options that customize scrollbar behavior.

Syntax
Visual Basic (Declaration)
Public Enum ScrollFlags
Inherits System.Enum
C#
public enum ScrollFlags : System.Enum

977

Members
Member

Description

AlwaysVisible

Keep scrollbars visible even when they are disabled.

DelayedScroll

Do not scroll the control contents until the user releases the scrollbar thumb.

None

Use the default scrolling behavior.

ScrollByRowColumn Scroll by rows and columns (instead of by pixel).


ShowScrollTips

Fire the C1FlexGridBase.ShowScrollTip event and display a tooltip next to


the vertical scrollbar while scrolling vertically.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.ScrollFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

SelectionModeEnum
Specifies the type of selection provided by the grid.

Syntax
Visual Basic (Declaration)

978

Public Enum SelectionModeEnum


Inherits System.Enum
C#
public enum SelectionModeEnum : System.Enum

Members
Member

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.SelectionModeEnum

Requirements

979

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

ShowButtonsEnum
Specifies when the grid should display combo buttons in cells.

Syntax
Visual Basic (Declaration)
Public Enum ShowButtonsEnum
Inherits System.Enum
C#
public enum ShowButtonsEnum : System.Enum

Members
Member

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.ShowButtonsEnum

Requirements
980

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

ShowSortPositionEnum
Specifies the position of the sort glyphs within the column header cells.

Syntax
Visual Basic (Declaration)
Public Enum ShowSortPositionEnum
Inherits System.Enum
C#
public enum ShowSortPositionEnum : System.Enum

Members
Member

Description

Auto

Show sort glyphs on the top of the column header cells if filtering is enabled,
and on the right otherwise.

None

Do not show sort glyphs.

Right

Show sort glyphs on the right of the column header cells.

Top

Show sort glyphs on the top of the column header cells.

Inheritance Hierarchy
System.Object
System.ValueType

981

System.Enum
C1.Win.C1FlexGrid.ShowSortPositionEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

ShowThemedHeadersEnum
Specifies whether the control should use themes for displaying row or column headers.

Syntax
Visual Basic (Declaration)
Public Enum ShowThemedHeadersEnum
Inherits System.Enum
C#
public enum ShowThemedHeadersEnum : System.Enum

Members
Member

Description

Auto

Use themed headers when the System.Windows.Forms.BorderStyle property is


set to XpThemes.

Both

Use themed headers for row and column headers.

Columns

Use themed headers for column headers.

None

Do not use themed headers.

982

Rows

Use themed headers for row headers.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.ShowThemedHeadersEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

SortFlags
Example Example

Specifies how grid columns should be sorted.

Syntax
Visual Basic (Declaration)
Public Enum SortFlags
Inherits System.Enum
C#
public enum SortFlags : System.Enum

Members
Member

Description

Ascending

Sort in ascending order.

983

AsDisplayed

Sort using the string representation of the data. In this mode, "100" appears
before "2".

Descending

Sort in descending 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 Column.Sort property of individual Column objects.

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#

// 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)

Inheritance Hierarchy
System.Object
System.ValueType

System.Enum
C1.Win.C1FlexGrid.SortFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

984

See Also
Reference
C1.Win.C1FlexGrid Namespace

StyleElementFlags
Contains flags that specify which style elements are defined in a CellStyle object.

Syntax
Visual Basic (Declaration)
Public Enum StyleElementFlags
Inherits System.Enum
C#
public enum StyleElementFlags : System.Enum

Members
Member

Description

All

All style elements.

BackColor

The style defines a background color.

BackgroundImage

The style specifies a background image.

BackgroundImageLayout The style specifies a background image alignment.


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.

985

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.

986

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.

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.StyleElementFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

SubtotalPositionEnum
Specifies whether subtotals rows created with the C1FlexGridBase.Subtotal method should be
inserted above or below the data they refer to.

Syntax
Visual Basic (Declaration)
Public Enum SubtotalPositionEnum
Inherits System.Enum
C#

987

public enum SubtotalPositionEnum : System.Enum

Members
Member

Description

AboveData

Subtotal rows are inserted above the data (tree-style).

BelowData

Subtotal rows are inserted below the data (spreadsheet-style).

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.SubtotalPositionEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

TextAlignEnum
Specifies how text is aligned in a grid cell.

Syntax
Visual Basic (Declaration)
Public Enum TextAlignEnum
Inherits System.Enum
C#
public enum TextAlignEnum : System.Enum

988

Members
Member

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

989

the cell.
RightTop

Text is horizontally aligned to the right and vertically aligned to the top of the
cell.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.TextAlignEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

TextDirectionEnum
Specifies the direction to use when rendering text in a grid cell.

Syntax
Visual Basic (Declaration)
Public Enum TextDirectionEnum
Inherits System.Enum
C#
public enum TextDirectionEnum : System.Enum

Members
Member

Description

990

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.TextDirectionEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

TextEffectEnum
Specifies a 3D effect to use when rendering cell text.

Syntax
Visual Basic (Declaration)
Public Enum TextEffectEnum
Inherits System.Enum
C#
public enum TextEffectEnum : System.Enum

Members

991

Member

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.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.TextEffectEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

TreeStyleFlags
Specifies the appearance of the outline tree.

Syntax
Visual Basic (Declaration)
Public Enum TreeStyleFlags
Inherits System.Enum
C#
public enum TreeStyleFlags : System.Enum

Members
992

Member

Description

ButtonBar

Show outline buttons across the top fixed row.

Complete

Combination of Lines, Symbols, and ButtonBar.

CompleteLeaf

Combination of Lines, Symbols, ButtonBar and 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 Lines and Symbols.

SimpleLeaf

Combination of Lines, Symbols, and Leaf.

Symbols

Show expand/collapse symbols on node rows.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.TreeStyleFlags

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

993

VisualStyle
Specifies a visual style to use when rendering the control.

Syntax
Visual Basic (Declaration)
Public Enum VisualStyle
Inherits System.Enum
C#
public enum VisualStyle : System.Enum

Members
Member

Description

Custom

Do not use any visual styles. Render the control using the styles and properties
only.

Office2007Black

Render the control with an appearance based on the Office 2007 Black color
scheme.

Office2007Blue

Render the control with an appearance based on the Office 2007 Blue color
scheme.

Office2007Silver

Render the control with an appearance based on the Office 2007 Silver color
scheme.

Office2010Black

Render the control with an appearance based on the Office 2010 Black color
scheme.

Office2010Blue

Render the control with an appearance based on the Office 2010 Blue color
scheme.

Office2010Silver

Render the control with an appearance based on the Office 2010 Silver color
scheme.

994

System

Render the control with an appearance based on the current system settings.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.VisualStyle

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid Namespace

Structures
CellRange
Represents cell ranges, allowing the caller to set properties for multiple cells with a single
statement.

Object Model

Syntax
Visual Basic (Declaration)
Public Structure CellRange
Inherits System.ValueType
C#
public struct CellRange : System.ValueType

Remarks
995

The CellRange structure does not have a public constructor. To create a CellRange object, use the
C1FlexGridBase.GetCellRange 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.

Inheritance Hierarchy
System.Object
System.ValueType
C1.Win.C1FlexGrid.CellRange

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Members
C1.Win.C1FlexGrid Namespace

Overview
Represents cell ranges, allowing the caller to set properties for multiple cells with a single
statement.

Object Model

Syntax
Visual Basic (Declaration)
Public Structure CellRange

996

Inherits System.ValueType
C#
public struct CellRange : System.ValueType

Remarks
The CellRange structure does not have a public constructor. To create a CellRange object, use the
C1FlexGridBase.GetCellRange 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.

Inheritance Hierarchy
System.Object
System.ValueType
C1.Win.C1FlexGrid.CellRange

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Members
C1.Win.C1FlexGrid Namespace

Members
Fields Properties Methods

The following tables list the members exposed by CellRange.

Public Fields

997

Name

Description

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.

Top

Public Properties
Name

Description

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 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.

998

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.

Top

Public Methods
Name

Description

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

Gets a string representation for this object.

Top

See Also
Reference
CellRange Structure
C1.Win.C1FlexGrid Namespace

999

Methods
For a list of all members of this type, see CellRange members.

Public Methods
Name

Description

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

Gets a string representation for this object.

Top

See Also
Reference
CellRange Structure
C1.Win.C1FlexGrid Namespace

Clear Method
ClearFlags value that specifies which elements should be cleared.
Clears selected elements from the range.

Syntax
Visual Basic (Declaration)
Public Sub Clear( _
ByVal clearFlags As ClearFlags _

1000

)
C#
public void Clear(
ClearFlags clearFlags
)

Parameters
clearFlags
ClearFlags value that specifies which elements should be cleared.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

Contains Method
Index of the row to check.
Index of the column to check.
Determines whether the range contains a given cell.

Syntax
Visual Basic (Declaration)
Public Function Contains( _
ByVal row As Integer, _
ByVal col As Integer _
) As Boolean
C#

1001

public bool Contains(


int row,
int col
)

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

ContainsCol Method
Index of the column to check.
Determines whether the range contains a given column.

Syntax
Visual Basic (Declaration)
Public Function ContainsCol( _
ByVal col As Integer _
) As Boolean

1002

C#
public bool ContainsCol(
int col
)

Parameters
col
Index of the column to check.

Return Value
True if the range contains the column, False otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

ContainsRow Method
Index of the row to check.
Determines whether the range contains a given row.

Syntax
Visual Basic (Declaration)
Public Function ContainsRow( _
ByVal row As Integer _
) As Boolean
C#
public bool ContainsRow(

1003

int row
)

Parameters
row
Index of the row to check.

Return Value
True if the range contains the row, False otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

Normalize Method
Normalizes the range so that r1 is the TopRow, r2 is the BottomRow, c1 is the LeftCol, and c2 is the
RightCol.

Syntax
Visual Basic (Declaration)
Public Sub Normalize()
C#
public void Normalize()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1004

See Also
Reference
CellRange Structure
CellRange Members

ToString Method
Gets a string representation for this object.

Syntax
Visual Basic (Declaration)
Public Overrides Function ToString() As String
C#
public override string ToString()

Return Value
A string representation for this object.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

Properties
For a list of all members of this type, see CellRange members.

Public Properties
Name

Description

1005

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 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.

Top

See Also
Reference

1006

CellRange Structure
C1.Win.C1FlexGrid Namespace

BottomRow Property
Gets the index of the bottom row in the range.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property BottomRow As Integer
C#
public int BottomRow {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

Checkbox Property
Gets or sets the state of the checkbox in the range.

Syntax
Visual Basic (Declaration)
Public Property Checkbox As CheckEnum
C#
public CheckEnum Checkbox {get; set;}

Remarks

1007

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

Clip Property
Gets or sets a string containing the values of all cells in the range.

Syntax
Visual Basic (Declaration)
Public Property Clip As String
C#
public string Clip {get; set;}

Remarks
The cell values are delimited by characters specified by the C1FlexGridBase.ClipSeparators
property.
By default, columns are separated by tabs (\t or vbTab) and rows by line breaks (\n or vbCr).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

1008

Reference
CellRange Structure
CellRange Members

Data Property
Gets or sets the data stored in the range.

Syntax
Visual Basic (Declaration)
Public Property Data As Object
C#
public object Data {get; set;}

Remarks
When getting, this property returns the value in the first cell of the range (r1, c1). When setting, it
stores the given value in every cell within the range.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

DataDisplay Property
Gets the value in cell (r1, c1), formatted as a string.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property DataDisplay As String

1009

C#
public string DataDisplay {get;}

Remarks
This property is similar to the Clip property, except Clip returns a tab-delimited string containing
data in the entire range, and DataDisplay returns the contents of the first cell only (r1, c1).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

Image Property
Gets or sets the Image assigned to cells in the range.

Syntax
Visual Basic (Declaration)
Public Property Image As Image
C#
public Image Image {get; set;}

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.

Requirements

1010

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

IsSingleCell Property
Gets a value that indicates if the range contains a single cell.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property IsSingleCell As Boolean
C#
public bool IsSingleCell {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

IsValid Property
Gets a value that indicates if the range contains valid row and column indices.

Syntax
Visual Basic (Declaration)

1011

Public ReadOnly Property IsValid As Boolean


C#
public bool IsValid {get;}

Remarks
This property returns true if the range coordinates are valid. The range is valid if both r1 and r2 are
between 0 Rows.Count-1, both c1 and c2 are between 0 and Cols.Count-1.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

LeftCol Property
Gets the index of the left column in the range.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property LeftCol As Integer
C#
public int LeftCol {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
1012

Reference
CellRange Structure
CellRange Members

RightCol Property
Gets the index of the right column in the range.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property RightCol As Integer
C#
public int RightCol {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

Style Property
Example

Gets or sets the style used to display every cell in the range.

Syntax
Visual Basic (Declaration)
Public Property Style As CellStyle
C#
public CellStyle Style {get; set;}

1013

Remarks
Getting or setting the range style ensures that every cell in the range has the same style. If the
range does not contain any cells with custom styles, this property returns null.

Example
The code below creates a CellRange structure and uses it to apply a custom style to the entire
range.

C#

// 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;

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

StyleDisplay Property
Gets the style used to render cell (r1, c1).

Syntax
Visual Basic (Declaration)
Public ReadOnly Property StyleDisplay As CellStyle
C#
public CellStyle StyleDisplay {get;}

1014

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

StyleNew Property
Example

Gets or sets the style used to display every cell in the range, creating a new style if necessary.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property StyleNew As CellStyle
C#
public CellStyle StyleNew {get;}

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.

C#

1015

// create a cell range


CellRange rg = _flex.GetCellRange(1, 1, 5, 5);
// make sure range is red
rg.StyleNew.BackColor = Color.Red;

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

TopRow Property
Gets the index of the top row in the range.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property TopRow As Integer
C#
public int TopRow {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

1016

UserData Property
Gets or sets arbitrary used data assigned to cells in the range.

Syntax
Visual Basic (Declaration)
Public Property UserData As Object
C#
public object UserData {get; set;}

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

Fields
For a list of all members of this type, see CellRange members.

Public Fields
Name

Description

c1

Gets or sets the range's first column index.

c2

Gets or sets the range's last column index.

1017

r1

Gets or sets the range's first row index.

r2

Gets or sets the range's last row index.

Top

See Also
Reference
CellRange Structure
C1.Win.C1FlexGrid Namespace

c1 Field
Gets or sets the range's first column index.

Syntax
Visual Basic (Declaration)
Public c1 As Integer
C#
public int c1

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

c2 Field
Gets or sets the range's last column index.

Syntax

1018

Visual Basic (Declaration)


Public c2 As Integer
C#
public int c2

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

r1 Field
Gets or sets the range's first row index.

Syntax
Visual Basic (Declaration)
Public r1 As Integer
C#
public int r1

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

1019

CellRange Structure
CellRange Members

r2 Field
Gets or sets the range's last row index.

Syntax
Visual Basic (Declaration)
Public r2 As Integer
C#
public int r2

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
CellRange Structure
CellRange Members

HitTestInfo
Contains information, such as the row and column indexes, about a specific coordinate pair in the
C1FlexGrid control.

Object Model

Syntax
Visual Basic (Declaration)
Public Structure HitTestInfo
Inherits System.ValueType

1020

C#
public struct HitTestInfo : System.ValueType

Remarks
Use the C1FlexGridBase.HitTest method to obtain a HitTestInfo value.

Inheritance Hierarchy
System.Object
System.ValueType
C1.Win.C1FlexGrid.HitTestInfo

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
HitTestInfo Members
C1.Win.C1FlexGrid Namespace

Overview
Contains information, such as the row and column indexes, about a specific coordinate pair in the
C1FlexGrid control.

Object Model

Syntax
Visual Basic (Declaration)
Public Structure HitTestInfo
Inherits System.ValueType

1021

C#
public struct HitTestInfo : System.ValueType

Remarks
Use the C1FlexGridBase.HitTest method to obtain a HitTestInfo value.

Inheritance Hierarchy
System.Object
System.ValueType
C1.Win.C1FlexGrid.HitTestInfo

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
HitTestInfo Members
C1.Win.C1FlexGrid Namespace

Members
Fields Properties

The following tables list the members exposed by HitTestInfo.

Public Fields
Name

Description

Column

Get the index of the column at the point being tested (if the point does not
correspond to a cell, it returns -1).

Point

The point on the control surface, in pixels.

Row

Get the index of the row at the point being tested (if the point does not

1022

correspond to a cell, it returns -1).


Type

Gets a HitTestTypeEnum that describes the type of element described by a


HitTestInfo.

Top

Public Properties
Name

Description

The X coordinate of a point on the control surface, in pixels.

The Y coordinate of a point on the control surface, in pixels.

Top

See Also
Reference
HitTestInfo Structure
C1.Win.C1FlexGrid Namespace

Properties
For a list of all members of this type, see HitTestInfo members.

Public Properties
Name

Description

The X coordinate of a point on the control surface, in pixels.

The Y coordinate of a point on the control surface, in pixels.

Top

See Also
Reference

1023

HitTestInfo Structure
C1.Win.C1FlexGrid Namespace

X Property
The X coordinate of a point on the control surface, in pixels.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property X As Integer
C#
public int X {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
HitTestInfo Structure
HitTestInfo Members

Y Property
The Y coordinate of a point on the control surface, in pixels.

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Y As Integer
C#
public int Y {get;}

Requirements

1024

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
HitTestInfo Structure
HitTestInfo Members

Fields
For a list of all members of this type, see HitTestInfo members.

Public Fields
Name

Description

Column

Get the index of the column at the point being tested (if the point does not
correspond to a cell, it returns -1).

Point

The point on the control surface, in pixels.

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 a HitTestTypeEnum that describes the type of element described by a


HitTestInfo.

Top

See Also
Reference
HitTestInfo Structure
C1.Win.C1FlexGrid Namespace

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).

1025

Syntax
Visual Basic (Declaration)
Public ReadOnly Column As Integer
C#
public readonly int Column

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
HitTestInfo Structure
HitTestInfo Members

Point Field
The point on the control surface, in pixels.

Syntax
Visual Basic (Declaration)
Public ReadOnly Point As Point
C#
public readonly Point Point

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also

1026

Reference
HitTestInfo Structure
HitTestInfo Members

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).

Syntax
Visual Basic (Declaration)
Public ReadOnly Row As Integer
C#
public readonly int Row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
HitTestInfo Structure
HitTestInfo Members

Type Field
Gets a HitTestTypeEnum that describes the type of element described by a HitTestInfo.

Syntax
Visual Basic (Declaration)
Public ReadOnly Type As HitTestTypeEnum
C#
public readonly HitTestTypeEnum Type

1027

Remarks
This property allows you to determine whether the point corresponds to a grid cell or to special
elements such as row and column headers, resizing areas, and so on.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
HitTestInfo Structure
HitTestInfo Members

Interfaces
IC1ColumnFilter
Interface implemented by column filter objects.

Object Model

Syntax
Visual Basic (Declaration)
Public Interface IC1ColumnFilter
C#
public interface IC1ColumnFilter

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1028

See Also
Reference
IC1ColumnFilter Members
C1.Win.C1FlexGrid Namespace

Overview
Interface implemented by column filter objects.

Object Model

Syntax
Visual Basic (Declaration)
Public Interface IC1ColumnFilter
C#
public interface IC1ColumnFilter

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilter Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by IC1ColumnFilter.

Public Properties

1029

Name

Description

IsActive

Gets a value that determines whether the filter is active.

Top

Public Methods
Name

Description

Apply

Applies the filter to a value.

GetEditor

Gets the editor used to modify the filter at run time.

Reset

Resets the filter making it inactive.

Top

See Also
Reference
IC1ColumnFilter Interface
C1.Win.C1FlexGrid Namespace

Methods
>
Name

Description

Apply

Applies the filter to a value.

GetEditor

Gets the editor used to modify the filter at run time.

Reset

Resets the filter making it inactive.

Top

See Also
Reference

1030

IC1ColumnFilter Interface
C1.Win.C1FlexGrid Namespace

Apply Method
Value to be filtered.
Applies the filter to a value.

Syntax
Visual Basic (Declaration)
Function Apply( _
ByVal value As Object _
) As Boolean
C#
bool Apply(
object value
)

Parameters
value
Value to be filtered.

Return Value
True if the value satisfies the filter; False otherwise.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilter Interface
IC1ColumnFilter Members

1031

GetEditor Method
Gets the editor used to modify the filter at run time.

Syntax
Visual Basic (Declaration)
Function GetEditor() As IC1ColumnFilterEditor
C#
IC1ColumnFilterEditor GetEditor()

Return Value
A System.Windows.Forms.Control to be used to modify the filter at run time.

Remarks
The control returned must implement the IC1ColumnFilterEditor interface.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilter Interface
IC1ColumnFilter Members

Reset Method
Resets the filter making it inactive.

Syntax
Visual Basic (Declaration)
Sub Reset()
C#

1032

void Reset()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilter Interface
IC1ColumnFilter Members

Properties
For a list of all members of this type, see IC1ColumnFilter members.

Public Properties
Name

Description

IsActive

Gets a value that determines whether the filter is active.

Top

See Also
Reference
IC1ColumnFilter Interface
C1.Win.C1FlexGrid Namespace

IsActive Property
Gets a value that determines whether the filter is active.

Syntax
Visual Basic (Declaration)
ReadOnly Property IsActive As Boolean
C#

1033

bool IsActive {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilter Interface
IC1ColumnFilter Members

IC1ColumnFilterEditor
Interface implemented by column filter editor controls.

Object Model

Syntax
Visual Basic (Declaration)
Public Interface IC1ColumnFilterEditor
C#
public interface IC1ColumnFilterEditor

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilterEditor Members
C1.Win.C1FlexGrid Namespace

1034

Overview
Interface implemented by column filter editor controls.

Object Model

Syntax
Visual Basic (Declaration)
Public Interface IC1ColumnFilterEditor
C#
public interface IC1ColumnFilterEditor

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilterEditor Members
C1.Win.C1FlexGrid Namespace

Members
Properties Methods

The following tables list the members exposed by IC1ColumnFilterEditor.

Public Properties
Name

Description

KeepFormOpen

Gets a value that determines whether the containing form should remain
open even when it is deactivated.

Top

1035

Public Methods
Name

Description

ApplyChanges

Applies changes to the filter being edited.

Initialize

Initializes the editor with parameters from a filter to be edited.

Top

See Also
Reference
IC1ColumnFilterEditor Interface
C1.Win.C1FlexGrid Namespace

Methods
>
Name

Description

ApplyChanges

Applies changes to the filter being edited.

Initialize

Initializes the editor with parameters from a filter to be edited.

Top

See Also
Reference
IC1ColumnFilterEditor Interface
C1.Win.C1FlexGrid Namespace

ApplyChanges Method
Applies changes to the filter being edited.

Syntax
Visual Basic (Declaration)
Sub ApplyChanges()

1036

C#
void ApplyChanges()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilterEditor Interface
IC1ColumnFilterEditor Members

Initialize Method
C1FlexGridBase that contains the column to be filtered.
Index of the column that contains the values to be filtered.
IC1ColumnFilter being edited.
Initializes the editor with parameters from a filter to be edited.

Syntax
Visual Basic (Declaration)
Sub Initialize( _
ByVal grid As C1FlexGridBase, _
ByVal columnIndex As Integer, _
ByVal filter As IC1ColumnFilter _
)
C#
void Initialize(
C1FlexGridBase grid,
int columnIndex,
IC1ColumnFilter filter
)

1037

Parameters
grid
C1FlexGridBase that contains the column to be filtered.
columnIndex
Index of the column that contains the values to be filtered.
filter
IC1ColumnFilter being edited.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilterEditor Interface
IC1ColumnFilterEditor Members

Properties
For a list of all members of this type, see IC1ColumnFilterEditor members.

Public Properties
Name

Description

KeepFormOpen

Gets a value that determines whether the containing form should remain
open even when it is deactivated.

Top

See Also
Reference
IC1ColumnFilterEditor Interface
C1.Win.C1FlexGrid Namespace

1038

KeepFormOpen Property
Gets a value that determines whether the containing form should remain open even when it is
deactivated.

Syntax
Visual Basic (Declaration)
ReadOnly Property KeepFormOpen As Boolean
C#
bool KeepFormOpen {get;}

Remarks
This property allows custom editors to display modal dialogs.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1ColumnFilterEditor Interface
IC1ColumnFilterEditor Members

IC1EmbeddedEditor
Interface implemented by editors and used by the grid to host edit controls on cells.

Object Model

Syntax
Visual Basic (Declaration)
Public Interface IC1EmbeddedEditor

1039

C#
public interface IC1EmbeddedEditor

Remarks
All built-in grid editors implement this interface, as do the controls in the ComponentOne C1Input
library.
If you want to use a third-party editor with the C1FlexGrid, consider creating a derived class and
implementing this interface.
Note that the methods in IC1EmbeddedEditor are called using reflection. Controls do not need to
implement the entire interface. Any public methods with matching signatures (names, parameters,
and return values) will be invoked by the grid. The grid supplies default handlers for any methods
not implemented by the control.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1EmbeddedEditor Members
C1.Win.C1FlexGrid Namespace

Overview
Interface implemented by editors and used by the grid to host edit controls on cells.

Object Model

Syntax
Visual Basic (Declaration)
Public Interface IC1EmbeddedEditor

1040

C#
public interface IC1EmbeddedEditor

Remarks
All built-in grid editors implement this interface, as do the controls in the ComponentOne C1Input
library.
If you want to use a third-party editor with the C1FlexGrid, consider creating a derived class and
implementing this interface.
Note that the methods in IC1EmbeddedEditor are called using reflection. Controls do not need to
implement the entire interface. Any public methods with matching signatures (names, parameters,
and return values) will be invoked by the grid. The grid supplies default handlers for any methods
not implemented by the control.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1EmbeddedEditor Members
C1.Win.C1FlexGrid Namespace

Members
Methods

The following tables list the members exposed by IC1EmbeddedEditor.

Public Methods
Name

Description

C1EditorFormat

Formats a given value using a specified mask.

C1EditorGetStyle

Gets the editor style, which determines the type of button that is
displayed in the cell before and during editing (DropDown, Modal,

1041

or None).
C1EditorGetValue

Gets the current value of the editor.

C1EditorInitialize

Called to initialize the editor content and styles.

C1EditorKeyDownFinishEdit Gets a value that determines whether a given key should finalize
editing.
C1EditorUpdateBounds

Called to update the editor's size and position.

C1EditorValueIsValid

Gets a value that determines if the editor's current contents are


valid.

Top

See Also
Reference
IC1EmbeddedEditor Interface
C1.Win.C1FlexGrid Namespace

Methods
>
Name

Description

C1EditorFormat

Formats a given value using a specified mask.

C1EditorGetStyle

Gets the editor style, which determines the type of button that is
displayed in the cell before and during editing (DropDown, Modal,
or None).

C1EditorGetValue

Gets the current value of the editor.

C1EditorInitialize

Called to initialize the editor content and styles.

C1EditorKeyDownFinishEdit

Gets a value that determines whether a given key should finalize


editing.

1042

C1EditorUpdateBounds
C1EditorValueIsValid

Called to update the editor's size and position.


Gets a value that determines if the editor's current contents are
valid.

Top

See Also
Reference
IC1EmbeddedEditor Interface
C1.Win.C1FlexGrid Namespace

C1EditorFormat Method
Value to be formatted.
Formatting mask.
Formats a given value using a specified mask.

Syntax
Visual Basic (Declaration)
Function C1EditorFormat( _
ByVal value As Object, _
ByVal mask As String _
) As String
C#
string C1EditorFormat(
object value,
string mask
)

Parameters
value
Value to be formatted.
mask
Formatting mask.

1043

Return Value
A string containing the formatted value.

Remarks
The default implementation ignores the mask and returns value.ToString().

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
IC1EmbeddedEditor Interface
IC1EmbeddedEditor Members

C1EditorGetStyle Method
Gets the editor style, which determines the type of button that is displayed in the cell before and
during editing (DropDown, Modal, or None).

Syntax
Visual Basic (Declaration)
Function C1EditorGetStyle() As UITypeEditorEditStyle
C#
UITypeEditorEditStyle C1EditorGetStyle()

Remarks
The default handler returns DropDown for ComboBoxes, DateTimePickers, and UpDown controls. It
returns None for other control types.
The UITypeEditorEditStyle enumeration is defined in the System.Drawing.Design namespace.
The available settings are DropDown, Modal, and None.

Requirements
1044

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1EmbeddedEditor Interface
IC1EmbeddedEditor Members

C1EditorGetValue Method
Gets the current value of the editor.

Syntax
Visual Basic (Declaration)
Function C1EditorGetValue() As Object
C#
object C1EditorGetValue()

Return Value
The current value of the editor (any data type).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1EmbeddedEditor Interface
IC1EmbeddedEditor Members

C1EditorInitialize Method
Contains the grid data that should be displayed in the editor.

1045

Contains a dictionary with keys that correspond to style element names and values for the cell
being edited.
Called to initialize the editor content and styles.

Syntax
Visual Basic (Declaration)
Sub C1EditorInitialize( _
ByVal value As Object, _
ByVal editorAttributes As IDictionary _
)
C#
void C1EditorInitialize(
object value,
IDictionary editorAttributes
)

Parameters
value
Contains the grid data that should be displayed in the editor.
editorAttributes
Contains a dictionary with keys that correspond to style element names and values for the
cell being edited.

Remarks
The editorAttributes dictionary contains the following keys:
BackColor: Cell background color.
ForeColor: Cell foreground color.
Font: Cell font.
Format: Cell format string (e.g. "#,##0.##").
ContentAlignment: Cell text alignment.

1046

Margins: Extra margins around the cell content (in pixels).


Wrap: Whether word wrapping is enabled.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
IC1EmbeddedEditor Interface
IC1EmbeddedEditor Members

C1EditorKeyDownFinishEdit Method
Key to be tested.
Gets a value that determines whether a given key should finalize editing.

Syntax
Visual Basic (Declaration)
Function C1EditorKeyDownFinishEdit( _
ByVal e As KeyEventArgs _
) As Boolean
C#
bool C1EditorKeyDownFinishEdit(
KeyEventArgs e
)

Parameters
e
Key to be tested.

Return Value
True if the key should finish the edits and close the editor.

1047

Remarks
If this method returns true, the grid copies the editor value to the cell and exits edit mode. The
key is then processed by the grid (unless the e.Handled parameter is set to true).
For example, pressing the down arrow typically causes the grid to exit edit mode and move
the cursor to the next row.
The default handler returns true for the TAB, ENTER, and ESC keys. It also handles the arrow
keys for editors based on TextBox, ComboBox, and DateTimePicker controls.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
IC1EmbeddedEditor Interface
IC1EmbeddedEditor Members

C1EditorUpdateBounds Method
The bounds of the cell being edited, in client coordinates.
Called to update the editor's size and position.

Syntax
Visual Basic (Declaration)
Sub C1EditorUpdateBounds( _
ByVal rc As Rectangle _
)
C#
void C1EditorUpdateBounds(
Rectangle rc
)

Parameters

1048

rc
The bounds of the cell being edited, in client coordinates.

Remarks
This method is called during initialization and also when the grid scrolls.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
IC1EmbeddedEditor Interface
IC1EmbeddedEditor Members

C1EditorValueIsValid Method
Gets a value that determines if the editor's current contents are valid.

Syntax
Visual Basic (Declaration)
Function C1EditorValueIsValid() As Boolean
C#
bool C1EditorValueIsValid()

Return Value
True if the editor currently has valid content (e.g it contains an EditMask and all required positions
have been filled).

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1049

See Also
Reference
IC1EmbeddedEditor Interface
IC1EmbeddedEditor Members

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

Object Model

Syntax
Visual Basic (Declaration)
Public Interface IC1MultiColumnDictionary
C#
public interface IC1MultiColumnDictionary

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1MultiColumnDictionary Members
C1.Win.C1FlexGrid Namespace

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

Object Model

1050

Syntax
Visual Basic (Declaration)
Public Interface IC1MultiColumnDictionary
C#
public interface IC1MultiColumnDictionary

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
IC1MultiColumnDictionary Members
C1.Win.C1FlexGrid Namespace

Members
Methods

The following tables list the members exposed by IC1MultiColumnDictionary.

Public Methods
Name

Description

GetDisplayValue

Gets the string that should be displayed in the grid while not in edit mode.

Top

See Also
Reference
IC1MultiColumnDictionary Interface
C1.Win.C1FlexGrid Namespace

1051

Methods
>
Name
GetDisplayValue

Description
Gets the string that should be displayed in the grid while not in edit mode.

Top

See Also
Reference
IC1MultiColumnDictionary Interface
C1.Win.C1FlexGrid Namespace

GetDisplayValue Method
Value to look up in the dictionary.
Gets the string that should be displayed in the grid while not in edit mode.

Syntax
Visual Basic (Declaration)
Function GetDisplayValue( _
ByVal key As Object _
) As String
C#
string GetDisplayValue(
object key
)

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
1052

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.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
IC1MultiColumnDictionary Interface
IC1MultiColumnDictionary Members

Delegates
BeforeMouseDownEventHandler
Object that fired the event.
BeforeMouseDownEventArgs object that contains the event data.
Represents the method that will handle the C1FlexGridBase.BeforeMouseDown event.

Syntax
Visual Basic (Declaration)
Public Delegate Sub BeforeMouseDownEventHandler( _
ByVal sender As Object, _
ByVal e As BeforeMouseDownEventArgs _
)
C#
public delegate void BeforeMouseDownEventHandler(
object sender,
BeforeMouseDownEventArgs e
)

Parameters

1053

sender
Object that fired the event.
e
BeforeMouseDownEventArgs object that contains the event data.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
BeforeMouseDownEventHandler Members
C1.Win.C1FlexGrid Namespace

DragRowColEventHandler
Object that fired the event.
DragRowColEventArgs object that contains the event data.
Represents the method that will handle the C1FlexGridBase.BeforeDragColumn,
C1FlexGridBase.BeforeDragRow, C1FlexGridBase.AfterDragColumn and
C1FlexGridBase.AfterDragRow events.

Syntax
Visual Basic (Declaration)
Public Delegate Sub DragRowColEventHandler( _
ByVal sender As Object, _
ByVal e As DragRowColEventArgs _
)
C#
public delegate void DragRowColEventHandler(
object sender,
DragRowColEventArgs e

1054

Parameters
sender
Object that fired the event.
e
DragRowColEventArgs object that contains the event data.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
DragRowColEventHandler Members
C1.Win.C1FlexGrid Namespace

GetErrorInfoEventHandler
Represents the method that will handle the C1FlexGridBase.GetCellErrorInfo and
C1FlexGridBase.GetRowErrorInfo events.

Syntax
Visual Basic (Declaration)
Public Delegate Sub GetErrorInfoEventHandler( _
ByVal sender As Object, _
ByVal e As GetErrorInfoEventArgs _
)
C#
public delegate void GetErrorInfoEventHandler(
object sender,
GetErrorInfoEventArgs e
)

1055

Parameters
sender
e

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GetErrorInfoEventHandler Members
C1.Win.C1FlexGrid Namespace

GetLocalizedStringEventHandler
C1FlexGridBase object that raised the event.
GetLocalizedStringEventArgs that contains the event data.
Represents the method that will handle the C1FlexGridBase.GetLocalizedString event.

Syntax
Visual Basic (Declaration)
Public Delegate Sub GetLocalizedStringEventHandler( _
ByVal sender As Object, _
ByVal e As GetLocalizedStringEventArgs _
)
C#
public delegate void GetLocalizedStringEventHandler(
object sender,
GetLocalizedStringEventArgs e
)

Parameters
sender

1056

C1FlexGridBase object that raised the event.


e
GetLocalizedStringEventArgs that contains the event data.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GetLocalizedStringEventHandler Members
C1.Win.C1FlexGrid Namespace

GridChangedEventHandler
Represents the method that will handle the C1FlexGridBase.GridChanged event.

Syntax
Visual Basic (Declaration)
Public Delegate Sub GridChangedEventHandler( _
ByVal sender As Object, _
ByVal e As GridChangedEventArgs _
)
C#
public delegate void GridChangedEventHandler(
object sender,
GridChangedEventArgs e
)

Parameters
sender
e

Requirements
1057

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
GridChangedEventHandler Members
C1.Win.C1FlexGrid Namespace

GridErrorEventHandler
Represents the method that will handle the C1FlexGridBase.GridError event.

Syntax
Visual Basic (Declaration)
Public Delegate Sub GridErrorEventHandler( _
ByVal sender As Object, _
ByVal e As GridErrorEventArgs _
)
C#
public delegate void GridErrorEventHandler(
object sender,
GridErrorEventArgs e
)

Parameters
sender
e

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also

1058

Reference
GridErrorEventHandler Members
C1.Win.C1FlexGrid Namespace

KeyEditEventHandler
Represents the method that will handle the C1FlexGridBase.KeyDownEdit and
C1FlexGridBase.KeyUpEdit events.

Syntax
Visual Basic (Declaration)
Public Delegate Sub KeyEditEventHandler( _
ByVal sender As Object, _
ByVal e As KeyEditEventArgs _
)
C#
public delegate void KeyEditEventHandler(
object sender,
KeyEditEventArgs e
)

Parameters
sender
e

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
KeyEditEventHandler Members
C1.Win.C1FlexGrid Namespace

1059

KeyPressEditEventHandler
Represents the method that will handle the C1FlexGridBase.KeyPressEdit event.

Syntax
Visual Basic (Declaration)
Public Delegate Sub KeyPressEditEventHandler( _
ByVal sender As Object, _
ByVal e As KeyPressEditEventArgs _
)
C#
public delegate void KeyPressEditEventHandler(
object sender,
KeyPressEditEventArgs e
)

Parameters
sender
e

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
KeyPressEditEventHandler Members
C1.Win.C1FlexGrid Namespace

OwnerDrawCellEventHandler
Represents the method that will handle the C1FlexGridBase.OwnerDrawCell event.

Syntax

1060

Visual Basic (Declaration)


Public Delegate Sub OwnerDrawCellEventHandler( _
ByVal sender As Object, _
ByVal e As OwnerDrawCellEventArgs _
)
C#
public delegate void OwnerDrawCellEventHandler(
object sender,
OwnerDrawCellEventArgs e
)

Parameters
sender
e

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
OwnerDrawCellEventHandler Members
C1.Win.C1FlexGrid Namespace

RangeEventHandler
Object that fired the event.
RangeEventArgs object that contains the event data.
Represents the method that will handle the C1FlexGridBase.AfterRowColChange,
C1FlexGridBase.AfterScroll, C1FlexGridBase.AfterSelChange,
C1FlexGridBase.BeforeRowColChange, C1FlexGridBase.BeforeScroll, and
C1FlexGridBase.BeforeSelChange events.

Syntax

1061

Visual Basic (Declaration)


Public Delegate Sub RangeEventHandler( _
ByVal sender As Object, _
ByVal e As RangeEventArgs _
)
C#
public delegate void RangeEventHandler(
object sender,
RangeEventArgs e
)

Parameters
sender
Object that fired the event.
e
RangeEventArgs object that contains the event data.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
RangeEventHandler Members
C1.Win.C1FlexGrid Namespace

RowColEventHandler
Object that fired the event.
RowColEventArgs object that contains the event data.
Represents the method that will handle the C1FlexGridBase.AfterEdit,
C1FlexGridBase.AfterResizeColumn, C1FlexGridBase.AfterResizeRow,
C1FlexGridBase.BeforeEdit, C1FlexGridBase.BeforePageBreak,

1062

C1FlexGridBase.BeforeResizeColumn, C1FlexGridBase.BeforeResizeRow,
C1FlexGridBase.ShowScrollTip, C1FlexGridBase.CellButtonClick,
C1FlexGridBase.ComboCloseUp, C1FlexGridBase.ComboDropDown,
C1FlexGridBase.SetupEditor, and C1FlexGridBase.StartEdit events.

Syntax
Visual Basic (Declaration)
Public Delegate Sub RowColEventHandler( _
ByVal sender As Object, _
ByVal e As RowColEventArgs _
)
C#
public delegate void RowColEventHandler(
object sender,
RowColEventArgs e
)

Parameters
sender
Object that fired the event.
e
RowColEventArgs object that contains the event data.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
RowColEventHandler Members
C1.Win.C1FlexGrid Namespace

1063

RowColToolTipEventHandler
Object that fired the event.
ToolTipEventArgs object that contains the event data.
Represents the method that will handle the C1FlexGridBase.ShowScrollTip event.

Syntax
Visual Basic (Declaration)
Public Delegate Sub RowColToolTipEventHandler( _
ByVal sender As Object, _
ByVal e As ToolTipEventArgs _
)
C#
public delegate void RowColToolTipEventHandler(
object sender,
ToolTipEventArgs e
)

Parameters
sender
Object that fired the event.
e
ToolTipEventArgs object that contains the event data.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
RowColToolTipEventHandler Members
C1.Win.C1FlexGrid Namespace

1064

SortColEventHandler
Object that fired the event.
SortColEventArgs object that contains the event data.
Represents the method that will handle the C1FlexGridBase.BeforeSort and
C1FlexGridBase.AfterSort events.

Syntax
Visual Basic (Declaration)
Public Delegate Sub SortColEventHandler( _
ByVal sender As Object, _
ByVal e As SortColEventArgs _
)
C#
public delegate void SortColEventHandler(
object sender,
SortColEventArgs e
)

Parameters
sender
Object that fired the event.
e
SortColEventArgs object that contains the event data.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference

1065

SortColEventHandler Members
C1.Win.C1FlexGrid Namespace

SubtotalEventHandler
C1FlexGridBase object that raised the event.
SubtotalEventArgs that contains the event data.
Represents the method that will handle the C1FlexGridBase.BeforeSubtotal and
C1FlexGridBase.AfterSubtotal events.

Syntax
Visual Basic (Declaration)
Public Delegate Sub SubtotalEventHandler( _
ByVal sender As Object, _
ByVal e As SubtotalEventArgs _
)
C#
public delegate void SubtotalEventHandler(
object sender,
SubtotalEventArgs e
)

Parameters
sender
C1FlexGridBase object that raised the event.
e
SubtotalEventArgs that contains the event data.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also

1066

Reference
SubtotalEventHandler Members
C1.Win.C1FlexGrid Namespace

UnboundValueEventHandler
C1FlexGridBase object that raised the event.
UnboundValueEventArgs that contains the event data.
Represents the method that will handle the C1FlexGridBase.GetUnboundValue and
C1FlexGridBase.SetUnboundValue events.

Syntax
Visual Basic (Declaration)
Public Delegate Sub UnboundValueEventHandler( _
ByVal sender As Object, _
ByVal e As UnboundValueEventArgs _
)
C#
public delegate void UnboundValueEventHandler(
object sender,
UnboundValueEventArgs e
)

Parameters
sender
C1FlexGridBase object that raised the event.
e
UnboundValueEventArgs that contains the event data.

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

1067

See Also
Reference
UnboundValueEventHandler Members
C1.Win.C1FlexGrid Namespace

ValidateEditEventHandler
Represents the method that will handle the C1FlexGridBase.ValidateEdit event.

Syntax
Visual Basic (Declaration)
Public Delegate Sub ValidateEditEventHandler( _
ByVal sender As Object, _
ByVal e As ValidateEditEventArgs _
)
C#
public delegate void ValidateEditEventHandler(
object sender,
ValidateEditEventArgs e
)

Parameters
sender
e

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
ValidateEditEventHandler Members
C1.Win.C1FlexGrid Namespace

1068

C1.Win.C1FlexGrid.Util.BaseControls Namespace
Overview

Enumerations
Enumeration

Description

BorderStyleEnum Specifies the type of border to be drawn around the control.

See Also
Reference
C1.Win.C1FlexGrid.4 Assembly

Enumerations
BorderStyleEnum
Specifies the type of border to be drawn around the control.

Syntax
Visual Basic (Declaration)
Public Enum BorderStyleEnum
Inherits System.Enum
C#
public enum BorderStyleEnum : System.Enum

Members
Member

Description

Fixed3D

A three-dimensional border.

FixedSingle

A single-line border.

Light3D

A light sunken border.

1069

None

No border.

XpThemes

A border drawn using XP themes.

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Util.BaseControls Namespace

C1.Win.C1FlexGrid.Classic.4 Assembly
Overview
%%description%%
" -->

Namespaces
Namespace

Description

C1.Win.C1FlexGrid.Classic

1070

Namespaces
C1.Win.C1FlexGrid.Classic Namespace
Overview

Classes
Class

Description

C1FlexGridClassic
Cell

Enumerations
Enumeration

Description

AlignmentSettings
AllowUserResizeSettings
AutoSizeSettings
CellCheckedSettings
CellPropertySettings
ClearWhatSettings
ClearWhereSettings
EditableSettings
EllipsisSettings
ExplorerBarSettings

1071

FillStyleSettings
GridStyleSettings
MergeSettings
OutlineBarSettings
PictureAlignmentSettings
RedrawSettings
SelModeSettings
SortSettings
TabBehaviorSettings
TextStyleSettings

See Also
Reference
C1.Win.C1FlexGrid.Classic.4 Assembly

Classes
C1FlexGridClassic

Object Model

Syntax
Visual Basic (Declaration)
Public Class C1FlexGridClassic

1072

Inherits C1.Win.C1FlexGrid.C1FlexGrid
C#
public class C1FlexGridClassic : C1.Win.C1FlexGrid.C1FlexGrid

Inheritance Hierarchy
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
C1.Win.C1FlexGrid.C1FlexGrid
C1.Win.C1FlexGrid.Classic.C1FlexGridClassic

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Members
C1.Win.C1FlexGrid.Classic Namespace

Overview

Object Model

Syntax
Visual Basic (Declaration)
Public Class C1FlexGridClassic
Inherits C1.Win.C1FlexGrid.C1FlexGrid
C#
public class C1FlexGridClassic : C1.Win.C1FlexGrid.C1FlexGrid

1073

Inheritance Hierarchy
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
C1.Win.C1FlexGrid.C1FlexGrid
C1.Win.C1FlexGrid.Classic.C1FlexGridClassic

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Members
C1.Win.C1FlexGrid.Classic Namespace

Members
Properties Methods Events

The following tables list the members exposed by C1FlexGridClassic.

Public Constructors
Name

Description

C1FlexGridClassic Constructor
Top

Public Properties
Name

Description

AccessibilityObject

(Inherited from System.Windows.Forms.Control)

1074

AccessibleDefaultActionDescription (Inherited from System.Windows.Forms.Control)


AccessibleDescription

(Inherited from System.Windows.Forms.Control)

AccessibleName

(Inherited from System.Windows.Forms.Control)

AccessibleRole

(Inherited from System.Windows.Forms.Control)

AllowBigSelection
AllowDragging
AllowEditing
AllowMerging
AllowMergingFixed

Gets or sets how non-scrollable cells should be merged.


(Inherited from C1.Win.C1FlexGrid.C1FlexGrid)

AllowResizing
AllowSelection
AllowSorting
AllowUserResizing
Anchor

(Inherited from System.Windows.Forms.Control)

AutoScrollOffset

(Inherited from System.Windows.Forms.Control)

AutoSizeMode
BackColorAlternate

1075

BackColorBkg
BackColorFixed
BackColorSel
BackgroundImage
BackgroundImageLayout

(Inherited from System.Windows.Forms.Control)

BindingContext

(Inherited from System.Windows.Forms.Control)

Bottom

(Inherited from System.Windows.Forms.Control)

Bounds

(Inherited from System.Windows.Forms.Control)

CanFocus

(Inherited from System.Windows.Forms.Control)

CanSelect

(Inherited from System.Windows.Forms.Control)

Capture

(Inherited from System.Windows.Forms.Control)

CausesValidation

(Inherited from System.Windows.Forms.Control)

Cell
CellAlignment
CellBackColor
CellButtonImage
CellButtonPicture
CellChecked

1076

CellFont
CellFontBold
CellFontItalic
CellFontName
CellFontSize
CellFontStrikethru
CellFontUnderline
CellForeColor
CellHeight
CellLeft
CellPicture
CellPictureAlignment
CellTextStyle
CellTop
CellWidth
ClientRectangle

(Inherited from System.Windows.Forms.Control)

ClientSize

(Inherited from System.Windows.Forms.Control)

Cols

1077

ColumnCollection
ColWidthMax
ColWidthMin
ComboCount
ComboIndex
CompanyName

(Inherited from System.Windows.Forms.Control)

Container

(Inherited from System.ComponentModel.Component)

ContainsFocus

(Inherited from System.Windows.Forms.Control)

ContextMenu

(Inherited from System.Windows.Forms.Control)

ContextMenuStrip

(Inherited from System.Windows.Forms.Control)

Controls

(Inherited from System.Windows.Forms.Control)

Created

(Inherited from System.Windows.Forms.Control)

Cursor

(Inherited from System.Windows.Forms.Control)

DataBindings

(Inherited from System.Windows.Forms.Control)

DisplayRectangle

(Inherited from System.Windows.Forms.Control)

Disposing

(Inherited from System.Windows.Forms.Control)

Dock

(Inherited from System.Windows.Forms.Control)

Editable

1078

EditSelLength
EditSelStart
EditSelText
EditText
EditWindow
Ellipsis
Enabled

(Inherited from System.Windows.Forms.Control)

ExplorerBar
FillStyle
FixedCols
FixedRows
Focused

(Inherited from System.Windows.Forms.Control)

Font

(Inherited from System.Windows.Forms.Control)

FontBold
FontItalic
FontName
FontSize
FontStrikethru

1079

FontUnderline
ForeColorFixed
ForeColorSel
FrozenCols
FrozenRows
GridColor
GridColorFixed
GridLines
GridLinesFixed
GridLineWidth
Handle

(Inherited from System.Windows.Forms.Control)

HasChildren

(Inherited from System.Windows.Forms.Control)

Height

(Inherited from System.Windows.Forms.Control)

ImeMode

(Inherited from System.Windows.Forms.Control)

InvokeRequired

(Inherited from System.Windows.Forms.Control)

IsAccessible

(Inherited from System.Windows.Forms.Control)

IsDisposed

(Inherited from System.Windows.Forms.Control)

IsHandleCreated

(Inherited from System.Windows.Forms.Control)

1080

IsMirrored

(Inherited from System.Windows.Forms.Control)

KeyActionEnter
KeyActionTab
LayoutEngine

(Inherited from System.Windows.Forms.Control)

Left

(Inherited from System.Windows.Forms.Control)

Location

(Inherited from System.Windows.Forms.Control)

Margin

(Inherited from System.Windows.Forms.Control)

MaximumSize

(Inherited from System.Windows.Forms.Control)

MergeCells
MergedRanges

Gets the C1.Win.C1FlexGrid.CellRangeCollection that


determines which grid cells are merged when the
AllowMerging property is set to
C1.Win.C1FlexGrid.AllowMergingEnum.Custom. (Inherited
from C1.Win.C1FlexGrid.C1FlexGrid)

MinimumSize

(Inherited from System.Windows.Forms.Control)

Name

(Inherited from System.Windows.Forms.Control)

NodeClosedPicture
NodeOpenPicture
OutlineBar
OutlineCol

1081

Padding

(Inherited from System.Windows.Forms.Control)

Parent

(Inherited from System.Windows.Forms.Control)

Picture
PicturesOver
PreferredSize

(Inherited from System.Windows.Forms.Control)

ProductName

(Inherited from System.Windows.Forms.Control)

ProductVersion

(Inherited from System.Windows.Forms.Control)

RecreatingHandle

(Inherited from System.Windows.Forms.Control)

Redraw
Region

(Inherited from System.Windows.Forms.Control)

Right

(Inherited from System.Windows.Forms.Control)

RightToLeft

(Inherited from System.Windows.Forms.Control)

RowHeightMax
RowHeightMin
Rows
SelectedRows
SelectionMode
SheetBorder

1082

Site

(Inherited from System.Windows.Forms.Control)

Size

(Inherited from System.Windows.Forms.Control)

Sort
Styles
TabBehavior
TabIndex

(Inherited from System.Windows.Forms.Control)

TabStop

(Inherited from System.Windows.Forms.Control)

Tag

(Inherited from System.Windows.Forms.Control)

Text

Overridden.

TextStyle
TextStyleFixed
Top

(Inherited from System.Windows.Forms.Control)

TopLevelControl

(Inherited from System.Windows.Forms.Control)

TreeColor
UseWaitCursor

(Inherited from System.Windows.Forms.Control)

Value
Visible

(Inherited from System.Windows.Forms.Control)

WallPaper

1083

Width

(Inherited from System.Windows.Forms.Control)

WordWrap
Top

Public Methods
Name

Description

AutoSize

Overloaded.

BeginInvoke

Overloaded. (Inherited from System.Windows.Forms.Control)

BringToFront

(Inherited from System.Windows.Forms.Control)

Clear

Overloaded. Clears a range.

ComboItem
Contains

(Inherited from System.Windows.Forms.Control)

CreateControl

(Inherited from System.Windows.Forms.Control)

CreateGraphics

(Inherited from System.Windows.Forms.Control)

CreateObjRef

(Inherited from System.MarshalByRefObject)

Dispose

(Inherited from System.ComponentModel.Component)

DoDragDrop

(Inherited from System.Windows.Forms.Control)

DrawToBitmap

(Inherited from System.Windows.Forms.Control)

EditCell

1084

EndInvoke

(Inherited from System.Windows.Forms.Control)

FindForm

(Inherited from System.Windows.Forms.Control)

FindRow

Overloaded. Finds a row that contains a specified string.

Focus

(Inherited from System.Windows.Forms.Control)

get_Cell

Overloaded.

get_ColAlignment
get_ColComboList
get_ColData
get_ColDataType
get_ColEditMask
get_ColFormat
get_ColHidden
get_ColIndent
get_ColIndex
get_ColIsVisible
get_ColKey
get_ColPos
get_ColSort

1085

get_ColWidth
get_FixedAlignment
get_IsCollapsed
get_IsSelected
get_IsSubtotal
get_MergeCol
get_MergeRow
get_RowData
get_RowHeight
get_RowHidden
get_RowIsVisible
get_RowOutlineLevel
get_RowPos
get_TextMatrix
get_ValueMatrix
GetChildAtPoint

Overloaded. (Inherited from System.Windows.Forms.Control)

GetContainerControl

(Inherited from System.Windows.Forms.Control)

GetLifetimeService

(Inherited from System.MarshalByRefObject)

1086

GetMergedRange

Overloaded. Returns the merged range of cells that includes a


given cell.

GetNextControl

(Inherited from System.Windows.Forms.Control)

GetNode

Overloaded.

GetNodeRow
GetPreferredSize

(Inherited from System.Windows.Forms.Control)

GetSelection
Hide

(Inherited from System.Windows.Forms.Control)

InitializeLifetimeService

(Inherited from System.MarshalByRefObject)

Invalidate

Overloaded. Invalidates a cell range, causing it to be repainted.


(Inherited from C1.Win.C1FlexGrid.C1FlexGrid)

Invoke

Overloaded. (Inherited from System.Windows.Forms.Control)

IsCellCursor

Gets a value that determines if a cell contains the grid cursor.


(Inherited from C1.Win.C1FlexGrid.C1FlexGrid)

IsCellHighlighted

Gets a value that determines if a cell is part of the selection and


should be highlighted. (Inherited from
C1.Win.C1FlexGrid.C1FlexGrid)

Outline
PerformLayout

Overloaded. (Inherited from System.Windows.Forms.Control)

PointToClient

(Inherited from System.Windows.Forms.Control)

1087

PointToScreen

(Inherited from System.Windows.Forms.Control)

PreProcessControlMessage (Inherited from System.Windows.Forms.Control)


PreProcessMessage

(Inherited from System.Windows.Forms.Control)

PrintGrid

Overloaded. Prints the grid, optionally showing a page setup or


print preview dialog.

ReadXml

Overloaded. Overridden. Loads the grid from an Xml document.

RectangleToClient

(Inherited from System.Windows.Forms.Control)

RectangleToScreen

(Inherited from System.Windows.Forms.Control)

Refresh

(Inherited from System.Windows.Forms.Control)

ResetText

(Inherited from System.Windows.Forms.Control)

ResumeLayout

Overloaded. (Inherited from System.Windows.Forms.Control)

Scale

(Inherited from System.Windows.Forms.Control)

SelectedRow
SelectNextControl

(Inherited from System.Windows.Forms.Control)

SendToBack

(Inherited from System.Windows.Forms.Control)

set_Cell

Overloaded.

set_ColAlignment
set_ColComboList

1088

set_ColData
set_ColDataType
set_ColEditMask
set_ColFormat
set_ColHidden
set_ColImageList
set_ColIndent
set_ColKey
set_ColPosition
set_ColSort
set_ColWidth
set_FixedAlignment
set_IsCollapsed
set_IsSelected
set_IsSubtotal
set_MergeCol
set_MergeRow
set_RowData

1089

set_RowHeight
set_RowHidden
set_RowOutlineLevel
set_RowPosition
set_TextMatrix
SetBounds

Overloaded. (Inherited from System.Windows.Forms.Control)

Show

(Inherited from System.Windows.Forms.Control)

SuspendLayout

(Inherited from System.Windows.Forms.Control)

ToString

(Inherited from System.ComponentModel.Component)

Update

(Inherited from System.Windows.Forms.Control)

WriteXml

Overloaded. Overridden. Saves the grid contents to an Xml


document.

Top

Public Events
Name

Description

BackColorChanged

(Inherited from System.Windows.Forms.Control)

BackgroundImageChanged

(Inherited from System.Windows.Forms.Control)

BackgroundImageLayoutChanged (Inherited from System.Windows.Forms.Control)


BindingContextChanged

(Inherited from System.Windows.Forms.Control)

1090

CausesValidationChanged

(Inherited from System.Windows.Forms.Control)

ChangeUICues

(Inherited from System.Windows.Forms.Control)

Click

(Inherited from System.Windows.Forms.Control)

ClientSizeChanged

(Inherited from System.Windows.Forms.Control)

ContextMenuChanged

(Inherited from System.Windows.Forms.Control)

ContextMenuStripChanged

(Inherited from System.Windows.Forms.Control)

ControlAdded

(Inherited from System.Windows.Forms.Control)

ControlRemoved

(Inherited from System.Windows.Forms.Control)

CursorChanged

(Inherited from System.Windows.Forms.Control)

Disposed

(Inherited from System.ComponentModel.Component)

DockChanged

(Inherited from System.Windows.Forms.Control)

DoubleClick

(Inherited from System.Windows.Forms.Control)

DragDrop

(Inherited from System.Windows.Forms.Control)

DragEnter

(Inherited from System.Windows.Forms.Control)

DragLeave

(Inherited from System.Windows.Forms.Control)

DragOver

(Inherited from System.Windows.Forms.Control)

EnabledChanged

(Inherited from System.Windows.Forms.Control)

Enter

(Inherited from System.Windows.Forms.Control)

1091

FontChanged

(Inherited from System.Windows.Forms.Control)

ForeColorChanged

(Inherited from System.Windows.Forms.Control)

GiveFeedback

(Inherited from System.Windows.Forms.Control)

GotFocus

(Inherited from System.Windows.Forms.Control)

HandleCreated

(Inherited from System.Windows.Forms.Control)

HandleDestroyed

(Inherited from System.Windows.Forms.Control)

HelpRequested

(Inherited from System.Windows.Forms.Control)

ImeModeChanged

(Inherited from System.Windows.Forms.Control)

Invalidated

(Inherited from System.Windows.Forms.Control)

KeyDown

(Inherited from System.Windows.Forms.Control)

KeyPress

(Inherited from System.Windows.Forms.Control)

KeyUp

(Inherited from System.Windows.Forms.Control)

Layout

(Inherited from System.Windows.Forms.Control)

Leave

(Inherited from System.Windows.Forms.Control)

LocationChanged

(Inherited from System.Windows.Forms.Control)

LostFocus

(Inherited from System.Windows.Forms.Control)

MarginChanged

(Inherited from System.Windows.Forms.Control)

MouseCaptureChanged

(Inherited from System.Windows.Forms.Control)

1092

MouseClick

(Inherited from System.Windows.Forms.Control)

MouseDoubleClick

(Inherited from System.Windows.Forms.Control)

MouseDown

(Inherited from System.Windows.Forms.Control)

MouseEnter

(Inherited from System.Windows.Forms.Control)

MouseHover

(Inherited from System.Windows.Forms.Control)

MouseLeave

(Inherited from System.Windows.Forms.Control)

MouseMove

(Inherited from System.Windows.Forms.Control)

MouseUp

(Inherited from System.Windows.Forms.Control)

MouseWheel

(Inherited from System.Windows.Forms.Control)

Move

(Inherited from System.Windows.Forms.Control)

PaddingChanged

(Inherited from System.Windows.Forms.Control)

Paint

(Inherited from System.Windows.Forms.Control)

ParentChanged

(Inherited from System.Windows.Forms.Control)

PreviewKeyDown

(Inherited from System.Windows.Forms.Control)

QueryAccessibilityHelp

(Inherited from System.Windows.Forms.Control)

QueryContinueDrag

(Inherited from System.Windows.Forms.Control)

RegionChanged

(Inherited from System.Windows.Forms.Control)

Resize

(Inherited from System.Windows.Forms.Control)

1093

RightToLeftChanged

(Inherited from System.Windows.Forms.Control)

SizeChanged

(Inherited from System.Windows.Forms.Control)

StyleChanged

(Inherited from System.Windows.Forms.Control)

SystemColorsChanged

(Inherited from System.Windows.Forms.Control)

TabIndexChanged

(Inherited from System.Windows.Forms.Control)

TabStopChanged

(Inherited from System.Windows.Forms.Control)

TextChanged

(Inherited from System.Windows.Forms.Control)

Validated

(Inherited from System.Windows.Forms.Control)

Validating

(Inherited from System.Windows.Forms.Control)

VisibleChanged

(Inherited from System.Windows.Forms.Control)

Top

See Also
Reference
C1FlexGridClassic Class
C1.Win.C1FlexGrid.Classic Namespace

C1FlexGridClassic Constructor

Syntax
Visual Basic (Declaration)
Public Function New()
C#
public C1FlexGridClassic()

1094

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Methods
For a list of all members of this type, see C1FlexGridClassic members.

Public Methods
Name

Description

AutoSize

Overloaded.

BeginInvoke

Overloaded. (Inherited from System.Windows.Forms.Control)

BringToFront

(Inherited from System.Windows.Forms.Control)

Clear

Overloaded. Clears a range.

ComboItem
Contains

(Inherited from System.Windows.Forms.Control)

CreateControl

(Inherited from System.Windows.Forms.Control)

CreateGraphics

(Inherited from System.Windows.Forms.Control)

CreateObjRef

(Inherited from System.MarshalByRefObject)

1095

Dispose

(Inherited from System.ComponentModel.Component)

DoDragDrop

(Inherited from System.Windows.Forms.Control)

DrawToBitmap

(Inherited from System.Windows.Forms.Control)

EditCell
EndInvoke

(Inherited from System.Windows.Forms.Control)

FindForm

(Inherited from System.Windows.Forms.Control)

FindRow

Overloaded. Finds a row that contains a specified string.

Focus

(Inherited from System.Windows.Forms.Control)

get_Cell

Overloaded.

get_ColAlignment
get_ColComboList
get_ColData
get_ColDataType
get_ColEditMask
get_ColFormat
get_ColHidden
get_ColIndent
get_ColIndex

1096

get_ColIsVisible
get_ColKey
get_ColPos
get_ColSort
get_ColWidth
get_FixedAlignment
get_IsCollapsed
get_IsSelected
get_IsSubtotal
get_MergeCol
get_MergeRow
get_RowData
get_RowHeight
get_RowHidden
get_RowIsVisible
get_RowOutlineLevel
get_RowPos
get_TextMatrix

1097

get_ValueMatrix
GetChildAtPoint

Overloaded. (Inherited from System.Windows.Forms.Control)

GetContainerControl

(Inherited from System.Windows.Forms.Control)

GetLifetimeService

(Inherited from System.MarshalByRefObject)

GetMergedRange

Overloaded. Returns the merged range of cells that includes a


given cell.

GetNextControl

(Inherited from System.Windows.Forms.Control)

GetNode

Overloaded.

GetNodeRow
GetPreferredSize

(Inherited from System.Windows.Forms.Control)

GetSelection
Hide

(Inherited from System.Windows.Forms.Control)

InitializeLifetimeService

(Inherited from System.MarshalByRefObject)

Invalidate

Overloaded. Invalidates a cell range, causing it to be repainted.


(Inherited from C1.Win.C1FlexGrid.C1FlexGrid)

Invoke

Overloaded. (Inherited from System.Windows.Forms.Control)

IsCellCursor

Gets a value that determines if a cell contains the grid cursor.


(Inherited from C1.Win.C1FlexGrid.C1FlexGrid)

IsCellHighlighted

Gets a value that determines if a cell is part of the selection and


should be highlighted. (Inherited from

1098

C1.Win.C1FlexGrid.C1FlexGrid)
Outline
PerformLayout

Overloaded. (Inherited from System.Windows.Forms.Control)

PointToClient

(Inherited from System.Windows.Forms.Control)

PointToScreen

(Inherited from System.Windows.Forms.Control)

PreProcessControlMessage (Inherited from System.Windows.Forms.Control)


PreProcessMessage

(Inherited from System.Windows.Forms.Control)

PrintGrid

Overloaded. Prints the grid, optionally showing a page setup or


print preview dialog.

ReadXml

Overloaded. Overridden. Loads the grid from an Xml document.

RectangleToClient

(Inherited from System.Windows.Forms.Control)

RectangleToScreen

(Inherited from System.Windows.Forms.Control)

Refresh

(Inherited from System.Windows.Forms.Control)

ResetText

(Inherited from System.Windows.Forms.Control)

ResumeLayout

Overloaded. (Inherited from System.Windows.Forms.Control)

Scale

(Inherited from System.Windows.Forms.Control)

SelectedRow
SelectNextControl

(Inherited from System.Windows.Forms.Control)

1099

SendToBack

(Inherited from System.Windows.Forms.Control)

set_Cell

Overloaded.

set_ColAlignment
set_ColComboList
set_ColData
set_ColDataType
set_ColEditMask
set_ColFormat
set_ColHidden
set_ColImageList
set_ColIndent
set_ColKey
set_ColPosition
set_ColSort
set_ColWidth
set_FixedAlignment
set_IsCollapsed
set_IsSelected

1100

set_IsSubtotal
set_MergeCol
set_MergeRow
set_RowData
set_RowHeight
set_RowHidden
set_RowOutlineLevel
set_RowPosition
set_TextMatrix
SetBounds

Overloaded. (Inherited from System.Windows.Forms.Control)

Show

(Inherited from System.Windows.Forms.Control)

SuspendLayout

(Inherited from System.Windows.Forms.Control)

ToString

(Inherited from System.ComponentModel.Component)

Update

(Inherited from System.Windows.Forms.Control)

WriteXml

Overloaded. Overridden. Saves the grid contents to an Xml


document.

Top

See Also
Reference

1101

C1FlexGridClassic Class
C1.Win.C1FlexGrid.Classic Namespace

AutoSize Method

Overload List
Overload

Description

AutoSize(Int32)
AutoSize(Int32,Int32)
AutoSize(Int32,Int32,Boolean,Int32)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
AutoSize(Int32) Method

Syntax
Visual Basic (Declaration)
Public Overloads Sub AutoSize( _
ByVal col As Integer _
)
C#
public void AutoSize(
int col
)

1102

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
AutoSize(Int32,Int32) Method

Syntax
Visual Basic (Declaration)
Public Overloads Sub AutoSize( _
ByVal col1 As Integer, _
ByVal col2 As Integer _
)
C#
public void AutoSize(
int col1,
int col2
)

Parameters
col1
col2

Requirements

1103

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
AutoSize(Int32,Int32,Boolean,Int32) Method

Syntax
Visual Basic (Declaration)
Public Overloads Sub AutoSize( _
ByVal col1 As Integer, _
ByVal col2 As Integer, _
ByVal equal As Boolean, _
ByVal extra As Integer _
)
C#
public void AutoSize(
int col1,
int col2,
bool equal,
int extra
)

Parameters
col1
col2
equal
extra

Requirements
1104

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,


Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

Clear Method
Clears a range.

Overload List
Overload

Description

Clear(ClearWhereSettings,ClearWhatSettings)
Clear(ClearWhereSettings)
Clear()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Clear(ClearWhereSettings,ClearWhatSettings) Method

Syntax

1105

Visual Basic (Declaration)


Public Overloads Sub Clear( _
ByVal where As ClearWhereSettings, _
ByVal what As ClearWhatSettings _
)
C#
public void Clear(
ClearWhereSettings where,
ClearWhatSettings what
)

Parameters
where
what

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
Clear(ClearWhereSettings) Method

Syntax
Visual Basic (Declaration)
Public Overloads Sub Clear( _
ByVal where As ClearWhereSettings _
)

1106

C#
public void Clear(
ClearWhereSettings where
)

Parameters
where

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
Clear() Method

Syntax
Visual Basic (Declaration)
Public Overloads Shadows Sub Clear()
C#
public new void Clear()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

1107

C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

ComboItem Method

Syntax
Visual Basic (Declaration)
Public Function ComboItem( _
ByVal index As Integer _
) As String
C#
public string ComboItem(
int index
)

Parameters
index

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

EditCell Method

Syntax
Visual Basic (Declaration)
Public Sub EditCell()

1108

C#
public void EditCell()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FindRow Method
Finds a row that contains a specified string.

Overload List
Overload

Description

FindRow(Object)
FindRow(String,Int32,Int32,Boolean,Boolean)
FindRow(String,Int32,Int32)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1109

FindRow(Object) Method

Syntax
Visual Basic (Declaration)
Public Overloads Function FindRow( _
ByVal item As Object _
) As Integer
C#
public int FindRow(
object item
)

Parameters
item

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
FindRow(String,Int32,Int32,Boolean,Boolean) Method

Syntax
Visual Basic (Declaration)
Public Overloads Function FindRow( _
ByVal str As String, _
ByVal row As Integer, _
ByVal col As Integer, _
ByVal caseSensitive As Boolean, _

1110

ByVal fullMatch As Boolean _


) As Integer
C#
public int FindRow(
string str,
int row,
int col,
bool caseSensitive,
bool fullMatch
)

Parameters
str
row
col
caseSensitive
fullMatch

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP
SP3, Windows Server 2008 (Server Core not supported), Windows Server
2008 R2 (Server Core supported with SP1 or later), Windows Server 2003
SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
FindRow(String,Int32,Int32) Method

Syntax
Visual Basic (Declaration)

1111

Public Overloads Function FindRow( _


ByVal str As String, _
ByVal row As Integer, _
ByVal col As Integer _
) As Integer
C#
public int FindRow(
string str,
int row,
int col
)

Parameters
str
row
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

get_Cell Method

Overload List
Overload

Description

get_Cell(CellPropertySettings,Int32,Int32,Int32,Int32)

1112

get_Cell(CellPropertySettings,Int32,Int32)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
get_Cell(CellPropertySettings,Int32,Int32,Int32,Int32) Method

Syntax
Visual Basic (Declaration)
Public Overloads Function get_Cell( _
ByVal setting As CellPropertySettings, _
ByVal row1 As Integer, _
ByVal col1 As Integer, _
ByVal row2 As Integer, _
ByVal col2 As Integer _
) As Object
C#
public object get_Cell(
CellPropertySettings setting,
int row1,
int col1,
int row2,
int col2
)

Parameters
setting
row1

1113

col1
row2
col2

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP
SP3, Windows Server 2008 (Server Core not supported), Windows Server
2008 R2 (Server Core supported with SP1 or later), Windows Server 2003
SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
get_Cell(CellPropertySettings,Int32,Int32) Method

Syntax
Visual Basic (Declaration)
Public Overloads Function get_Cell( _
ByVal setting As CellPropertySettings, _
ByVal row As Integer, _
ByVal col As Integer _
) As Object
C#
public object get_Cell(
CellPropertySettings setting,
int row,
int col
)

Parameters
setting

1114

row
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

get_ColAlignment Method

Syntax
Visual Basic (Declaration)
Public Function get_ColAlignment( _
ByVal col As Integer _
) As AlignmentSettings
C#
public AlignmentSettings get_ColAlignment(
int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
1115

Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColComboList Method

Syntax
Visual Basic (Declaration)
Public Function get_ColComboList( _
ByVal col As Integer _
) As String
C#
public string get_ColComboList(
int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColData Method

Syntax
Visual Basic (Declaration)
Public Function get_ColData( _

1116

ByVal col As Integer _


) As Object
C#
public object get_ColData(
int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColDataType Method

Syntax
Visual Basic (Declaration)
Public Function get_ColDataType( _
ByVal col As Integer _
) As Type
C#
public Type get_ColDataType(
int col
)

Parameters
col

1117

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColEditMask Method

Syntax
Visual Basic (Declaration)
Public Function get_ColEditMask( _
ByVal col As Integer _
) As String
C#
public string get_ColEditMask(
int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1118

get_ColFormat Method

Syntax
Visual Basic (Declaration)
Public Function get_ColFormat( _
ByVal col As Integer _
) As String
C#
public string get_ColFormat(
int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColHidden Method

Syntax
Visual Basic (Declaration)
Public Function get_ColHidden( _
ByVal col As Integer _
) As Boolean
C#

1119

public bool get_ColHidden(


int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColIndent Method

Syntax
Visual Basic (Declaration)
Public Function get_ColIndent( _
ByVal col As Integer _
) As Integer
C#
public int get_ColIndent(
int col
)

Parameters
col

Requirements

1120

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColIndex Method

Syntax
Visual Basic (Declaration)
Public Function get_ColIndex( _
ByVal colKey As String _
) As Integer
C#
public int get_ColIndex(
string colKey
)

Parameters
colKey

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1121

get_ColIsVisible Method

Syntax
Visual Basic (Declaration)
Public Function get_ColIsVisible( _
ByVal col As Integer _
) As Boolean
C#
public bool get_ColIsVisible(
int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColKey Method

Syntax
Visual Basic (Declaration)
Public Function get_ColKey( _
ByVal col As Integer _
) As String
C#

1122

public string get_ColKey(


int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColPos Method

Syntax
Visual Basic (Declaration)
Public Function get_ColPos( _
ByVal col As Integer _
) As Integer
C#
public int get_ColPos(
int col
)

Parameters
col

Requirements

1123

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ColSort Method

Syntax
Visual Basic (Declaration)
Public Function get_ColSort( _
ByVal col As Integer _
) As SortSettings
C#
public SortSettings get_ColSort(
int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1124

get_ColWidth Method

Syntax
Visual Basic (Declaration)
Public Function get_ColWidth( _
ByVal col As Integer _
) As Integer
C#
public int get_ColWidth(
int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_FixedAlignment Method

Syntax
Visual Basic (Declaration)
Public Function get_FixedAlignment( _
ByVal col As Integer _
) As AlignmentSettings
C#

1125

public AlignmentSettings get_FixedAlignment(


int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_IsCollapsed Method

Syntax
Visual Basic (Declaration)
Public Function get_IsCollapsed( _
ByVal row As Integer _
) As Boolean
C#
public bool get_IsCollapsed(
int row
)

Parameters
row

Requirements

1126

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_IsSelected Method

Syntax
Visual Basic (Declaration)
Public Function get_IsSelected( _
ByVal row As Integer _
) As Boolean
C#
public bool get_IsSelected(
int row
)

Parameters
row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1127

get_IsSubtotal Method

Syntax
Visual Basic (Declaration)
Public Function get_IsSubtotal( _
ByVal row As Integer _
) As Boolean
C#
public bool get_IsSubtotal(
int row
)

Parameters
row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_MergeCol Method

Syntax
Visual Basic (Declaration)
Public Function get_MergeCol( _
ByVal col As Integer _
) As Boolean
C#

1128

public bool get_MergeCol(


int col
)

Parameters
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_MergeRow Method

Syntax
Visual Basic (Declaration)
Public Function get_MergeRow( _
ByVal row As Integer _
) As Boolean
C#
public bool get_MergeRow(
int row
)

Parameters
row

Requirements

1129

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_RowData Method

Syntax
Visual Basic (Declaration)
Public Function get_RowData( _
ByVal row As Integer _
) As Object
C#
public object get_RowData(
int row
)

Parameters
row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1130

get_RowHeight Method

Syntax
Visual Basic (Declaration)
Public Function get_RowHeight( _
ByVal row As Integer _
) As Integer
C#
public int get_RowHeight(
int row
)

Parameters
row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_RowHidden Method

Syntax
Visual Basic (Declaration)
Public Function get_RowHidden( _
ByVal row As Integer _
) As Boolean
C#

1131

public bool get_RowHidden(


int row
)

Parameters
row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_RowIsVisible Method

Syntax
Visual Basic (Declaration)
Public Function get_RowIsVisible( _
ByVal row As Integer _
) As Boolean
C#
public bool get_RowIsVisible(
int row
)

Parameters
row

Requirements

1132

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_RowOutlineLevel Method

Syntax
Visual Basic (Declaration)
Public Function get_RowOutlineLevel( _
ByVal row As Integer _
) As Integer
C#
public int get_RowOutlineLevel(
int row
)

Parameters
row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1133

get_RowPos Method

Syntax
Visual Basic (Declaration)
Public Function get_RowPos( _
ByVal row As Integer _
) As Integer
C#
public int get_RowPos(
int row
)

Parameters
row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_TextMatrix Method

Syntax
Visual Basic (Declaration)
Public Function get_TextMatrix( _
ByVal r As Integer, _
ByVal c As Integer _
) As String

1134

C#
public string get_TextMatrix(
int r,
int c
)

Parameters
r
c

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

get_ValueMatrix Method

Syntax
Visual Basic (Declaration)
Public Function get_ValueMatrix( _
ByVal r As Integer, _
ByVal c As Integer _
) As Double
C#
public double get_ValueMatrix(
int r,
int c
)

Parameters

1135

r
c

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

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

Overload List
Overload

Description

GetMergedRange(Int32,Int32,Int32,Int32,Int32,Int32)
GetMergedRange(Int32,Int32,Boolean)

Returns the merged range of cells that


includes a given cell. (Inherited from
C1.Win.C1FlexGrid.C1FlexGrid)

GetMergedRange(Int32,Int32)

Returns the merged range of cells that


includes a given cell. (Inherited from
C1.Win.C1FlexGrid.C1FlexGrid)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
1136

Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
GetMergedRange(Int32,Int32,Int32,Int32,Int32,Int32) Method

Syntax
Visual Basic (Declaration)
Public Overloads Sub GetMergedRange( _
ByVal row As Integer, _
ByVal col As Integer, _
ByRef r1 As Integer, _
ByRef c1 As Integer, _
ByRef r2 As Integer, _
ByRef c2 As Integer _
)
C#
public void GetMergedRange(
int row,
int col,
out int r1,
out int c1,
out int r2,
out int c2
)

Parameters
row
col
r1
c1
r2
c2

1137

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later,
Windows XP SP3, Windows Server 2008 (Server Core not
supported), Windows Server 2008 R2 (Server Core supported with
SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

GetNode Method

Overload List
Overload

Description

GetNode(Int32)
GetNode()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
GetNode(Int32) Method

Syntax
Visual Basic (Declaration)

1138

Public Overloads Function GetNode( _


ByVal row As Integer _
) As Node
C#
public Node GetNode(
int row
)

Parameters
row

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
GetNode() Method

Syntax
Visual Basic (Declaration)
Public Overloads Function GetNode() As Node
C#
public Node GetNode()

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1139

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

GetNodeRow Method

Syntax
Visual Basic (Declaration)
Public Function GetNodeRow( _
ByVal row As Integer, _
ByVal which As NodeTypeEnum _
) As Integer
C#
public int GetNodeRow(
int row,
NodeTypeEnum which
)

Parameters
row
which

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1140

GetSelection Method

Syntax
Visual Basic (Declaration)
Public Sub GetSelection( _
ByRef row1 As Integer, _
ByRef col1 As Integer, _
ByRef row2 As Integer, _
ByRef col2 As Integer _
)
C#
public void GetSelection(
out int row1,
out int col1,
out int row2,
out int col2
)

Parameters
row1
col1
row2
col2

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1141

Outline Method

Syntax
Visual Basic (Declaration)
Public Sub Outline( _
ByVal level As Integer _
)
C#
public void Outline(
int level
)

Parameters
level

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

PrintGrid Method
Prints the grid, optionally showing a page setup or print preview dialog.

Overload List
Overload

Description

PrintGrid(String,Boolean,Int32,Int32,Int32)
PrintGrid(String,Boolean)

1142

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
PrintGrid(String,Boolean,Int32,Int32,Int32) Method

Syntax
Visual Basic (Declaration)
Public Overloads Sub PrintGrid( _
ByVal docName As String, _
ByVal showDialog As Boolean, _
ByVal orientation As Integer, _
ByVal marginLR As Integer, _
ByVal marginTB As Integer _
)
C#
public void PrintGrid(
string docName,
bool showDialog,
int orientation,
int marginLR,
int marginTB
)

Parameters
docName
showDialog
orientation

1143

marginLR
marginTB

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP
SP3, Windows Server 2008 (Server Core not supported), Windows Server
2008 R2 (Server Core supported with SP1 or later), Windows Server 2003
SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
PrintGrid(String,Boolean) Method

Syntax
Visual Basic (Declaration)
Public Overloads Sub PrintGrid( _
ByVal docName As String, _
ByVal showDialog As Boolean _
)
C#
public void PrintGrid(
string docName,
bool showDialog
)

Parameters
docName
showDialog

Requirements

1144

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

ReadXml Method
Loads the grid from an Xml document.

Overload List
Overload

Description

ReadXml(XmlDocument)
ReadXml(XmlNode)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
ReadXml(XmlDocument) Method

Syntax
Visual Basic (Declaration)
Public Overloads Overrides Sub ReadXml( _

1145

ByVal doc As XmlDocument _


)
C#
public override void ReadXml(
XmlDocument doc
)

Parameters
doc

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
ReadXml(XmlNode) Method

Syntax
Visual Basic (Declaration)
Public Overloads Overrides Sub ReadXml( _
ByVal node As XmlNode _
)
C#
public override void ReadXml(
XmlNode node
)

Parameters
node

1146

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

SelectedRow Method

Syntax
Visual Basic (Declaration)
Public Function SelectedRow( _
ByVal index As Integer _
) As Integer
C#
public int SelectedRow(
int index
)

Parameters
index

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference

1147

C1FlexGridClassic Class
C1FlexGridClassic Members

set_Cell Method

Overload List
Overload

Description

set_Cell(CellPropertySettings,Int32,Int32,Int32,Int32,Object)
set_Cell(CellPropertySettings,Int32,Int32,Object)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
set_Cell(CellPropertySettings,Int32,Int32,Int32,Int32,Object) Method

Syntax
Visual Basic (Declaration)
Public Overloads Sub set_Cell( _
ByVal setting As CellPropertySettings, _
ByVal row1 As Integer, _
ByVal col1 As Integer, _
ByVal row2 As Integer, _
ByVal col2 As Integer, _
ByVal newVal As Object _
)
C#

1148

public void set_Cell(


CellPropertySettings setting,
int row1,
int col1,
int row2,
int col2,
object newVal
)

Parameters
setting
row1
col1
row2
col2
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later,
Windows XP SP3, Windows Server 2008 (Server Core not
supported), Windows Server 2008 R2 (Server Core supported with
SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List
set_Cell(CellPropertySettings,Int32,Int32,Object) Method

Syntax
Visual Basic (Declaration)
Public Overloads Sub set_Cell( _

1149

ByVal setting As CellPropertySettings, _


ByVal row As Integer, _
ByVal col As Integer, _
ByVal newVal As Object _
)
C#
public void set_Cell(
CellPropertySettings setting,
int row,
int col,
object newVal
)

Parameters
setting
row
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

set_ColAlignment Method

Syntax
Visual Basic (Declaration)

1150

Public Sub set_ColAlignment( _


ByVal col As Integer, _
ByVal newVal As AlignmentSettings _
)
C#
public void set_ColAlignment(
int col,
AlignmentSettings newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColComboList Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColComboList( _
ByVal col As Integer, _
ByVal newVal As String _
)
C#

1151

public void set_ColComboList(


int col,
string newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColData Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColData( _
ByVal col As Integer, _
ByVal newVal As Object _
)
C#
public void set_ColData(
int col,
object newVal
)

Parameters
col

1152

newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColDataType Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColDataType( _
ByVal col As Integer, _
ByVal newVal As Type _
)
C#
public void set_ColDataType(
int col,
Type newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

1153

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColEditMask Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColEditMask( _
ByVal col As Integer, _
ByVal newVal As String _
)
C#
public void set_ColEditMask(
int col,
string newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1154

set_ColFormat Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColFormat( _
ByVal col As Integer, _
ByVal newVal As String _
)
C#
public void set_ColFormat(
int col,
string newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColHidden Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColHidden( _
ByVal col As Integer, _

1155

ByVal newVal As Boolean _


)
C#
public void set_ColHidden(
int col,
bool newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColImageList Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColImageList( _
ByVal col As Integer, _
ByVal newVal As ImageList _
)
C#
public void set_ColImageList(
int col,

1156

ImageList newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColIndent Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColIndent( _
ByVal col As Integer, _
ByVal newVal As Integer _
)
C#
public void set_ColIndent(
int col,
int newVal
)

Parameters
col
newVal

1157

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColKey Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColKey( _
ByVal col As Integer, _
ByVal newVal As String _
)
C#
public void set_ColKey(
int col,
string newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also

1158

Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColPosition Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColPosition( _
ByVal col As Integer, _
ByVal newPosition As Integer _
)
C#
public void set_ColPosition(
int col,
int newPosition
)

Parameters
col
newPosition

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColSort Method

Syntax

1159

Visual Basic (Declaration)


Public Sub set_ColSort( _
ByVal col As Integer, _
ByVal newVal As SortSettings _
)
C#
public void set_ColSort(
int col,
SortSettings newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_ColWidth Method

Syntax
Visual Basic (Declaration)
Public Sub set_ColWidth( _
ByVal col As Integer, _
ByVal newVal As Integer _
)

1160

C#
public void set_ColWidth(
int col,
int newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_FixedAlignment Method

Syntax
Visual Basic (Declaration)
Public Sub set_FixedAlignment( _
ByVal col As Integer, _
ByVal newVal As AlignmentSettings _
)
C#
public void set_FixedAlignment(
int col,
AlignmentSettings newVal
)

Parameters

1161

col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_IsCollapsed Method

Syntax
Visual Basic (Declaration)
Public Sub set_IsCollapsed( _
ByVal row As Integer, _
ByVal newVal As Boolean _
)
C#
public void set_IsCollapsed(
int row,
bool newVal
)

Parameters
row
newVal

Requirements

1162

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_IsSelected Method

Syntax
Visual Basic (Declaration)
Public Sub set_IsSelected( _
ByVal row As Integer, _
ByVal newVal As Boolean _
)
C#
public void set_IsSelected(
int row,
bool newVal
)

Parameters
row
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference

1163

C1FlexGridClassic Class
C1FlexGridClassic Members

set_IsSubtotal Method

Syntax
Visual Basic (Declaration)
Public Sub set_IsSubtotal( _
ByVal row As Integer, _
ByVal newVal As Boolean _
)
C#
public void set_IsSubtotal(
int row,
bool newVal
)

Parameters
row
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_MergeCol Method

Syntax
Visual Basic (Declaration)

1164

Public Sub set_MergeCol( _


ByVal col As Integer, _
ByVal newVal As Boolean _
)
C#
public void set_MergeCol(
int col,
bool newVal
)

Parameters
col
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_MergeRow Method

Syntax
Visual Basic (Declaration)
Public Sub set_MergeRow( _
ByVal row As Integer, _
ByVal newVal As Boolean _
)
C#

1165

public void set_MergeRow(


int row,
bool newVal
)

Parameters
row
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_RowData Method

Syntax
Visual Basic (Declaration)
Public Sub set_RowData( _
ByVal row As Integer, _
ByVal newVal As Object _
)
C#
public void set_RowData(
int row,
object newVal
)

Parameters
row

1166

newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_RowHeight Method

Syntax
Visual Basic (Declaration)
Public Sub set_RowHeight( _
ByVal row As Integer, _
ByVal newVal As Integer _
)
C#
public void set_RowHeight(
int row,
int newVal
)

Parameters
row
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

1167

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_RowHidden Method

Syntax
Visual Basic (Declaration)
Public Sub set_RowHidden( _
ByVal row As Integer, _
ByVal newVal As Boolean _
)
C#
public void set_RowHidden(
int row,
bool newVal
)

Parameters
row
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1168

set_RowOutlineLevel Method

Syntax
Visual Basic (Declaration)
Public Sub set_RowOutlineLevel( _
ByVal row As Integer, _
ByVal newVal As Integer _
)
C#
public void set_RowOutlineLevel(
int row,
int newVal
)

Parameters
row
newVal

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_RowPosition Method

Syntax
Visual Basic (Declaration)
Public Sub set_RowPosition( _
ByVal row As Integer, _

1169

ByVal newPosition As Integer _


)
C#
public void set_RowPosition(
int row,
int newPosition
)

Parameters
row
newPosition

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows
Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core
supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

set_TextMatrix Method

Syntax
Visual Basic (Declaration)
Public Sub set_TextMatrix( _
ByVal r As Integer, _
ByVal c As Integer, _
ByVal s As String _
)
C#
public void set_TextMatrix(

1170

int r,
int c,
string s
)

Parameters
r
c
s

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

WriteXml Method
Saves the grid contents to an Xml document.

Overload List
Overload

Description

WriteXml(XmlTextWriter)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference

1171

C1FlexGridClassic Class
C1FlexGridClassic Members
WriteXml(XmlTextWriter) Method

Syntax
Visual Basic (Declaration)
Public Overloads Overrides Sub WriteXml( _
ByVal w As XmlTextWriter _
)
C#
public override void WriteXml(
XmlTextWriter w
)

Parameters
w

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server
2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1
or later), Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members
Overload List

Properties
For a list of all members of this type, see C1FlexGridClassic members.

Public Properties
Name

Description

1172

AccessibilityObject

(Inherited from System.Windows.Forms.Control)

AccessibleDefaultActionDescription (Inherited from System.Windows.Forms.Control)


AccessibleDescription

(Inherited from System.Windows.Forms.Control)

AccessibleName

(Inherited from System.Windows.Forms.Control)

AccessibleRole

(Inherited from System.Windows.Forms.Control)

AllowBigSelection
AllowDragging
AllowEditing
AllowMerging
AllowMergingFixed

Gets or sets how non-scrollable cells should be merged.


(Inherited from C1.Win.C1FlexGrid.C1FlexGrid)

AllowResizing
AllowSelection
AllowSorting
AllowUserResizing
Anchor

(Inherited from System.Windows.Forms.Control)

AutoScrollOffset

(Inherited from System.Windows.Forms.Control)

AutoSizeMode

1173

BackColorAlternate
BackColorBkg
BackColorFixed
BackColorSel
BackgroundImage
BackgroundImageLayout

(Inherited from System.Windows.Forms.Control)

BindingContext

(Inherited from System.Windows.Forms.Control)

Bottom

(Inherited from System.Windows.Forms.Control)

Bounds

(Inherited from System.Windows.Forms.Control)

CanFocus

(Inherited from System.Windows.Forms.Control)

CanSelect

(Inherited from System.Windows.Forms.Control)

Capture

(Inherited from System.Windows.Forms.Control)

CausesValidation

(Inherited from System.Windows.Forms.Control)

Cell
CellAlignment
CellBackColor
CellButtonImage
CellButtonPicture

1174

CellChecked
CellFont
CellFontBold
CellFontItalic
CellFontName
CellFontSize
CellFontStrikethru
CellFontUnderline
CellForeColor
CellHeight
CellLeft
CellPicture
CellPictureAlignment
CellTextStyle
CellTop
CellWidth
ClientRectangle

(Inherited from System.Windows.Forms.Control)

ClientSize

(Inherited from System.Windows.Forms.Control)

1175

Cols
ColumnCollection
ColWidthMax
ColWidthMin
ComboCount
ComboIndex
CompanyName

(Inherited from System.Windows.Forms.Control)

Container

(Inherited from System.ComponentModel.Component)

ContainsFocus

(Inherited from System.Windows.Forms.Control)

ContextMenu

(Inherited from System.Windows.Forms.Control)

ContextMenuStrip

(Inherited from System.Windows.Forms.Control)

Controls

(Inherited from System.Windows.Forms.Control)

Created

(Inherited from System.Windows.Forms.Control)

Cursor

(Inherited from System.Windows.Forms.Control)

DataBindings

(Inherited from System.Windows.Forms.Control)

DisplayRectangle

(Inherited from System.Windows.Forms.Control)

Disposing

(Inherited from System.Windows.Forms.Control)

Dock

(Inherited from System.Windows.Forms.Control)

1176

Editable
EditSelLength
EditSelStart
EditSelText
EditText
EditWindow
Ellipsis
Enabled

(Inherited from System.Windows.Forms.Control)

ExplorerBar
FillStyle
FixedCols
FixedRows
Focused

(Inherited from System.Windows.Forms.Control)

Font

(Inherited from System.Windows.Forms.Control)

FontBold
FontItalic
FontName
FontSize

1177

FontStrikethru
FontUnderline
ForeColorFixed
ForeColorSel
FrozenCols
FrozenRows
GridColor
GridColorFixed
GridLines
GridLinesFixed
GridLineWidth
Handle

(Inherited from System.Windows.Forms.Control)

HasChildren

(Inherited from System.Windows.Forms.Control)

Height

(Inherited from System.Windows.Forms.Control)

ImeMode

(Inherited from System.Windows.Forms.Control)

InvokeRequired

(Inherited from System.Windows.Forms.Control)

IsAccessible

(Inherited from System.Windows.Forms.Control)

IsDisposed

(Inherited from System.Windows.Forms.Control)

1178

IsHandleCreated

(Inherited from System.Windows.Forms.Control)

IsMirrored

(Inherited from System.Windows.Forms.Control)

KeyActionEnter
KeyActionTab
LayoutEngine

(Inherited from System.Windows.Forms.Control)

Left

(Inherited from System.Windows.Forms.Control)

Location

(Inherited from System.Windows.Forms.Control)

Margin

(Inherited from System.Windows.Forms.Control)

MaximumSize

(Inherited from System.Windows.Forms.Control)

MergeCells
MergedRanges

Gets the C1.Win.C1FlexGrid.CellRangeCollection that


determines which grid cells are merged when the
AllowMerging property is set to
C1.Win.C1FlexGrid.AllowMergingEnum.Custom. (Inherited
from C1.Win.C1FlexGrid.C1FlexGrid)

MinimumSize

(Inherited from System.Windows.Forms.Control)

Name

(Inherited from System.Windows.Forms.Control)

NodeClosedPicture
NodeOpenPicture
OutlineBar

1179

OutlineCol
Padding

(Inherited from System.Windows.Forms.Control)

Parent

(Inherited from System.Windows.Forms.Control)

Picture
PicturesOver
PreferredSize

(Inherited from System.Windows.Forms.Control)

ProductName

(Inherited from System.Windows.Forms.Control)

ProductVersion

(Inherited from System.Windows.Forms.Control)

RecreatingHandle

(Inherited from System.Windows.Forms.Control)

Redraw
Region

(Inherited from System.Windows.Forms.Control)

Right

(Inherited from System.Windows.Forms.Control)

RightToLeft

(Inherited from System.Windows.Forms.Control)

RowHeightMax
RowHeightMin
Rows
SelectedRows
SelectionMode

1180

SheetBorder
Site

(Inherited from System.Windows.Forms.Control)

Size

(Inherited from System.Windows.Forms.Control)

Sort
Styles
TabBehavior
TabIndex

(Inherited from System.Windows.Forms.Control)

TabStop

(Inherited from System.Windows.Forms.Control)

Tag

(Inherited from System.Windows.Forms.Control)

Text

Overridden.

TextStyle
TextStyleFixed
Top

(Inherited from System.Windows.Forms.Control)

TopLevelControl

(Inherited from System.Windows.Forms.Control)

TreeColor
UseWaitCursor

(Inherited from System.Windows.Forms.Control)

Value
Visible

(Inherited from System.Windows.Forms.Control)

1181

WallPaper
Width

(Inherited from System.Windows.Forms.Control)

WordWrap
Top

See Also
Reference
C1FlexGridClassic Class
C1.Win.C1FlexGrid.Classic Namespace

AllowBigSelection Property

Syntax
Visual Basic (Declaration)
Public Property AllowBigSelection As Boolean
C#
public bool AllowBigSelection {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

AllowDragging Property

Syntax

1182

Visual Basic (Declaration)


Public Shadows Property AllowDragging As AllowDraggingEnum
C#
public new AllowDraggingEnum AllowDragging {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

AllowEditing Property

Syntax
Visual Basic (Declaration)
Public Shadows Property AllowEditing As Boolean
C#
public new bool AllowEditing {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1183

AllowMerging Property

Syntax
Visual Basic (Declaration)
Public Shadows Property AllowMerging As AllowMergingEnum
C#
public new AllowMergingEnum AllowMerging {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

AllowResizing Property

Syntax
Visual Basic (Declaration)
Public Shadows Property AllowResizing As AllowResizingEnum
C#
public new AllowResizingEnum AllowResizing {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
1184

C1FlexGridClassic Class
C1FlexGridClassic Members

AllowSelection Property

Syntax
Visual Basic (Declaration)
Public Property AllowSelection As Boolean
C#
public bool AllowSelection {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

AllowSorting Property

Syntax
Visual Basic (Declaration)
Public Shadows Property AllowSorting As AllowSortingEnum
C#
public new AllowSortingEnum AllowSorting {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1185

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

AllowUserResizing Property

Syntax
Visual Basic (Declaration)
Public Property AllowUserResizing As AllowUserResizeSettings
C#
public AllowUserResizeSettings AllowUserResizing {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

AutoSizeMode Property

Syntax
Visual Basic (Declaration)
Public Property AutoSizeMode As AutoSizeSettings
C#
public AutoSizeSettings AutoSizeMode {get; set;}

Requirements

1186

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

BackColorAlternate Property

Syntax
Visual Basic (Declaration)
Public Property BackColorAlternate As Color
C#
public Color BackColorAlternate {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

BackColorBkg Property

Syntax
Visual Basic (Declaration)
Public Property BackColorBkg As Color
C#

1187

public Color BackColorBkg {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

BackColorFixed Property

Syntax
Visual Basic (Declaration)
Public Property BackColorFixed As Color
C#
public Color BackColorFixed {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

BackColorSel Property

Syntax
Visual Basic (Declaration)

1188

Public Property BackColorSel As Color


C#
public Color BackColorSel {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

BackgroundImage Property

Syntax
Visual Basic (Declaration)
Public Shadows Property BackgroundImage As Image
C#
public new Image BackgroundImage {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1189

Cell Property

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Cell As Cell
C#
public Cell Cell {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellAlignment Property

Syntax
Visual Basic (Declaration)
Public Property CellAlignment As AlignmentSettings
C#
public AlignmentSettings CellAlignment {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
1190

C1FlexGridClassic Class
C1FlexGridClassic Members

CellBackColor Property

Syntax
Visual Basic (Declaration)
Public Property CellBackColor As Color
C#
public Color CellBackColor {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellButtonImage Property

Syntax
Visual Basic (Declaration)
Public Shadows Property CellButtonImage As Image
C#
public new Image CellButtonImage {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1191

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellButtonPicture Property

Syntax
Visual Basic (Declaration)
Public Property CellButtonPicture As Image
C#
public Image CellButtonPicture {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellChecked Property

Syntax
Visual Basic (Declaration)
Public Property CellChecked As CellCheckedSettings
C#
public CellCheckedSettings CellChecked {get; set;}

Requirements

1192

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellFont Property

Syntax
Visual Basic (Declaration)
Public Property CellFont As Font
C#
public Font CellFont {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellFontBold Property

Syntax
Visual Basic (Declaration)
Public Property CellFontBold As Boolean
C#

1193

public bool CellFontBold {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellFontItalic Property

Syntax
Visual Basic (Declaration)
Public Property CellFontItalic As Boolean
C#
public bool CellFontItalic {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellFontName Property

Syntax
Visual Basic (Declaration)

1194

Public Property CellFontName As String


C#
public string CellFontName {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellFontSize Property

Syntax
Visual Basic (Declaration)
Public Property CellFontSize As Single
C#
public float CellFontSize {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1195

CellFontStrikethru Property

Syntax
Visual Basic (Declaration)
Public Property CellFontStrikethru As Boolean
C#
public bool CellFontStrikethru {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellFontUnderline Property

Syntax
Visual Basic (Declaration)
Public Property CellFontUnderline As Boolean
C#
public bool CellFontUnderline {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
1196

C1FlexGridClassic Class
C1FlexGridClassic Members

CellForeColor Property

Syntax
Visual Basic (Declaration)
Public Property CellForeColor As Color
C#
public Color CellForeColor {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellHeight Property

Syntax
Visual Basic (Declaration)
Public ReadOnly Property CellHeight As Integer
C#
public int CellHeight {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1197

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellLeft Property

Syntax
Visual Basic (Declaration)
Public ReadOnly Property CellLeft As Integer
C#
public int CellLeft {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellPicture Property

Syntax
Visual Basic (Declaration)
Public Property CellPicture As Image
C#
public Image CellPicture {get; set;}

Requirements

1198

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellPictureAlignment Property

Syntax
Visual Basic (Declaration)
Public Property CellPictureAlignment As PictureAlignmentSettings
C#
public PictureAlignmentSettings CellPictureAlignment {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellTextStyle Property

Syntax
Visual Basic (Declaration)
Public Property CellTextStyle As TextStyleSettings
C#

1199

public TextStyleSettings CellTextStyle {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellTop Property

Syntax
Visual Basic (Declaration)
Public ReadOnly Property CellTop As Integer
C#
public int CellTop {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

CellWidth Property

Syntax
Visual Basic (Declaration)

1200

Public ReadOnly Property CellWidth As Integer


C#
public int CellWidth {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Cols Property

Syntax
Visual Basic (Declaration)
Public Shadows Property Cols As Integer
C#
public new int Cols {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1201

ColumnCollection Property

Syntax
Visual Basic (Declaration)
Public Property ColumnCollection As ColumnCollection
C#
public ColumnCollection ColumnCollection {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

ColWidthMax Property

Syntax
Visual Basic (Declaration)
Public Property ColWidthMax As Integer
C#
public int ColWidthMax {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
1202

C1FlexGridClassic Class
C1FlexGridClassic Members

ColWidthMin Property

Syntax
Visual Basic (Declaration)
Public Property ColWidthMin As Integer
C#
public int ColWidthMin {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

ComboCount Property

Syntax
Visual Basic (Declaration)
Public ReadOnly Property ComboCount As Integer
C#
public int ComboCount {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1203

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

ComboIndex Property

Syntax
Visual Basic (Declaration)
Public Property ComboIndex As Integer
C#
public int ComboIndex {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Editable Property

Syntax
Visual Basic (Declaration)
Public Property Editable As EditableSettings
C#
public EditableSettings Editable {get; set;}

Requirements

1204

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

EditSelLength Property

Syntax
Visual Basic (Declaration)
Public Property EditSelLength As Integer
C#
public int EditSelLength {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

EditSelStart Property

Syntax
Visual Basic (Declaration)
Public Property EditSelStart As Integer
C#

1205

public int EditSelStart {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

EditSelText Property

Syntax
Visual Basic (Declaration)
Public Property EditSelText As String
C#
public string EditSelText {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

EditText Property

Syntax
Visual Basic (Declaration)

1206

Public Property EditText As String


C#
public string EditText {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

EditWindow Property

Syntax
Visual Basic (Declaration)
Public ReadOnly Property EditWindow As IntPtr
C#
public IntPtr EditWindow {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1207

Ellipsis Property

Syntax
Visual Basic (Declaration)
Public Property Ellipsis As EllipsisSettings
C#
public EllipsisSettings Ellipsis {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

ExplorerBar Property

Syntax
Visual Basic (Declaration)
Public Property ExplorerBar As ExplorerBarSettings
C#
public ExplorerBarSettings ExplorerBar {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
1208

C1FlexGridClassic Class
C1FlexGridClassic Members

FillStyle Property

Syntax
Visual Basic (Declaration)
Public Property FillStyle As FillStyleSettings
C#
public FillStyleSettings FillStyle {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FixedCols Property

Syntax
Visual Basic (Declaration)
Public Property FixedCols As Integer
C#
public int FixedCols {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1209

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FixedRows Property

Syntax
Visual Basic (Declaration)
Public Property FixedRows As Integer
C#
public int FixedRows {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FontBold Property

Syntax
Visual Basic (Declaration)
Public Property FontBold As Boolean
C#
public bool FontBold {get; set;}

Requirements

1210

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FontItalic Property

Syntax
Visual Basic (Declaration)
Public Property FontItalic As Boolean
C#
public bool FontItalic {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FontName Property

Syntax
Visual Basic (Declaration)
Public Property FontName As String
C#

1211

public string FontName {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FontSize Property

Syntax
Visual Basic (Declaration)
Public Property FontSize As Single
C#
public float FontSize {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FontStrikethru Property

Syntax
Visual Basic (Declaration)

1212

Public Property FontStrikethru As Boolean


C#
public bool FontStrikethru {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FontUnderline Property

Syntax
Visual Basic (Declaration)
Public Property FontUnderline As Boolean
C#
public bool FontUnderline {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1213

ForeColorFixed Property

Syntax
Visual Basic (Declaration)
Public Property ForeColorFixed As Color
C#
public Color ForeColorFixed {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

ForeColorSel Property

Syntax
Visual Basic (Declaration)
Public Property ForeColorSel As Color
C#
public Color ForeColorSel {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
1214

C1FlexGridClassic Class
C1FlexGridClassic Members

FrozenCols Property

Syntax
Visual Basic (Declaration)
Public Property FrozenCols As Integer
C#
public int FrozenCols {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

FrozenRows Property

Syntax
Visual Basic (Declaration)
Public Property FrozenRows As Integer
C#
public int FrozenRows {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1215

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

GridColor Property

Syntax
Visual Basic (Declaration)
Public Property GridColor As Color
C#
public Color GridColor {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

GridColorFixed Property

Syntax
Visual Basic (Declaration)
Public Property GridColorFixed As Color
C#
public Color GridColorFixed {get; set;}

Requirements

1216

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

GridLines Property

Syntax
Visual Basic (Declaration)
Public Property GridLines As GridStyleSettings
C#
public GridStyleSettings GridLines {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

GridLinesFixed Property

Syntax
Visual Basic (Declaration)
Public Property GridLinesFixed As GridStyleSettings
C#

1217

public GridStyleSettings GridLinesFixed {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

GridLineWidth Property

Syntax
Visual Basic (Declaration)
Public Property GridLineWidth As Integer
C#
public int GridLineWidth {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

KeyActionEnter Property

Syntax
Visual Basic (Declaration)

1218

Public Shadows Property KeyActionEnter As KeyActionEnum


C#
public new KeyActionEnum KeyActionEnter {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

KeyActionTab Property

Syntax
Visual Basic (Declaration)
Public Shadows Property KeyActionTab As KeyActionEnum
C#
public new KeyActionEnum KeyActionTab {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1219

MergeCells Property

Syntax
Visual Basic (Declaration)
Public Property MergeCells As MergeSettings
C#
public MergeSettings MergeCells {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

NodeClosedPicture Property

Syntax
Visual Basic (Declaration)
Public Property NodeClosedPicture As Image
C#
public Image NodeClosedPicture {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
1220

C1FlexGridClassic Class
C1FlexGridClassic Members

NodeOpenPicture Property

Syntax
Visual Basic (Declaration)
Public Property NodeOpenPicture As Image
C#
public Image NodeOpenPicture {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

OutlineBar Property

Syntax
Visual Basic (Declaration)
Public Property OutlineBar As OutlineBarSettings
C#
public OutlineBarSettings OutlineBar {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1221

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

OutlineCol Property

Syntax
Visual Basic (Declaration)
Public Property OutlineCol As Integer
C#
public int OutlineCol {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Picture Property

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Picture As Image
C#
public Image Picture {get;}

Requirements

1222

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

PicturesOver Property

Syntax
Visual Basic (Declaration)
Public Property PicturesOver As Boolean
C#
public bool PicturesOver {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Redraw Property

Syntax
Visual Basic (Declaration)
Public Shadows Property Redraw As RedrawSettings
C#

1223

public new RedrawSettings Redraw {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

RowHeightMax Property

Syntax
Visual Basic (Declaration)
Public Property RowHeightMax As Integer
C#
public int RowHeightMax {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

RowHeightMin Property

Syntax
Visual Basic (Declaration)

1224

Public Property RowHeightMin As Integer


C#
public int RowHeightMin {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Rows Property

Syntax
Visual Basic (Declaration)
Public Shadows Property Rows As Integer
C#
public new int Rows {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1225

SelectedRows Property

Syntax
Visual Basic (Declaration)
Public ReadOnly Property SelectedRows As Integer
C#
public int SelectedRows {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

SelectionMode Property

Syntax
Visual Basic (Declaration)
Public Shadows Property SelectionMode As SelModeSettings
C#
public new SelModeSettings SelectionMode {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
1226

C1FlexGridClassic Class
C1FlexGridClassic Members

SheetBorder Property

Syntax
Visual Basic (Declaration)
Public Property SheetBorder As Color
C#
public Color SheetBorder {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Sort Property

Syntax
Visual Basic (Declaration)
Public WriteOnly Property Sort As SortSettings
C#
public SortSettings Sort {set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

1227

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Styles Property

Syntax
Visual Basic (Declaration)
Public Shadows Property Styles As CellStyleCollection
C#
public new CellStyleCollection Styles {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

TabBehavior Property

Syntax
Visual Basic (Declaration)
Public Property TabBehavior As TabBehaviorSettings
C#
public TabBehaviorSettings TabBehavior {get; set;}

Requirements

1228

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Text Property

Syntax
Visual Basic (Declaration)
Public Overrides Property Text As String
C#
public override string Text {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

TextStyle Property

Syntax
Visual Basic (Declaration)
Public Property TextStyle As TextStyleSettings
C#

1229

public TextStyleSettings TextStyle {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

TextStyleFixed Property

Syntax
Visual Basic (Declaration)
Public Property TextStyleFixed As TextStyleSettings
C#
public TextStyleSettings TextStyleFixed {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

TreeColor Property

Syntax
Visual Basic (Declaration)

1230

Public Property TreeColor As Color


C#
public Color TreeColor {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

Value Property

Syntax
Visual Basic (Declaration)
Public ReadOnly Property Value As Double
C#
public double Value {get;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

1231

WallPaper Property

Syntax
Visual Basic (Declaration)
Public Property WallPaper As Image
C#
public Image WallPaper {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1FlexGridClassic Class
C1FlexGridClassic Members

WordWrap Property

Syntax
Visual Basic (Declaration)
Public Property WordWrap As Boolean
C#
public bool WordWrap {get; set;}

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
1232

C1FlexGridClassic Class
C1FlexGridClassic Members

Cell

Object Model

Syntax
Visual Basic (Declaration)
Public Class Cell
C#
public class Cell

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.Classic.Cell

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Cell Members
C1.Win.C1FlexGrid.Classic Namespace

Overview

Object Model

Syntax

1233

Visual Basic (Declaration)


Public Class Cell
C#
public class Cell

Inheritance Hierarchy
System.Object
C1.Win.C1FlexGrid.Classic.Cell

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Cell Members
C1.Win.C1FlexGrid.Classic Namespace

Members
Properties

The following tables list the members exposed by Cell.

Public Properties
Name

Description

Item

Overloaded.

Top

See Also
Reference

1234

Cell Class
C1.Win.C1FlexGrid.Classic Namespace

Properties
For a list of all members of this type, see Cell members.

Public Properties
Name

Description

Item

Overloaded.

Top

See Also
Reference
Cell Class
C1.Win.C1FlexGrid.Classic Namespace

Item Property

Overload List
Overload

Description

Item(CellPropertySettings,Int32,Int32,Int32,Int32)
Item(CellPropertySettings,Int32,Int32)

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
Cell Class
Cell Members

1235

Item(CellPropertySettings,Int32,Int32,Int32,Int32) Property

Syntax
Visual Basic (Declaration)
Public Overloads Property Item( _
ByVal setting As CellPropertySettings, _
ByVal row1 As Integer, _
ByVal col1 As Integer, _
ByVal row2 As Integer, _
ByVal col2 As Integer _
) As Object
C#
public object Item(
CellPropertySettings setting,
int row1,
int col1,
int row2,
int col2
) {get; set;}

Parameters
setting
row1
col1
row2
col2

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP
SP3, Windows Server 2008 (Server Core not supported), Windows Server
2008 R2 (Server Core supported with SP1 or later), Windows Server 2003
SP2

See Also

1236

Reference
Cell Class
Cell Members
Overload List
Item(CellPropertySettings,Int32,Int32) Property

Syntax
Visual Basic (Declaration)
Public Overloads Property Item( _
ByVal setting As CellPropertySettings, _
ByVal row As Integer, _
ByVal col As Integer _
) As Object
C#
public object Item(
CellPropertySettings setting,
int row,
int col
) {get; set;}

Parameters
setting
row
col

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3,
Windows Server 2008 (Server Core not supported), Windows Server 2008 R2
(Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also
Reference

1237

Cell Class
Cell Members
Overload List

Enumerations
AlignmentSettings

Syntax
Visual Basic (Declaration)
Public Enum AlignmentSettings
Inherits System.Enum
C#
public enum AlignmentSettings : System.Enum

Members
Member

Description

flexAlignCenterBottom
flexAlignCenterCenter
flexAlignCenterTop
flexAlignGeneral
flexAlignLeftBottom
flexAlignLeftCenter
flexAlignLeftTop
flexAlignRightBottom
flexAlignRightCenter

1238

flexAlignRightTop

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.AlignmentSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

AllowUserResizeSettings

Syntax
Visual Basic (Declaration)
Public Enum AllowUserResizeSettings
Inherits System.Enum
C#
public enum AllowUserResizeSettings : System.Enum

Members
Member

Description

flexResizeBoth
flexResizeBothUniform

1239

flexResizeColumns
flexResizeNone
flexResizeRows
flexResizeRowsUniform

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.AllowUserResizeSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

AutoSizeSettings

Syntax
Visual Basic (Declaration)
Public Enum AutoSizeSettings
Inherits System.Enum
C#
public enum AutoSizeSettings : System.Enum

Members

1240

Member

Description

flexAutoSizeColWidth
flexAutoSizeRowHeight

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.AutoSizeSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

CellCheckedSettings

Syntax
Visual Basic (Declaration)
Public Enum CellCheckedSettings
Inherits System.Enum
C#
public enum CellCheckedSettings : System.Enum

Members
Member

Description

1241

flexChecked
flexNoCheckbox
flexTSChecked
flexTSGrayed
flexTSUnchecked
flexUnchecked

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.CellCheckedSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

CellPropertySettings

Syntax
Visual Basic (Declaration)
Public Enum CellPropertySettings
Inherits System.Enum
C#

1242

public enum CellPropertySettings : System.Enum

Members
Member

Description

flexcpAlignment
flexcpBackColor
flexcpChecked
flexcpCustomFormat
flexcpData
flexcpFloodColor
flexcpFloodPercent
flexcpFont
flexcpFontBold
flexcpFontItalic
flexcpFontName
flexcpFontSize
flexcpFontStrikethru
flexcpFontUnderline
flexcpFontWidth

1243

flexcpForeColor
flexcpHeight
flexcpLeft
flexcpPicture
flexcpPictureAlignment
flexcpRefresh
flexcpSort
flexcpText
flexcpTextDisplay
flexcpTextStyle
flexcpTop
flexcpValue
flexcpVariantValue
flexcpWidth

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.CellPropertySettings

Requirements

1244

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

ClearWhatSettings

Syntax
Visual Basic (Declaration)
Public Enum ClearWhatSettings
Inherits System.Enum
C#
public enum ClearWhatSettings : System.Enum

Members
Member

Description

flexClearData
flexClearEverything
flexClearFormatting
flexClearText

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.ClearWhatSettings

1245

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

ClearWhereSettings

Syntax
Visual Basic (Declaration)
Public Enum ClearWhereSettings
Inherits System.Enum
C#
public enum ClearWhereSettings : System.Enum

Members
Member

Description

flexClearEverywhere
flexClearScrollable
flexClearSelection

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.ClearWhereSettings

Requirements
1246

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

EditableSettings

Syntax
Visual Basic (Declaration)
Public Enum EditableSettings
Inherits System.Enum
C#
public enum EditableSettings : System.Enum

Members
Member

Description

flexEDKbd
flexEDKbdMouse
flexEDNone

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.EditableSettings

Requirements

1247

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

EllipsisSettings

Syntax
Visual Basic (Declaration)
Public Enum EllipsisSettings
Inherits System.Enum
C#
public enum EllipsisSettings : System.Enum

Members
Member

Description

flexEllipsisEnd
flexEllipsisPath
flexNoEllipsis

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.EllipsisSettings

Requirements

1248

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

ExplorerBarSettings

Syntax
Visual Basic (Declaration)
Public Enum ExplorerBarSettings
Inherits System.Enum
C#
public enum ExplorerBarSettings : System.Enum

Members
Member

Description

flexExMove
flexExMoveRows
flexExNone
flexExSort
flexExSortAndMove
flexExSortShow
flexExSortShowAndMove

1249

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.ExplorerBarSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

FillStyleSettings

Syntax
Visual Basic (Declaration)
Public Enum FillStyleSettings
Inherits System.Enum
C#
public enum FillStyleSettings : System.Enum

Members
Member

Description

flexFillRepeat
flexFillSingle

Inheritance Hierarchy

1250

System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.FillStyleSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

GridStyleSettings

Syntax
Visual Basic (Declaration)
Public Enum GridStyleSettings
Inherits System.Enum
C#
public enum GridStyleSettings : System.Enum

Members
Member

Description

flexGridExcel
flexGridExplorer
flexGridFlat
flexGridFlatHorz

1251

flexGridFlatVert
flexGridInset
flexGridInsetHorz
flexGridInsetVert
flexGridNone
flexGridRaised
flexGridRaisedHorz
flexGridRaisedVert
flexGridSkipHorz
flexGridSkipVert

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.GridStyleSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

1252

MergeSettings

Syntax
Visual Basic (Declaration)
Public Enum MergeSettings
Inherits System.Enum
C#
public enum MergeSettings : System.Enum

Members
Member

Description

flexMergeFixedOnly
flexMergeFree
flexMergeNever
flexMergeOutline
flexMergeRestrictAll
flexMergeRestrictColumns
flexMergeRestrictRows
flexMergeSpill

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.MergeSettings

1253

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

OutlineBarSettings

Syntax
Visual Basic (Declaration)
Public Enum OutlineBarSettings
Inherits System.Enum
C#
public enum OutlineBarSettings : System.Enum

Members
Member

Description

flexOutlineBarComplete
flexOutlineBarCompleteLeaf
flexOutlineBarNone
flexOutlineBarSimple
flexOutlineBarSimpleLeaf
flexOutlineBarSymbols

1254

flexOutlineBarSymbolsLeaf

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.OutlineBarSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

PictureAlignmentSettings

Syntax
Visual Basic (Declaration)
Public Enum PictureAlignmentSettings
Inherits System.Enum
C#
public enum PictureAlignmentSettings : System.Enum

Members
Member

Description

flexPicAlignCenterBottom
flexPicAlignCenterCenter

1255

flexPicAlignCenterTop
flexPicAlignLeftBottom
flexPicAlignLeftCenter
flexPicAlignLeftTop
flexPicAlignRightBottom
flexPicAlignRightCenter
flexPicAlignRightTop
flexPicAlignStretch
flexPicAlignTile

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.PictureAlignmentSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

RedrawSettings

Syntax

1256

Visual Basic (Declaration)


Public Enum RedrawSettings
Inherits System.Enum
C#
public enum RedrawSettings : System.Enum

Members
Member

Description

flexRDBuffered
flexRDDirect
flexRDNone

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.RedrawSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

SelModeSettings

Syntax

1257

Visual Basic (Declaration)


Public Enum SelModeSettings
Inherits System.Enum
C#
public enum SelModeSettings : System.Enum

Members
Member

Description

flexSelectionByColumn
flexSelectionByRow
flexSelectionFree
flexSelectionListBox

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.SelModeSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

1258

SortSettings

Syntax
Visual Basic (Declaration)
Public Enum SortSettings
Inherits System.Enum
C#
public enum SortSettings : System.Enum

Members
Member

Description

flexSortCustom
flexSortGenericAscending
flexSortGenericDescending
flexSortNone
flexSortNumericAscending
flexSortNumericDescending
flexSortStringAscending
flexSortStringDescending
flexSortStringNoCaseAscending
flexSortStringNoCaseDescending
flexSortUseColSort

1259

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.SortSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

TabBehaviorSettings

Syntax
Visual Basic (Declaration)
Public Enum TabBehaviorSettings
Inherits System.Enum
C#
public enum TabBehaviorSettings : System.Enum

Members
Member

Description

flexTabCells
flexTabControls

Inheritance Hierarchy

1260

System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.TabBehaviorSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

TextStyleSettings

Syntax
Visual Basic (Declaration)
Public Enum TextStyleSettings
Inherits System.Enum
C#
public enum TextStyleSettings : System.Enum

Members
Member

Description

flexTextFlat
flexTextInset
flexTextInsetLight
flexTextRaised

1261

flexTextRaisedLight

Inheritance Hierarchy
System.Object
System.ValueType
System.Enum
C1.Win.C1FlexGrid.Classic.TextStyleSettings

Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008
(Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later),
Windows Server 2003 SP2

See Also
Reference
C1.Win.C1FlexGrid.Classic Namespace

1262

S-ar putea să vă placă și