From 94385434fe0421a64da9f0fdb400e26d5e732469 Mon Sep 17 00:00:00 2001 From: Anandh-SF4665 Date: Fri, 12 Sep 2025 10:05:38 +0530 Subject: [PATCH] Updated the README.md file --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index e20b0d0..a10521d 100644 --- a/README.md +++ b/README.md @@ -1 +1,41 @@ **[View document in Syncfusion .NET MAUI Knowledge Base](https://www.syncfusion.com/kb/13165/how-to-apply-alternate-row-style-in-net-maui-listview-sflistview)** + +## Sample + +```xaml + + + + + + + + + + + . . . + . . . + + + + + + +C#: + +public class IndexToColorConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + var listview = parameter as SfListView; + var index = listview.DataSource.DisplayItems.IndexOf(value); + + return index % 2 == 0 ? Colors.LightGray : Colors.Aquamarine; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} +```