Classes
Class | Description | |
---|---|---|
BrushComboBox |
The control enables to select a Brush in a droped down panel
| |
BrushPicker |
The control enables to select a Brush | |
Cell |
Represents a cell
| |
ColorComboBox |
The control enables to select a Color in a droped down panel
| |
ColorPicker |
The control enables to select a Color.
| |
Column |
Represents a column
| |
ColumnCollection |
Collection of columns.
| |
GridControl |
Displays data in tabular form with one or several headers
| |
GridControl..::..GridControlNavigation |
Navigation methods to handle user input such as KeyUp, KeyDows etc.
| |
GridControl..::..GridControlSortingSettings |
Specifies row sorting settings in GridControl .
| |
GridControl..::..GridDataObjects |
Collection of data objects that enables searching rows by a data object.
| |
GridControl..::..GridHitTests |
Accessor that enables to get information about GridControl's element by its location.
| |
GridControl..::..GridSelection |
Collection of selected rows.
| |
GridControl..::..NodeCollection |
A collection of visible and invisible rows
| |
GridControl..::..RowCollection |
Collection of all visible Rows.
| |
GridControlBlinkingSettings |
Blinking settings such as duration.
| |
GridControlCellEventArgs |
Event arguments containing information about a Cell.
| |
GridControlColumnEventArgs |
Event arguments containing information about a Column.
| |
GridControlDataBindingSettings |
Data binding settings.
| |
GridControlDefaults |
Collection of default settings of GridControl.
| |
GridControlDragAndDropSettings |
Drag and drop settings.
| |
GridControlExpansionButtonStateEventArgs | GridControl.ExpansionButtonState event arguments containing information about expansion button.
| |
GridControlFocusedRowEventArgs | GridControl.FocusedRowChanged event arguments that provide information about previous and new focused rows.
| |
GridControlFocusSettings | GridControl's focus settings.
| |
GridControlHeaderEventArgs |
Event arguments containing information about a Header.
| |
GridControlNavigationSettings | GridControl navigation settings to handle user input.
| |
GridControlRowAddingEventArgs | GridControl.RowAdding event arguments containing information about a currently adding object.
| |
GridControlRowBrushEventArgs |
Arguments of GridControl.RowBackground and GridControl.RowForeground events that provide information
about Row.
| |
GridControlRowEventArgs |
Event arguments containing information about a Row.
| |
GridControlRowExpansionEventArgs | GridControl.RowExpansionChanging event arguments containing information about a Row and its new expansion state.
| |
GridControlRowSelectionEventArgs | GridControl.RowSelectionChanging event arguments containing information about a Row and its new selection state that can be changed.
| |
GridControlRowSelectorSettings |
A visual element on the left side of the GridControl that enables a user to manipulate the Rows, change their height, select them.
| |
GridControlRowUpdateEventArgs | GridControl.RowUpdated event arguments containing information about a Row and a IDataField that have been updated.
| |
GridControlSelectionSettings |
Specifies row selection settings in GridControl .
| |
Header |
Collection of columns.
| |
Header..::..FixedColumnCollection |
Collection of non-scrollable columns
| |
Header..::..GroupedColumnCollection |
Collection of grouped columns.
| |
Header..::..SortedColumnCollection |
Collection of sorted Columns
| |
HeaderCollection |
Collection of headers.
| |
LinearGradientBrushPicker |
This control enables to select a LinearGradientBrush.
| |
RadialGradientBrushPicker |
A control enables to select a RadialGradientBrush.
| |
Row |
Contains a collection of Cells and information about data object, its location, hierarchy in the data grid, etc.
| |
Row..::..VisibleRowCollection |
A collection of visible child Rows.
|
Interfaces
Interface | Description | |
---|---|---|
ICustomSort |
Defines an interface to sort rows in GridControl.
| |
IFilter |
An interface to filter Row objects in GridControl.
|
Enumerations
Enumeration | Description | |
---|---|---|
ColumnScrollType |
Specifies column scroll mode
| |
ExpansionButtonState |
Specifies expansion (+/-) button state
| |
FocusMode |
Specifies GridControl focus mode
| |
HitTestInfo |
Describes GridControl elements
| |
InsertionType |
Possible actions upon data insertion to the grid
| |
MouseWheelBehavior |
Specifies mouse wheel behavior
| |
RowDockStyle |
Specifies Row style docking
| |
SortDirection |
Specifies sorting direction
| |
TextImageRelation |
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 | |
---|---|
//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 | |
---|---|
<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 | |
---|---|
// 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 | |
---|---|
Row row = grid.Rows[1]; row.Add(new object[] { 200, null,"subitem1"}); row.Add(new object[] { 33, 33.33,"subitem2" }); |