New to Telerik UI for .NET MAUI? Start a free 30-day trial
.NET MAUI TreeDataGrid Columns Cell Templates
Updated over 6 months ago
This article describes how to extend the functionality of the columns in the .NET MAUI TelerikDataGrid and define custom content and edit templates using the CellContentTemplate and CellEditTemplate properties.
CellContentTemplate(DataTemplate)—Defines the appearance of each cell associated with the concrete column.CellContentTemplategives you the opportunity to wrap the text inside each DataGrid column. You can add a Label as a content of the Text, Template Column and wrap its text using the Label'sLineBreakModeproperty.CellContentTemplateSelector(DataTemplateSelector)—Defines aDataTemplateSelectorinstance that may be used to retrieve dynamic data templates on a per-cell basis.CellEditTemplate(DataTemplate)—Defines the editor associated with the concrete column. TheCellEditTemplateis displayed when the cell is in edit mode.
As the TreeDataGrid inhertis from the DataGrid, for a runnable example with
CellContentTemplateandCellEditTemplatescenario, see the SDKBrowser Demo Application and go to DataGrid > Columns category.