| Visual Basic (Declaration) | |
|---|---|
<StyleTypedPropertyAttribute(Property="CellErrorStyle", StyleTargetType=Xceed.Wpf.DataGrid.Cell)> <TemplatePartAttribute(Name="PART_ScrollViewer", Type=System.Windows.Controls.ScrollViewer)> Public Class DataGridControl Inherits ItemsControl Implements IGeneratorHost, INotifyPropertyChanged, ISupportInitialize, IDocumentPaginatorSource, IFrameworkInputElement, IInputElement, IAddChild, IHaveResources, IAnimatable, DUCE.IResource | |
| C# | |
|---|---|
[StyleTypedPropertyAttribute(Property="CellErrorStyle", StyleTargetType=Xceed.Wpf.DataGrid.Cell)] [TemplatePartAttribute(Name="PART_ScrollViewer", Type=System.Windows.Controls.ScrollViewer)] public class DataGridControl : ItemsControl, IGeneratorHost, INotifyPropertyChanged, ISupportInitialize, IDocumentPaginatorSource, IFrameworkInputElement, IInputElement, IAddChild, IHaveResources, IAnimatable, DUCE.IResource | |
| Visual Basic | Copy Code |
|---|---|
Shared Sub New() | |
| C# | Copy Code |
|---|---|
static App() | |
| XAML | Copy Code |
|---|---|
<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"> | |
| XAML | Copy Code |
|---|---|
<Grid xmlns:s="clr-namespace:System;assembly=mscorlib" | |
By default, when a new DataGridControl instance is created, it will contain a GroupByControl and a ColumnManagerRow in its fixed headers.
Fixed Columns vs. Templates 
In order to support fixed columns when creating a new row template for a table-view layout, the following criteria must be met:
- The PART_CellsHost template part must be a FixedCellPanel.
- The FixedCellCount property of the FixedCellPanel must be bound to the table view's FixedColumnCount property using a TwoWay ViewBinding.
The fixed-cell-panel properties listed below are also usually bound when provided a new row template for a table-view layout:
- SplitterStyle (TemplateBinding xcdg:TableView.FixedColumnSplitterStyle)
- SplitterWidth (xcdg:ViewBinding FixedColumnSplitterWidth)
- ShowSplitter (xcdg:ViewBinding ShowFixedColumnSplitter)
- FixedColumnDropMarkPen (xcdg:ViewBinding FixedColumnDropMarkPen)
If a new template is provided for a DataGridControl and fixed columns are to be supported, it is essential that a TableViewScrollViewer be used. This scroll viewer is responsible for preserving the TranslateTransforms that fix and scroll elements, as well as executing the PageLeft and PageRight actions according to the reduced viewport. It is also recommended that an AdornerDecorator be located above the TableViewScrollViewer of the templated DataGridControl to support drag and dropping of the fixed-column splitter correctly.
By default, a grid will take all the room that it requires; therefore, if it is not given a size constraint, such as when it is placed in a StackPanel, and a large amount of data items are present, UI virtualization will be lost—resulting in a significant loss in performance. To preserve UI virtualization when a grid is in a StackPanel, the MaxWidth and MaxHeight properties (or Width and Height) must be used to constrain it. As an alternative, a DockPanel or Grid can be used as both impose size constraints on their child elements.
The ItemContainerGenerator property is obsolete and has been replaced by the GetContainerFromItem and GetItemFromContainer methods.
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
System.Windows.Controls.ItemsControl
Xceed.Wpf.DataGrid.DataGridControl
Supported Operating Systems: Windows Server 2003 Service Pack 1; Windows Vista; Windows XP Service Pack 2
Reference
DataGridControl MembersXceed.Wpf.DataGrid Namespace
Basic Concepts
Providing DataObject Model Overview: DataGridControl Class


~338.gif)


~338.gif)
~338.gif)

~338.gif)
~338.gif)

~338.gif)

~338.gif)

~338.gif)

~338.gif)
Copy Code