'Declaration Public ReadOnly Property Columns As ColumnCollection
'Usage Dim instance As DataGridControl Dim value As ColumnCollection value = instance.Columns
public ColumnCollection Columns {get;}
'Declaration Public ReadOnly Property Columns As ColumnCollection
'Usage Dim instance As DataGridControl Dim value As ColumnCollection value = instance.Columns
public ColumnCollection Columns {get;}
<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>
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
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(); }
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
DataGridControl Class
DataGridControl Members
VisibleColumns Property
AutoCreateColumns Property