FlexGrid for WinForms
Cell Appearance
Show AllShow All
Hide AllHide All

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.

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

To write code in C#

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

To write code in C#

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

To write code in C#

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.

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback