Skip to content

Commit cfabf58

Browse files
committed
Added UG content for the DisplayMemberPath Feature in MAUI DataGrid
1 parent 4229d58 commit cfabf58

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

MAUI/ListView/viewappearance.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,21 @@ public class MainPage : ContentPage
101101

102102
![MAUI ListView Data Template Selector](Images/appearance/maui-listview-applying-the-data-template-selector.jpg)
103103

104+
## 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" DisplayMemberPath="BookName" />
111+
{% endhighlight %}
112+
{% highlight c# tabtitle="MainPage.xaml.cs" %}
113+
listView.DisplayMemberPath = Model.BookName;
114+
{% endhighlight %}
115+
{% endtabs %}
116+
117+
N> The ItemTemplate property takes precedence over DisplayMemberPath. If both are set, ItemTemplate will be used.
118+
104119
## Horizontal ListView
105120

106121
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`.

0 commit comments

Comments
 (0)