VIBlend

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;

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

winforms grid

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.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

DataGrid | WinForms | winforms grid

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.  

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

VIBlend Controls for WinForms | WinForms

VIBlend Controls for Silverlight ver. 2.6 - Released

by viblend 21. June 2010 20:37

VIBlend is pleased to announce the immediate availability of VIBlend Controls for Silverlight ver. 2.6. The new version includes several important updates to the company's Silverlight suite.

 Highlights of the new features and improvements in the new version are:

  • Visual Studio 2010 toolbox integration
  • Right Click support in DataGrid
  • DataGrid sorting and filtering using a Context Menu
  • DataGrid performance optimizations
  • Improved DataGrid Office2010 themes
  • Turned off DataGrid deferred scrolling feature by default.
  • Fixed a design time issue in the Menu control.
  • Fixed a design time issue in the TreeView control.
  • Fixed a Stretch alignment issue in the DataGrid control.

See our Silverlight Controls Live Demo and Download a free trial today.

Currently rated 4.7 by 3 people

  • Currently 4.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Silverlight | Silverlight Controls

VIBlend WPF DateTimeEditor and Data binding

by viblend 5. June 2010 08:58

This blog post illustrates how you can use the VIBlend WPF DateTimeEditor control in data binding scenarios.

The following is a complete sample, ready to run once you have copied it to your project.

At first, create a new WPF application and add a reference to the VIBlendWPFEditors.dll. Then add a new DateTimeEditor and ListBox controls in your application’s window. After that, bind the DateTimeEditor’s Value as well as the ListBox’s SelectedValue to a property named DateTimeValue.

XAML
<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:viblend="clr-namespace:VIBlend.WPF.Controls;assembly=VIBlendWPFEditors"
        xmlns:local="clr-namespace:WpfApplication1"
        Title="MainWindow" Height="200" Width="300">
    <Grid x:Name="LayoutRoot" Height="200" Width="300">
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <viblend:DateTimeEditor Grid.Row="1" Value="{Binding DateTimeValue, Mode=TwoWay}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="100" Height="20"></viblend:DateTimeEditor>
         <ListBox Grid.Column="1" Grid.Row="1" SelectedValue="{Binding DateTimeValue, Mode=TwoWay}" Height="110" HorizontalAlignment="Left"  Name="listBox1" VerticalAlignment="Top" Width="130"/>
        <Label Content="DateTime Items" Grid.Column="1" Height="28" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Top" />
        <Label Content="DateTime Editor" Height="28" HorizontalAlignment="Left" Name="label2" VerticalAlignment="Top" />
    </Grid>
</Window>

The next step is to create a class which defines the DateTimeValue property.    

        public class DataBindingData : INotifyPropertyChanged
        {    
            private DateTime dateTime = new DateTime(2010, 06, 06);
            public DataBindingData()
            {
            }

            public DateTime DateTimeValue
            {
                get
                {
                    return this.dateTime;
                }
                set
                {
                    this.dateTime = value;
                    this.OnPropertyChanged("DateTimeValue");
                }
            }

            public event PropertyChangedEventHandler PropertyChanged;
            protected virtual void OnPropertyChanged(string name)
            {
                if (this.PropertyChanged != null)
                {
                    this.PropertyChanged(this, new PropertyChangedEventArgs(name));
                }
            }
      }


The final step is to fill the ListBox with DateTime items and to set the DataContext property of the LayoutRoot object. This is implemented in the MainWindow’s constructor, after the InitializeComponent call.           

            this.LayoutRoot.DataContext = new DataBindingData();
            List<DateTime> dateTimeList = new List<DateTime>();
            dateTimeList.Add(new DateTime(2010, 06, 06));
            dateTimeList.Add(new DateTime(2010, 06, 07));
            dateTimeList.Add(new DateTime(2010, 06, 08));
            dateTimeList.Add(new DateTime(2010, 06, 09));
            dateTimeList.Add(new DateTime(2010, 06, 10));
            this.listBox1.ItemsSource = dateTimeList;


The image below represents our sample’s main window. When you select a value from the ListBox, the DateTimeEditor’s Value will be changed and vice versa.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

WPF Editors, WPF

VIBlend Controls for Silverlight 4.0 - Released

by viblend 21. May 2010 12:02

We are proud to announce the release of the latest version of VIBlend Silverlight Controls.

Our main efforts for this release were focused on the Silverlight 4.0 and Visual Studio 2010 support. Another major improvement is the availability of three new themes - Office 2010 Blue, Office 2010 Black and Office 2010 Silver.

See our Silverlight Controls Live Demo and Download a free trial today. 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

How to create a scrollable Menu in Silverlight

by viblend 8. May 2010 18:30

In case the available height is too small to accommodate a group of menu items, the group becomes scrollable.  Each menu item has a DropDownHeight and VerticalScrollBarVisibility properties. The DropDownHeight property is used to restrict the displayed height of a group of menu items, while the VerticalScrollBarVisibility property defines whether the item allows vertical scrolling or not.

The following code example demonstrates how to create a scrollable menu.

[XAML]

         <viblend:Menu Name="Menu" Width="400" Height="20">
                <viblend:MenuItem RootNormalForeBrush="Black" DropDownHeight="150" VerticalScrollBarVisibility="Visible" Text="File">
                    <viblend:MenuItem Text="Mail Message" ImageSource="images/mail.png"/>
                    <viblend:MenuItem Text="Note" ImageSource="images/Note.png"/>
                    <viblend:MenuItem Text="Contact" ImageSource="images/contact.png" />
                    <viblend:MenuItem Text="Appointment" ImageSource="images/Appointment.png"/>
                    <viblend:MenuItem Text="Task" ImageSource="images/Task.png" />
                    <viblend:MenuItem Text="Folder" ImageSource="images/folder.png"/>
                </viblend:MenuItem>
            </viblend:Menu>

VIBlend Menu for Silverlight is a free component that is part of the VIBlend Controls for Silverlight package.

TabControl for WinForms Updates

by viblend 3. May 2010 15:53

With version 4.6 of VIBlend Controls for WinForms, we introduced several rendering and functionality improvements and made the look and feel of VIBlend vTabControl fully customizable. You can easily add custom drawing by handling the DrawTabPage, DrawTabPageBackground and DrawTitleBackground events. The screenshot below is from our FlexibleStyling example (full source code available in C# and VB.NET):

We also added an easy way to customize the Font and Color settings of TabPage’s Header. Take a look at the code snippet and screenshot of a TabPage with green text color and bold font style.

           C#

vTabPage tabPage = this.vTabControl1.TabPages[0];
tabPage.UseThemeTextColor = false;
tabPage.UseDefaultTextFont = false;
tabPage.PressedTextColor = Color.Green;
tabPage.TextFont = new Font(tabPage.Font, FontStyle.Bold);
VB .NET
Dim tabPage As vTabPage = Me.vTabControl1.TabPages(0)
tabPage.UseThemeTextColor = False
tabPage.UseDefaultTextFont = False
tabPage.PressedTextColor = Color.Green
tabPage.TextFont = New Font(tabPage.Font, FontStyle.Bold)

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , ,

TabControl | WinForms

VIBlend WinForms Controls ver. 4.6 – Released

by viblend 22. April 2010 09:17

We are happy to announce the release of the latest version of VIBlend Controls for WinForms.

VIBlend Windows Forms Controls 4.6.0 - Release Notes

1. Added support for Visual Studio 2010
2. Moved all design time classes of our controls to separate assembly
3. DataGridView changes

In this version we extended the HierarhcyItem mouse click events. Previously, the grid was raising only the ItemClick and ItemDoubleClick events.

These two events are replaced by the following set of events:

 - HierarchyItemMouseUp
 - HierarchyItemMouseDown
 - HierarchyItemMouseClick
 - HierarchyItemMouseDoubleClick

We also added several improvements in the in-place cell editors' infrastructure. Specifically we added the following activation and deactivation events:

 - Click on selected cell (MOUSE_CLICK_SELECTED_CELL)
 - Enter key activation (KEY_PRESS_ENTER
 - Esc key deactivation (KEY_PRESS_ESC)

The default activation and deactivation flags for the built-in cell editors where modified to use the new activation events.

Please, note that these are breaking changes. If you are using an earlier version of VIBlend Controls for Windows Forms you will have to make minor changes to your code.

New in version 4.6 are the HierarchyItems and Cells selection changed events:
 - DataGridView.HierarchyItemSelectionChanged
 - DataGridView.CellSelectionChanged

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

DataGrid | olap grid | winforms grid | WinForms

Pivot Grid - Traditional vs Compact style layout

by viblend 18. April 2010 05:36

VIBlend DataGridView for WinForms offers multiple unique features that cannot be found in other Windows Forms data grid controls. These include multi-level hierarchies on rows and columns, rows grouping, pivot tables, and built-in OLAP capabilities. One of the main drawbacks of the traditional OLAP style rows layout is that it takes a lot of screen space. 

 

This could be improved by using the compact style layout. In this mode the rows of the pivot table are rendered in a tree-like structure.

 


Switching from default to compact style rendering is very easy. It requires setting the value of RowsHierarchy.CompactStyleRendering property to true:

C#
grid.RowsHierarchy.CompactStyleRenderingEnabled = true;
grid.RowsHierarchy.AutoResize();
grid.Invalidate();

VB .Net
grid.RowsHierarchy.CompactStyleRenderingEnabled = True
grid.RowsHierarchy.AutoResize()
grid.Invalidate()
 

You can switch between traditional and compact style rendering at runtime. The feature is also availalbe in VIBlend DataGrid for Silverlight.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , , ,

DataGrid | olap grid | pivot, olap

About the author

Some text that describes me

Recent comments

None

Copyright © 2009 VIBlend  
ALL RIGHTS RESERVED  
 
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