Skip to content

SyncfusionExamples/how-to-insert-other-controls-inside-a-grid-cell-in-maui-datagrid

Repository files navigation

Insert other controls inside-a DataGridCell in MAUI DataGrid

In.NET MAUI DataGrid (SfDataGrid) allows you to insert other controls inside a DataGridCell . To insert a Entry, you can create a DataGridTemplateColumn and load the control into the CellTemplate property.

XAML

<syncfusion:SfDataGrid x:Name="dataGrid" 
                    ColumnWidthMode="Auto" 
                    AutoGenerateColumnsMode="None"
            ItemsSource="{Binding Employees}">

    <syncfusion:SfDataGrid.Columns>
        <syncfusion:DataGridNumericColumn MappingName="EmployeeID" HeaderText="Employee ID" Format="d"/>
        <syncfusion:DataGridTemplateColumn MappingName="Name">
            <syncfusion:DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Entry x:Name="label" Text="{Binding Name}" TextColor="Black" WidthRequest="150" 
            HorizontalOptions="Center" VerticalOptions="Center" />
                </DataTemplate>
            </syncfusion:DataGridTemplateColumn.CellTemplate>
        </syncfusion:DataGridTemplateColumn>
        <syncfusion:DataGridTextColumn MappingName="Title" />
        <syncfusion:DataGridTextColumn MappingName="ContactID" HeaderText="Contact ID"/>
    </syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>

How to insert control in DataGridCell

Conclusion

I hope you enjoyed learning about how to insert other controls inside a DatagridCell in MAUI DataGrid (SfDataGrid).

You can refer to our .NET MAUI DataGrid’s feature tour page to know about its other groundbreaking feature representations. You can also explore our .NET MAUI DataGrid Documentation to understand how to present and manipulate data. For current customers, you can check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our .NET MAUI DataGrid and other .NET MAUI components. If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac or feedback portal. We are always happy to assist you!

About

how to insert other controls inside a grid cell in maui datagrid

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages