Wpf GridControl and other controls.

Classes

  ClassDescription
Public classBrushComboBox
The control enables to select a Brush in a droped down panel
Public classBrushPicker
The control enables to select a Brush
Public classCell
Represents a cell
Public classColorComboBox
The control enables to select a Color in a droped down panel
Public classColorPicker
The control enables to select a Color.
Public classColumn
Represents a column
Public classColumnCollection
Collection of columns.
Public classGridControl
Displays data in tabular form with one or several headers
Public classGridControl..::..GridControlNavigation
Navigation methods to handle user input such as KeyUp, KeyDows etc.
Public classGridControl..::..GridControlSortingSettings
Specifies row sorting settings in GridControl .
Public classGridControl..::..GridDataObjects
Collection of data objects that enables searching rows by a data object.
Public classGridControl..::..GridHitTests
Accessor that enables to get information about GridControl's element by its location.
Public classGridControl..::..GridSelection
Collection of selected rows.
Public classGridControl..::..NodeCollection
A collection of visible and invisible rows
Public classGridControl..::..RowCollection
Collection of all visible Rows.
Public classGridControlBlinkingSettings
Blinking settings such as duration.
Public classGridControlCellEventArgs
Event arguments containing information about a Cell.
Public classGridControlColumnEventArgs
Event arguments containing information about a Column.
Public classGridControlDataBindingSettings
Data binding settings.
Public classGridControlDefaults
Collection of default settings of GridControl.
Public classGridControlDragAndDropSettings
Drag and drop settings.
Public classGridControlExpansionButtonStateEventArgs
GridControl.ExpansionButtonState event arguments containing information about expansion button.
Public classGridControlFocusedRowEventArgs
GridControl.FocusedRowChanged event arguments that provide information about previous and new focused rows.
Public classGridControlFocusSettings
GridControl's focus settings.
Public classGridControlHeaderEventArgs
Event arguments containing information about a Header.
Public classGridControlNavigationSettings
GridControl navigation settings to handle user input.
Public classGridControlRowAddingEventArgs
GridControl.RowAdding event arguments containing information about a currently adding object.
Public classGridControlRowBrushEventArgs
Arguments of GridControl.RowBackground and GridControl.RowForeground events that provide information about Row.
Public classGridControlRowEventArgs
Event arguments containing information about a Row.
Public classGridControlRowExpansionEventArgs
GridControl.RowExpansionChanging event arguments containing information about a Row and its new expansion state.
Public classGridControlRowSelectionEventArgs
GridControl.RowSelectionChanging event arguments containing information about a Row and its new selection state that can be changed.
Public classGridControlRowSelectorSettings
A visual element on the left side of the GridControl that enables a user to manipulate the Rows, change their height, select them.
Public classGridControlRowUpdateEventArgs
GridControl.RowUpdated event arguments containing information about a Row and a IDataField that have been updated.
Public classGridControlSelectionSettings
Specifies row selection settings in GridControl .
Public classHeader
Collection of columns.
Public classHeader..::..FixedColumnCollection
Collection of non-scrollable columns
Public classHeader..::..GroupedColumnCollection
Collection of grouped columns.
Public classHeader..::..SortedColumnCollection
Collection of sorted Columns
Public classHeaderCollection
Collection of headers.
Public classLinearGradientBrushPicker
This control enables to select a LinearGradientBrush.
Public classRadialGradientBrushPicker
A control enables to select a RadialGradientBrush.
Public classRow
Contains a collection of Cells and information about data object, its location, hierarchy in the data grid, etc.
Public classRow..::..VisibleRowCollection
A collection of visible child Rows.

Interfaces

  InterfaceDescription
Public interfaceICustomSort
Defines an interface to sort rows in GridControl.
Public interfaceIFilter
An interface to filter Row objects in GridControl.

Enumerations

  EnumerationDescription
Public enumerationColumnScrollType
Specifies column scroll mode
Public enumerationExpansionButtonState
Specifies expansion (+/-) button state
Public enumerationFocusMode
Specifies GridControl focus mode
Public enumerationHitTestInfo
Describes GridControl elements
Public enumerationInsertionType
Possible actions upon data insertion to the grid
Public enumerationMouseWheelBehavior
Specifies mouse wheel behavior
Public enumerationRowDockStyle
Specifies Row style docking
Public enumerationSortDirection
Specifies sorting direction
Public enumerationTextImageRelation
Specifies the position of the text and image relative to each other on a control.

Remarks

Wpf GridControl is a control that provides data in tabular form and has one or several headers. Supported frameworks: 4.0, 4.5. Development tools: VS2010, VS2012, VS2013.

Besides, connection to IList, IBindingList, IListSource, Dapfor Wpf GridControl significantly expands data binding features enabling operations in unbound mode.

As an example of usage we shall demonstrate a simple class and a collection of objects of this class that can be later displayed in the grid.

 Copy imageCopy
//An example of a simple class 
public class MyCustomClass
{
    public MyCustomClass(int intValue, double doubleValue, string stringValue)
    {
        IntValue = intValue;
        DoubleValue = doubleValue;
        StringValue = stringValue;
    }

    public int IntValue { get; set; }
    public double DoubleValue { get; set; }
    public string StringValue { get; set; }
}

//Collection with some MyCustomClass objects 
public class MyCollection : List<MyCustomClass>
{
    public MyCollection()
    {
        //Add some data 
        Add(new MyCustomClass(10, 11.12, "some string 1"));
        Add(new MyCustomClass(20, 21.33, "some string 2"));
    }
}

There are many methods of binding grid to data. Let's demonstrate an xaml file as the simplest example of this. To do it, we shall add GridControl from toolbox to VisualStudio and create a header and some columns. Data is created in DataTypesWindow resources and bound to the grid as a static resource: ItemsSource="{StaticResource myCollection}"

 Copy imageCopy
<Window x:Class="TestApplication.Tutorial.DataTypesWindow" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:df="clr-namespace:Dapfor.Wpf.Controls;assembly=Dapfor.Wpf" 
           xmlns:Tutorial="clr-namespace:TestApplication.Tutorial"
           Title="Objects of arbitrary classes" Height="352" Width="671"> 

  <Window.Resources> 
    <Tutorial:MyCollection x:Key="myCollection"/> 
  </Window.Resources> 

  <df:GridControl Name="grid" ItemsSource="{StaticResource myCollection}"> 
    <df:GridControl.Headers> 
      <df:Header ScrollType="Stretch"> 
        <df:Header.Columns> 
          <df:Column Id="IntValue" Title="Int Value" /> 
          <df:Column Id="DoubleValue" Title="Double Value" /> 
          <df:Column Id="StringValue" Title="String Value" /> 
        </df:Header.Columns> 
      </df:Header> 
    </df:GridControl.Headers> 
  </df:GridControl> 
</Window>

Besides the above example, the grid can also be bound to data with programming means. For example, in DataTypesWindow class designer.

 Copy imageCopy
// Interaction logic for DataTypesWindow.xaml 
public partial class DataTypesWindow : Window
{
    public DataTypesWindow()
    {
        InitializeComponent();

        //Bind the Wpf GridControl to the collection MyCollection using program means 
        IList<MyCustomClass> collection = new List<MyCustomClass>
        collection.Add(new MyCustomClass(10, 11.12, "some string 1"));
        collection.Add(new MyCustomClass(20, 21.33, "some string 2"));

        grid.ItemsSource = collection;
    }
}

GridControl provides access to rows via GridControl.Rows or GridControl.Nodes accessors for any method that has been used to fill the grid. The grid returns objects of Row type. Developers can use Wpf GridControl to easily create a hierarchy by calling Row.Add(object) method.

 Copy imageCopy
Row row = grid.Rows[1];
row.Add(new object[] { 200, null,"subitem1"});
row.Add(new object[] { 33, 33.33,"subitem2" });