The following example demonstrates how to retrieve a reference to an InsertionRow that is located in the fixed headers of a grid by handling its Loaded event.
| XAML |
Copy Code |
|---|---|
<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"> <Grid.Resources> <xcdg:DataGridCollectionViewSource x:Key="cvs_orders" Source="{Binding Source={x:Static Application.Current}, Path=Orders}" /> </Grid.Resources> <xcdg:DataGridControl x:Name="OrdersGrid" ItemsSource="{Binding Source={StaticResource cvs_orders}}"> <xcdg:DataGridControl.View> <xcdg:TableView> <xcdg:TableView.FixedHeaders> <DataTemplate> <xcdg:InsertionRow Loaded="InsertionRow_Loaded"/> </DataTemplate> </xcdg:TableView.FixedHeaders> </xcdg:TableView> </xcdg:DataGridControl.View> </xcdg:DataGridControl> </Grid> | |
The following code provides the implementation of the Loaded event handler.
| VB.NET |
Copy Code |
|---|---|
Private Sub InsertionRow_Loaded( ByVal sender As Object, ByVal e As RoutedEventArgs ) Dim insertionRow As InsertionRow = TryCast( sender, InsertionRow ) If Not insertionRow Is Nothing Then ' Your code here End If End Sub | |
| C# |
Copy Code |
|---|---|
private void InsertionRow_Loaded( object sender, RoutedEventArgs e ) { InsertionRow insertionRow = sender as InsertionRow; if( insertionRow != null ) { // Your code here } } | |