# DataBindingComplete Command

The `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 the DataGrid provides a multi-threaded implementation of all the in-memory data operations like grouping, sorting, and filtering, the `DataBindingComplete` event is the safe entry point which grants that all the data-related operations are successfully completed and the data view can be accessed and manipulated.

## Execution Parameter

The execution parameter is of type `DataBindingCompleteEventArgs` and exposes 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 possible flags are `DataChangeFlags.Group`, `DataChangeFlags.Sort`, and `DataChangeFlags.Filter`.

## Custom DataBindingComplete Command

The following examples show how to create a class that inherits from the `DataGridCommand` and add it to the `Commands` collection.

#### **Create a Custom DataBindingComplete Command**

```C#
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);        
	}
}
```

#### **Add the Custom Command to the Commands Collection**

```XAML
<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

* [CellTap](https://www.telerik.com/winui/documentation/controls/raddatagrid/commands/datagrid-celltapcommand)
* [CellDoubleTap](https://www.telerik.com/winui/documentation/controls/raddatagrid/commands/datagrid-celldoubletappedcommand)
* [FlyoutGroupHeader](https://www.telerik.com/winui/documentation/controls/raddatagrid/commands/datagrid-flyoutgroupheadertapcommand)
* [ColumnHeaderTap](https://www.telerik.com/winui/documentation/controls/raddatagrid/commands/datagrid-columnheadertapcommand)
* [FilterButtonTap](https://www.telerik.com/winui/documentation/controls/raddatagrid/commands/datagrid-filterbuttontapcommand)
