You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1012,6 +1018,177 @@ The [DataGridComboBoxColumn.CanFilterSuggestions](https://help.syncfusion.com/cr
1012
1018
{% endhighlight %}
1013
1019
{% endtabs %}
1014
1020
1021
+
## DataGridPickerColumn
1022
+
1023
+
The `DataGridPickerColumn` inherits all the properties of the [SfDataGrid.DataGridColumn](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridColumn.html). It displays a list of items in the form of a [SfPicker](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Picker.SfPicker.html) as the content of a column. To enable or disable editing for a particular column, set the [DataGridColumn.AllowEditing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridColumn.html#Syncfusion_Maui_DataGrid_DataGridColumn_AllowEditing) property to true or false. When in editing mode, it displays a `SfPicker` element. The data source for the `SfPicker` can be set using the `DataGridPickerColumn.ItemsSource` property. The picker column can be populated with data in the following ways:
1024
+
1025
+
* Collection of primitive types
1026
+
* Collection of user-defined types (custom objects)
1027
+
1028
+

1029
+
1030
+
### Collection of primitive types
1031
+
1032
+
To display the collection of items in the Picker drop-down, create a `DataGridPickerColumn` and set its `ItemsSource` property to a simple collection.
1033
+
1034
+
To load the `DataGridPickerColumn` with a simple string collection, you can refer to the code example below:
To display a list of user-defined items in the picker, create a `DataGridPickerColumn` and set its `ItemsSource` property to a user-defined collection. By default, if the `DisplayMemberPath` is not set, the picker column will display the values from the `MappingName` property of the column.
1109
+
1110
+
#### Display member path
1111
+
1112
+
Displays a value by comparing values of the properties set as `DataGridColumn.MappingName` and `ValueMemberPath` in their respective underlying collections. If the values of `ValueMemberPath` property contains the current value of `MappingName` property, its corresponding value of `DisplayMemberPath` property is displayed in the `DataGridCell`. Or else the `DataGridCell` appears blank. However, in edit mode the values of the `DisplayMemberPath` property are displayed as picker items.
1113
+
1114
+
#### Value member path
1115
+
1116
+
Once editing completed, the column having the `MappingName` equal to the `ValueMemberPath` has its data changed to the corresponding `ValueMemberPath` value for the selected `DisplayMemberPath` value in the picker.
1117
+
1118
+
### Loading different ItemSource for each row of DataGridPickerColumn
1119
+
1120
+
To load different ItemSources for each row of a DataGridPickerColumn, you can utilize the `DataGridPickerColumn.ItemsSourceSelector` property.
1121
+
1122
+
### Implementing IItemsSourceSelector
1123
+
1124
+
`DataGridPickerColumn.ItemsSourceSelector` needs to implement the IItemsSourceSelector interface, which requires you to implement the GetItemsSource method. This method receives the following parameters:
1125
+
1126
+
* Record: This is the data object associated with the row.
1127
+
* Data Context: This is the binding context of the data grid.
1128
+
1129
+
In the provided code, the ItemsSource for the ShipCity column is returned based on the value of the ShipCountry column. This is done by using the record and the binding context of the data grid, which are passed to the GetItemsSource method.
public class ItemSourceSelector : IItemsSourceSelector
1163
+
{
1164
+
public IEnumerable GetItemsSource(object record, object dataContext)
1165
+
{
1166
+
if (record == null)
1167
+
{
1168
+
return null;
1169
+
}
1170
+
1171
+
var orderinfo = record as DealerInfo;
1172
+
var countryName = orderinfo.ShipCountry;
1173
+
var viewModel = dataContext as EditingViewModel;
1174
+
1175
+
// Returns ShipCity collection based on ShipCountry.
1176
+
if (viewModel.ShipCities.ContainsKey(countryName))
1177
+
{
1178
+
string[] shipcities = null;
1179
+
viewModel.ShipCities.TryGetValue(countryName, out shipcities);
1180
+
return shipcities.ToList();
1181
+
}
1182
+
1183
+
return null;
1184
+
}
1185
+
}
1186
+
{% endhighlight %}
1187
+
{% endtabs %}
1188
+
1189
+

1190
+

1191
+
1015
1192
## DataGridNumericColumn
1016
1193
1017
1194
The `DataGridNumericColumn` inherits all the properties of the `DataGridColumn`. It is used to display numeric data. To create a `DataGridNumericColumn`, the property corresponding to the column in the underlying collection must be a numeric type (int, double, float, etc.).
The [SfDataGrid.CellValueChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.SfDataGrid.html) event will be triggered whenever the current cell's value has been changed in the DataGridTextColumn, DataGridNumericColumn, DataGridDateColumn, DataGridComboBoxColumn or DataGridCheckBoxColumn. This event handler contains the parameter of type [DataGridCellValueChangedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridCellValueChangedEventArgs.html) that contains the following properties.
351
+
The [SfDataGrid.CellValueChanged](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.SfDataGrid.html) event will be triggered whenever the current cell's value has been changed in the DataGridTextColumn, DataGridNumericColumn, DataGridDateColumn, DataGridComboBoxColumn, DataGridPickerColumn or DataGridCheckBoxColumn. This event handler contains the parameter of type [DataGridCellValueChangedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridCellValueChangedEventArgs.html) that contains the following properties.
352
352
353
353
*[Column](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridCellValueChangedEventArgs.html#Syncfusion_Maui_DataGrid_DataGridCellValueChangedEventArgs_Column) : Gets the current `DataGridColumn` that contains the grid cell for which value is edited or changed.
354
354
*[NewValue](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridCellValueChangedEventArgs.html#Syncfusion_Maui_DataGrid_DataGridCellValueChangedEventArgs_NewValue) : The newly edited value to be committed.
Copy file name to clipboardExpand all lines: MAUI/DataGrid/overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ The .NET MAUI DataGrid control is used to display and manipulate data in a tabul
18
18
19
19
***Data Binding** - Bind different types of data sources, including DataTable.
20
20
21
-
***Column Types** - Show different data types in different types of columns. The following column types are supported: numeric, text, date, checkbox, image, combobox and template. The template column is used to load any control in a column.
21
+
***Column Types** - Show different data types in different types of columns. The following column types are supported: numeric, text, date, checkbox, image, combobox, picker and template. The template column is used to load any control in a column.
22
22
23
23
***Column Resizing** - Interactive support to adjust the width of columns.
Copy file name to clipboardExpand all lines: MAUI/ListView/viewappearance.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,22 @@ public class MainPage : ContentPage
101
101
102
102

103
103
104
+
## Setting DisplayMemberPath
105
+
106
+
The `DisplayMemberPath` property in the SfListView provides a simple and efficient way to display a specific property from business objects without creating custom item template. This feature is especially useful for simple lists where you want to display a single property without defining a custom template.
107
+
108
+
{% tabs %}
109
+
{% highlight xaml tabtitle="MainPage.xaml" %}
110
+
<syncfusion:SfListView x:Name="listView"
111
+
DisplayMemberPath="BookName" />
112
+
{% endhighlight %}
113
+
{% highlight c# tabtitle="MainPage.xaml.cs" %}
114
+
listView.DisplayMemberPath = "BookName";
115
+
{% endhighlight %}
116
+
{% endtabs %}
117
+
118
+
N> The `ItemTemplate` property takes precedence over `DisplayMemberPath`. If both are set, `ItemTemplate` will be used.
119
+
104
120
## Horizontal ListView
105
121
106
122
The SfListView allows you to layout every item in the [SfListView.ItemsSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.ListView.SfListView.html#Syncfusion_Maui_ListView_SfListView_ItemsSource) property either in `Vertical` or `Horizontal` orientation by setting the [SfListView.Orientation](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.ListView.SfListView.html#Syncfusion_Maui_ListView_SfListView_Orientation). The default orientation is `Vertical`.
title: Customize Appearance in .NET MAUI MarkdownViewer | Syncfusion
4
+
description: Learn how to style and customize the appearance of Markdown content using the MarkdownStyleSettings class in the Syncfusion .NET MAUI MarkdownViewer control.
5
+
platform: MAUI
6
+
control: SfMarkdownViewer
7
+
documentation: ug
8
+
---
9
+
10
+
# Customize Appearance in .NET MAUI SfMarkdownViewer
11
+
12
+
The [SfMarkdownViewer]() control in .NET MAUI provides a powerful styling system through the `MarkdownStyleSettings` class. This allows developers to customize the visual presentation of Markdown content with precision and flexibility.
13
+
14
+
## Key Features
15
+
16
+
-**Granular Styling**: Customize font sizes and colors for headings, body text, and tables.
17
+
-**Custom CSS Support**: Apply advanced styling using raw CSS rules.
18
+
-**Two-Layer Styling System**: Merge base styles with custom CSS for full control.
19
+
-**Reset Functionality**: Revert all styles to default with a single method call.
20
+
21
+
## Use Cases
22
+
23
+
- Match Markdown content appearance with your app’s theme.
24
+
- Improve readability with tailored font sizes and spacing.
25
+
- Highlight specific Markdown elements like tables or code blocks.
26
+
- Apply branding styles using custom CSS.
27
+
28
+
## Customization with MarkdownStyleSettings
29
+
30
+
The appearance of headings and body content in SfMarkdownViewer can be customized using the MarkdownStyleSettings class.
31
+
32
+
[H1FontSize](), [H2FontSize](), [H3FontSize]() – Gets or sets the font size for H1, H2, and H3 heading elements respectively.
33
+
34
+
[H1Color](), [H2Color](), [H3Color]() – Gets or sets the text color for H1, H2, and H3 heading elements respectively.
35
+
36
+
[BodyFontSize]() – Gets or sets the font size for regular paragraph text.
37
+
38
+
[BodyTextColor]() – Gets or sets the text color for body content.
39
+
40
+
[TableHeaderFontSize](), [TableDataFontSize]() – Gets or sets the font size for table headers and table content respectively.
41
+
42
+
[TableHeaderTextColor](), [TableDataTextColor]() – Gets or sets the text color for table headers and table content respectively.
43
+
44
+
[TableBackground]() – Gets or sets the background color for the entire table area.
45
+
46
+
[CssStyleRules]() – Gets or sets raw CSS styles to override or extend default Markdown rendering behavior.
With [MarkdownStyleSettings](), you gain full control over how Markdown content looks in your .NET MAUI app—whether you're building a documentation viewer, a note-taking app, or a styled content portal.
0 commit comments