Xceed Toolkit Plus for WPF v5.1 Documentation
Xceed.Wpf.DataGrid.Toolkit Assembly / Xceed.Wpf.DataGrid Namespace / UnboundColumn Class
Members Example


In This Topic
    UnboundColumn Class
    In This Topic
    Represents a column that can be used to display non-data related information such as a label or controls that allow some sort of action to be carried out (e.g., a button to open a window in which the current item can be edited).
    Syntax
    'Declaration
     
    <DebuggerDisplayAttribute("FieldName = {FieldName}")>
    <TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>
    <NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>
    Public Class UnboundColumn 
       Inherits ColumnBase
    'Usage
     
    Dim instance As UnboundColumn
    [DebuggerDisplay("FieldName = {FieldName}")]
    [TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)]
    [NameScopeProperty("NameScope", System.Windows.NameScope)]
    public class UnboundColumn : ColumnBase 
    Example
    The following example demonstrates how to use an unbound column to display a button that, when clicked, will display an editor through which the corresponding data item can be edited.
    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
      <Grid.Resources>
         <xcdg:DataGridCollectionViewSource x:Key="cvs_products"
                                            Source="{Binding Source={x:Static Application.Current}, Path=Products}" />
    
      </Grid.Resources>
      <xcdg:DataGridControl x:Name="OrdersGrid"
                            ItemsSource="{Binding Source={StaticResource cvs_products}}">
         <xcdg:DataGridControl.Columns>
    
           <xcdg:UnboundColumn FieldName="EditRowColumn"
                               Width="30"
                               MinWidth="30"
                               MaxWidth="30">
              <xcdg:UnboundColumn.CellContentTemplate>
                 <DataTemplate>
                    <Button Click="Button_Click"
                            Content="..." />
                 </DataTemplate>
              </xcdg:UnboundColumn.CellContentTemplate>
           </xcdg:UnboundColumn>
            <xcdg:Column FieldName="Photo"
                         Visible="False" />
         </xcdg:DataGridControl.Columns>
      </xcdg:DataGridControl>
    </Grid>
    The following code provides the implementation of the Button_Click event. The ProductsEditorWindow derives from Window and allows the data item to be edited. The code for the ProductsEditorWindow is not provided.
    Private Sub Button_Click( ByVal sender As Object, ByVal e As RoutedEventArgs )
      Dim cell As Cell = Cell.FindFromChild( TryCast( sender, DependencyObject ) )
    
      Dim editor As New ProductsEditorWindow( TryCast( DataGridControl.GetParentDataGridControl( cell ).GetItemFromContainer( cell.ParentRow ), DataRowView ) )
    
      editor.ShowDialog()
    End Sub
    The following code provides the implementation of the Button_Click event. The ProductsEditorWindow derives from Window and allows the data item to be edited. The code for the ProductsEditorWindow is not provided.
    private void Button_Click( object sender, RoutedEventArgs e )
    {
      Cell cell = Cell.FindFromChild( sender as DependencyObject );
    
      ProductsEditorWindow editor = new ProductsEditorWindow( DataGridControl.GetParentDataGridControl( cell ).GetItemFromContainer( cell.ParentRow ) as DataRowView );
    
      editor.ShowDialog();
    }
    Inheritance Hierarchy

    System.Object
       System.Windows.Threading.DispatcherObject
          System.Windows.DependencyObject
             System.Windows.Freezable
                Xceed.Wpf.DataGrid.ColumnBase
                   Xceed.Wpf.DataGrid.UnboundColumn

    Public Constructors
     NameDescription
    Public ConstructorOverloaded.   
    Top
    Public Fields
     NameDescription
    Public Fieldstatic (Shared in Visual Basic)Identifies the ReadOnly dependency property.  
    Top
    Public Properties
     NameDescription
    Public PropertyGets the actual width of the column considering the Width, MinWidth, and MaxWidth properties. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a value indicating whether cells in the column can receive focus when the parent column's ReadOnly property is set to true. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from System.Windows.Freezable)
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets the DataTemplate used to display the cells' content. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a DataTemplateSelector that provides a way to apply a different CellContentTemplate based on custom logic. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a value representing the horizontal content alignment of cells contained in the column. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a value representing the vertical content alignment of cells contained in the column. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets the column's parent data-grid control. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from System.Windows.DependencyObject)
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from System.Windows.Threading.DispatcherObject)
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets the case-sensitive field name that uniquely identifies the column in a grid's column collection. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets a value indicating whether the column has a fixed width. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets the index of the column in a grid's Column collection. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets a value indicating whether the column is the first visible column in a grid's. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from System.Windows.Freezable)
    Public PropertyGets a value indicating whether the column is the last visible column in a grid. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a value indicating whether the column is a grid's main (primary) column. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Property (Inherited from System.Windows.DependencyObject)
    Public PropertyGets or sets the maximum width of the column, in device-independent units (1/96th inch per unit). (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets the minimum width of the column, in device-independent units (1/96th inch per unit). (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a value indicating whether an InsertionRow can be edited regardless of the value of the ReadOnly property. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyOverridden. Gets or sets a value indicating whether the column is read only.  
    Public Property (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a value that indicates the text trimming behavior to employ when textual content overflows the content area. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a value indicating how textual content should be wrapped. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets the data displayed in a column's corresponding ColumnManagerCell and/or GroupByItem. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets the DataTemplate used to display the Title's content. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a DataTemplateSelector that provides a way to apply a different TitleTemplates based on custom logic. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets a value indicating whether the column is visible. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets the visible position of the column. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public PropertyGets or sets the width of the column, in device-independent units (1/96th inch per unit). (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Top
    Public Methods
     NameDescription
    Public MethodOverloaded.  (Inherited from System.Windows.DependencyObject)
    Public Method (Inherited from System.Windows.Freezable)
    Public Method (Inherited from System.Windows.Freezable)
    Public Method (Inherited from System.Windows.DependencyObject)
    Public Method (Inherited from System.Windows.DependencyObject)
    Public Method (Inherited from System.Windows.Freezable)
    Public Method (Inherited from System.Windows.Freezable)
    Public Method (Inherited from System.Windows.Freezable)
    Public MethodRetrieves the fitted width of the column, in device-independent units (1/96th inch per unit). (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Public Method (Inherited from System.Windows.DependencyObject)
    Public Method (Inherited from System.Windows.DependencyObject)
    Public Method (Inherited from System.Windows.DependencyObject)
    Public Method (Inherited from System.Windows.DependencyObject)
    Public Method (Inherited from System.Windows.DependencyObject)
    Public Method (Inherited from System.Windows.DependencyObject)
    Public MethodOverloaded.  (Inherited from System.Windows.DependencyObject)
    Public MethodReturns the string representation of the column. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Top
    Public Events
     NameDescription
    Public Event (Inherited from System.Windows.Freezable)
    Public EventRaised when the value of a property is changed. (Inherited from Xceed.Wpf.DataGrid.ColumnBase)
    Top
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also