TL;DR: Struggling to make your .NET MAUI DataGrid match your app’s theme? This weblog exhibits you learn how to simply customise rows, headers, and choice kinds utilizing Syncfusion’s built-in theme useful resource keys and styling choices, so your UI seems clear, trendy, and constant in mild and darkish modes.
In relation to constructing trendy, polished apps, look issues. With Syncfusion’s highly effective .NET MAUI DataGrid, you’re not caught with a default look, you’ll be able to elevate your UI with only a few easy tweaks. Whether or not you’re concentrating on mild or darkish themes, or seeking to mirror your model’s distinctive type, customizing the DataGrid is each simple and versatile.
On this weblog submit, we’ll stroll you thru fast and efficient methods to type your DataGrid, from row colours and fonts to header highlights and choice suggestions. Utilizing theme useful resource keys and intuitive styling choices, you’ll be able to remodel your grid right into a seamless extension of your app’s design.
Prepared to show default into pleasant? Let’s get styling!
We’ll cowl learn how to customise:
- Information row
- Header row
- Stacked header row
- Choice row
Information row customization
The looks of Information row colours could be modified by the next approaches.
Methodology 1: Easy customization with default kinds
Customers can simply customise the looks of rows in a SfDataGrid by making use of a default type. DataGridStyle is a Syncfusion-defined class that permits you to customise the appear and feel of the DataGrid. The RowBackground property particularly units the background colour of all knowledge rows.
<syncfusion:SfDataGrid ItemsSource="{Binding OrderInfoCollection}"> <syncfusion:SfDataGrid.DefaultStyle> <syncfusion:DataGridStyle RowBackground="Beige" /> </syncfusion:SfDataGrid.DefaultStyle> </syncfusion:SfDataGrid>
Methodology 2: Create a constant look with implicit kinds
In SfDataGrid, customers can simply apply styling to totally different elements of the grid utilizing XAML. This type applies to all DataGridRow parts within the Syncfusion DataGrid, which means it should robotically have an effect on every row within the grid. When the type is utilized, all rows within the DataGrid could have a beige background, making the information extra visually interesting and simpler to learn. This strategy is beneficial once you desire a constant look throughout the complete grid.
<Model TargetType="syncfusion:DataGridRow"> <Setter Property="Background" Worth="Beige" /> </Model>

Methodology 3: Customise utilizing DataGrid cells
In DataGrid element, this may be simply achieved by making use of an implicit type to the DataGridCell. By defining an implicit type, builders can guarantee constant formatting all through the complete DataGrid.
The person can customise the information row colour by making use of an implicit type to the DataGridCell. All DataGridCell within the Syncfusion DataGrid could have a beige background and purple textual content colour, giving a uniform look to all knowledge rows.
<Model TargetType="syncfusion:DataGridCell"> <Setter Property="Background" Worth="Beige" /> <Setter Property="TextColor" Worth="Purple" /> </Model>

Header row customization
There are a number of approaches obtainable to customise the colour of the header row:
Methodology 1: Header row customization with default kinds
Enhancing the visible attraction and readability of your SfDataGrid could be achieved by customizing the header row’s look. The DefaultStyle property permits you to apply a uniform type to numerous elements of the grid, together with the header row.
By setting the header row’s background colour, you create a transparent distinction between the headers and the information rows. Making use of daring styling to the header textual content emphasizes the column titles, making them extra outstanding. Altering the font household provides a singular typographic contact; guarantee this font is accessible and correctly referenced in your mission. Lastly, coloring the header textual content supplies a powerful distinction in opposition to the background, making the headers stand out successfully.
<syncfusion:SfDataGrid ItemsSource="{Binding OrderInfoCollection}"> <syncfusion:SfDataGrid.DefaultStyle> <syncfusion:DataGridStyle HeaderRowBackground="Beige" HeaderRowFontAttributes="Daring" HeaderRowFontFamily="Congenial Black" HeaderRowTextColor="Purple" /> </syncfusion:SfDataGrid.DefaultStyle> </syncfusion:SfDataGrid>

Methodology 2: Header row customization with implicit kinds
Customers can modify the background colour of the header row in a SfDataGrid, customers can outline a mode concentrating on the DataGridHeaderRow management. The Model ingredient is ready to use to all DataGridHeaderRow parts inside its scope by specifying syncfusion:DataGridHeaderRow because the TargetType. The Setter ingredient assigns the colour to the Background property of the header row, thereby altering its background colour. This strategy permits for a constant and centralized method to type the header row’s background throughout your knowledge grid.
<Model TargetType="syncfusion:DataGridHeaderRow"> <Setter Property="Background" Worth="Beige" /> </Model>

Methodology 3: Customise utilizing DataGrid header cells
Customizing the looks of the header cells in SfDataGrid enhances the visible attraction and readability of your knowledge grid. By defining a Model concentrating on the DataGridHeaderCell, you’ll be able to uniformly apply particular styling attributes to all header cells. By making use of this type, you obtain a custom-made header row that not solely improves the aesthetics of your knowledge grid but in addition contributes to a extra intuitive and user-friendly interface.
Consult with the code instance under,
<Model TargetType="syncfusion:DataGridHeaderCell"> <Setter Property="FontAttributes" Worth="Daring" /> <Setter Property="Background" Worth="Beige" /> <Setter Property="FontFamily" Worth="Congenial Black" /> <Setter Property="TextColor" Worth="Purple" /> </Model>

Stacked header row customization
Methodology 1: Stacked header row customization with default kinds
A stacked header permits grouping a number of columns beneath a single header label, enhancing each the construction and readability of your knowledge grid. To additional enhance its visible attraction, you’ll be able to customise the default type of the stacked header row.
- StackedHeaderRowBackground defines the background colour of the stacked header row, including a refined and refined contact to the structure.
- StackedHeaderRowFontAttributes applies font styling, corresponding to daring or italic, to make header textual content extra outstanding and simpler to learn.
- StackedHeaderRowFontFamily specifies the font used for header textual content, permitting you to create a extra personalised and branded interface. (Make sure the chosen font is appropriately added to your mission assets.)
- StackedHeaderRowTextColor units the textual content colour of the stacked header row, serving to to visually spotlight header labels and enhance distinction.
These properties collectively provide a easy but efficient method to align the grid’s look along with your software’s design language.
Consult with the code instance under,
<syncfusion:SfDataGrid.DefaultStyle> <syncfusion:DataGridStyle StackedHeaderRowBackground="Beige" StackedHeaderRowFontAttributes="Daring" StackedHeaderRowFontFamily="Congenial Black" StackedHeaderRowTextColor="Purple" /> </syncfusion:SfDataGrid.DefaultStyle>

Methodology 2: Stacked header row customization with implicit kinds
When utilizing SfDataGrid in .NET MAUI, styling particular person elements enhances the general look and improves person expertise. One such element is the stacked header row, which permits grouping a number of columns beneath a single title.
Customers can customise this row not simply by the DefaultStyle property but in addition utilizing XAML implicit kinds. This defines a mode that targets all cases of DataGridStackedHeaderRowView. That is the visible container for the stacked header row in SfDataGrid. Utilizing this strategy, you’ll apply styling globally to all stacked header rows inside the scope (sometimes the web page or software). Consult with the code instance.
<Model TargetType="syncfusion:DataGridStackedHeaderRowView"> <Setter Property="Background" Worth="Beige" /> </Model>

Methodology 3: Customizing DataGrid stacked header cells
Customers can customise the looks of every stacked header cell—a UI ingredient that seems when columns are grouped beneath a shared header. This specifies the management that the type will goal: DataGridStackedHeaderCell. These are the person cells inside a stacked header row in SfDataGrid.
This makes it simple to use a uniform look throughout all stacked header cells in your grid.
<Model TargetType="syncfusion:DataGridStackedHeaderCell"> <Setter Property="FontAttributes" Worth="Daring" /> <Setter Property="Background" Worth="Beige" /> <Setter Property="FontFamily" Worth="Congenial Black" /> <Setter Property="TextColor" Worth="Purple" /> </Model>

Choice row
The SfDataGrid from Syncfusion affords intensive styling capabilities that enable builders to create a extra participating and user-friendly interface. One vital facet of customization is how chosen rows, and the energetic cell seem to customers.
Through the use of the DataGridStyle inside SfDataGrid.DefaultStyle, customers can considerably enhance the visible suggestions and person interplay expertise of grid. These refined adjustments could make a giant distinction in how customers navigate and work together along with your software’s knowledge.

GitHub references
For extra particulars, check with the GitHub demo.
Attempt It Free
Conclusion
On this weblog, we explored learn how to personalize the Syncfusion .NET MAUI DataGrid to create a visually cohesive and user-friendly interface. By leveraging built-in styling choices and theme useful resource keys, builders can simply tailor each ingredient of the DataGrid to match their app’s design. Be at liberty to attempt these customization strategies and tell us your ideas within the feedback under!
The most recent model of Important Studio® is accessible from the license and downloads web page for our clients. If you happen to’re not a Syncfusion® buyer, attempt our 30-day free trial to guage our elements.
When you’ve got any questions or want help, you’ll be able to attain us by our assist discussion board, assist portal, or suggestions portal. We’re at all times right here to assist!