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).
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.
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.
PrivateSub Button_Click( ByVal sender AsObject, ByVal e As RoutedEventArgs )
Dim cell As Cell = Cell.FindFromChild( TryCast( sender, DependencyObject ) )
Dim editor AsNew 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.
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