New to Telerik UI for WinUI? Download free 30-day trial

DataBindingComplete Command

Provides an MVVM-friendly implementation of the DataBindingComplete event. This event is useful when some logic needs to be executed after the data view is generated. Since RadDataGrid provides a multi-threaded implementation of all the in-memory data operations like Grouping, Sorting and Filtering, this event is the safe entry point which grants that all the data-related operations are successfully completed and the data view may be accessed and manipulated.

Execution Parameter

The execution parameter is of type DataBindingCompleteEventArgs which expose the following properties:

  • DataView: Gets the Telerik.UI.Xaml.Controls.Grid.IDataView implementation that allows for traversing and/or manipulating the already computed data View.
  • ChangeFlags: Gets the flags that triggered the re-evaluation of the underlying raw data. The three possible flags are DataChangeFlags.Group, DataChangeFlags.Sort and DataChangeFlags.Filter.

Custom DataBindingComplete Command

Examples 1 and 2 show how to create a class that inherits from DataGridCommand and add it to the Commands collection.

Example 1: Creating a custom DataBindingComplete Command

public class CustomDataBindingCompleteCommand : DataGridCommand 
{ 
    public CustomDataBindingCompleteCommand() 
    { 
        this.Id = CommandId.DataBindingComplete; 
    } 
 
    public override bool CanExecute(object parameter) 
    { 
        var context = parameter as DataBindingCompleteEventArgs; 
        // put your custom logic here 
        return true; 
    } 
 
    public override void Execute(object parameter) 
    { 
        var context = parameter as DataBindingCompleteEventArgs; 
        // put your custom logic here        
 
        this.Owner.CommandService.ExecuteDefaultCommand(CommandId.DataBindingComplete, context);         
    } 
} 

Example 2: Adding the custom Command to the Commands collection

<Grid xmlns:grid="using:Telerik.UI.Xaml.Controls.Grid"> 
    <grid:RadDataGrid Width="600" Height="460" x:Name="grid" Hold> 
        <grid:RadDataGrid.Commands> 
            <local:CustomDataBindingCompleteCommand/> 
        </grid:RadDataGrid.Commands> 
    </grid:RadDataGrid> 
</Grid> 

See Also

In this article
Not finding the help you need?