.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
senderargument, which is of typeobject, but can be cast to theRadDataGridtype. - A
LoadOnDemandEventArgsobject, which provides theIsDataLoaded(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
senderargument, which is of typeobject, but can be cast to theRadDataGridtype. - A
DistinctValuesLoadingEventArgsobject, which provides the following properties:DistinctValues—Specifies a list of values of typeIEnumerablewhich are to be displayed in theDataGridDistinctValuesFilterView.- (Read-only)
Columnof typeDataGridColumn—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
senderargument, which is of typeobject, but can be cast to theRadDataGridtype. - A
DataBindingCompleteEventArgsobject, which provides theDataView(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
senderargument, which is of typeobject, but can be cast to theRadDataGridtype. - A
DataGridSelectionChangedEventArgsobject, which provides the following properties:RemovedItems—Gets a list of the removed items from theSelectedItemscollection.AddedItems—Gets a list of the added items to theSelectedItemscollection.
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
senderargument, which is of typeobject, but can be cast to theRadDataGridtype. - A
CurrentCellChangedEventArgsobject, which provides the following properties:OldCurrentCell—Gets the previouslyCurrentCell.NewCurrentCell—Gets the newCurrentCell.
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
senderargument, which is of typeobject, but can be cast to theRadDataGridtype. - A
ColumnUserResizeCompletedEventArgsobject, which provides the following properties:Column(DataGridColumn)—Gets the previouslyCurrentCell.Width(double)—Gets the width of the column that is resized.
Additional Resources
- .NET MAUI TreeDataGrid Product Page
- .NET MAUI TreeDataGrid Forum Page
- Telerik .NET MAUI Blogs
- Telerik .NET MAUI Roadmap