New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI TreeDataGrid Events

The Telerik UI for .NET MAUI TreeDataGrid component inherits the events from the DataGrid control a set of events which help users achieve seamless and effective experience when interacting with the component.

Loading Content on Demand

The load-on-demand feature gets implemented through the LoadOnDemand event. The LoadOnDemand event handler receives the following parameters:

  • The sender argument, which is of type object, but can be cast to the RadDataGrid type.
  • A LoadOnDemandEventArgs object, which provides the IsDataLoaded (bool) property, indicating whether the data is loaded.

For more information, see the topic about loading data on demand in the .NET MAUI TreeDataGrid.

Loading Distinct Values

The TreeDataGrid enables you to load the distinct values that will be displayed in the Telerik.Maui.Controls.DataGrid.DataGridDistinctValuesFilterView through the DistinctValuesLoading event. The DistinctValuesLoading event handler receives the following parameters:

  • The sender argument, which is of type object, but can be cast to the RadDataGrid type.
  • A DistinctValuesLoadingEventArgs object, which provides the following properties:
    • DistinctValues—Specifies a list of values of type IEnumerable which are to be displayed in the DataGridDistinctValuesFilterView.
    • (Read-only) Column of type DataGridColumn—Gets the column for which the distinct values are being loaded.

For more information, see the topic about the available filtering options in the .NET MAUI TreeDataGrid.

Binding to Data

The TreeDataGrid also gives you the option to use the DataBindingComplete event which occurs when the associated TreeDataGrid ItemsSource has been successfully bound to the control, or when any data operation like grouping, sorting, or filtering is applied. The DataBindingComplete event handler receives the following parameters:

  • The sender argument, which is of type object, but can be cast to the RadDataGrid type.
  • A DataBindingCompleteEventArgs object, which provides the DataView (IDataViewCollection) property and allows for traversing and/or manipulating the already computed data view.

Modifying the Selection

The TreeDataGrid inherits the SelectionChanged event which is triggered whenever the SelectedItems collection is changed. The SelectionChanged event handler receives the following parameters:

  • The sender argument, which is of type object, but can be cast to the RadDataGrid type.
  • A DataGridSelectionChangedEventArgs object, which provides the following properties:
    • RemovedItems—Gets a list of the removed items from the SelectedItems collection.
    • AddedItems—Gets a list of the added items to the SelectedItems collection.

For more information, see the article about the SelectionChanged event of the .NET MAUI TreeDataGrid.

Changing the Current Cell

The TreeDataGrid also supports the CurrentCellChanged event which is invoked when the current cell changes. The CurrentCellChanged event handler receives the following parameters:

  • The sender argument, which is of type object, but can be cast to the RadDataGrid type.
  • A CurrentCellChangedEventArgs object, which provides the following properties:
    • OldCurrentCell—Gets the previously CurrentCell.
    • NewCurrentCell—Gets the new CurrentCell.

For more information, see the article about the CurrentCellChanged event in the .NET MAUI TreeDataGrid.

Reordering the Column

The TreeDataGrid inherits the ColumnReorderStarting, ColumnReordering, ColumnReorderCompleting, and ColumnReordered events related to the column reordering operation. For more details, review the TreeDataGrid Columns Reordering article.

Resizing the Column

The TreeDataGrid resizing feature exposes a ColumnUserResizeCompleted event which is invoked when a column is resized by user interaction. The ColumnUserResizeCompleted event handler receives the following parameters:

  • The sender argument, which is of type object, but can be cast to the RadDataGrid type.
  • A ColumnUserResizeCompletedEventArgs object, which provides the following properties:
    • Column (DataGridColumn)—Gets the previously CurrentCell.
    • Width (double)—Gets the width of the column that is resized.

Additional Resources

See Also

In this article