Home Products Downloads Purchase Support Forum About Blog

How to customize cell styles in VIBlend DataGridView for WinForms

by viblend 27. July 2010 04:17

Each cell within the VIBlend WinForms DataGridView control can have its own style. A cell style can modify properties like text format, background color, foreground color, border color, and font. In most cases multiple cells will share particular style characteristics. To customize a cell style, start by creating a new instance of the GridCellStyle class.

GridCellStyle cellStyle = new GridCellStyle();

The next step is to set the appropriate values for each Style propoperty:

FillStyle cellFillStyle = new FillStyleGradientEx(Color.Aqua, Color.Aqua, Color.Aqua, Color.Aqua,
90, 0.7f, 0.7f);

cellStyle.TextColor = Color.Black;
cellStyle.TextColorSelected = Color.Black;
cellStyle.Font = this.Font;
cellStyle.FillStyle = cellFillStyle;
cellStyle.FillStyleSelected = cellFillStyle;
cellStyle.BorderColorSelected = Color.Transparent;
cellStyle.BorderColor = Color.Transparent;

 Finally, apply the style to one or more grid cells:

HierarchyItem rowItem = this.Grid1.RowsHierarchy.Items[1];
HierarchyItem colItem = this.Grid1.ColumnsHierarchy.Items[1];
this.Grid1.CellsArea.SetCellDrawStyle(rowItem, colItem, cellStyle); 

You can also apply a cell style to all grid cells in any row:

          HierarchyItem rowItem = this.Grid1.RowsHierarchy.Items[1];

rowItem.CellsStyle = cellStyle;

Similarily, you can apply a cell style to all grid cells in any column:
HierarchyItem colItem = this.Grid1.ColumnsHierarchy.Items[1];
colItem.CellsStyle = cellStyle;

What's new in VIBlend DataGridView for WinForms?

by viblend 13. July 2010 09:20

In the latest release of VIBlend Controls for WinForms, we introduced several new features in our DataGridView control. These are the Rows Grouping panel and the Column Chooser. The main purpose of the Rows Grouping panel is to allow you to easily group/ungroup columns via a built-in drag and drop and to visually represent the grouped columns.

The Column Chooser is an additional small feature which allows you to manage the visibility of your columns.  In order to activate the column chooser, set the EnableColumnChooser property to true. To show the column chooser, use the ShowColumnChooser method. If you want to hide it, use the HideColumnChooser method.

Another improvement in the DataGridView is the extended functionality of the ComboBox and DateTimePicker editors. Their pop up controls are now automatically opened when the editor is activated.  If you want to disable this feature, you can set the AutoOpenEditorOnActivation property of the editor to false.

VIBlend Controls for WinForms 4.7 - Released

by viblend 2. July 2010 02:10

VIBlend is announcing today the latest version of the VIBlend Controls for WinForms. This release features some important changes in the suite that you will want to check out.

The release notes below provide a full list of all the changes:

  • Added 20 new examples
  • Added 32 How-To Tutorials
  • Major Update of the Help Documentation
  • Added 4 new Quick Start Mini projects
  • Added VS 2010 Examples projects.
  • DataGridView changes
    • Added Rows Grouping Panel
    • Added Columns Chooser
    • Added CheckedChanged event to the CheckBoxEditor
    • Added an ActionList in Design Time
    • Added an option to automatically open the ComboBoxEditor and DateTimePickerEditor pop up when they get active.
    • Added Resizing Tooltip which is shown when a column or row header is resized.
    • Added ContextMenuShowing event.
    • Fixed an issue regarding the control's Focus
    • Fixed an issue in the ComboBoxEditor keyboard navigation
    • Fixed an issue in the DateTimeEditor keyboard navigation
    • Fixed an issue regarding the cell images.
  • TreeView - Fixed a design time issue with the Nodes collection serialization.
  • RibbonBar Gallery - Fixed a Design time issue with the GalleryButtons collection.
  • RibbonBar - Fixed an issue regarding the Background image of the ApplicationButton's content panel.
  • Form - Fixed the icon rendering. ShowIcon property now affects the Form icon's rendering.

If you want to check out the latest release, it is now available for download.  

About the author

Some text that describes me

Tag cloud

Recent comments

Comment RSS
Copyright © 2011 VIBlend  
Terms of Use | Privacy Policy
WinForms Controls Purchase Online About Us
DataGrid Navigation Pane Technical Support Blog
ScrollBar TreeView
ListBox ProgressBar Downloads Register
ComboBox Buttons
TabControl Editors Documentation Client Login

VIBlend Blog is powered by BlogEngine.NET