{"id":23061646,"url":"https://github.com/syncfusionexamples/xamarin-forms-listview-custom-sorting","last_synced_at":"2026-03-10T11:04:49.895Z","repository":{"id":54414968,"uuid":"199802038","full_name":"SyncfusionExamples/xamarin-forms-listview-custom-sorting","owner":"SyncfusionExamples","description":"This example shows how to perform sorting using custom comparer in XForms ListView control.","archived":false,"fork":false,"pushed_at":"2025-09-24T10:55:11.000Z","size":1711,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-09T06:05:54.184Z","etag":null,"topics":["custom-sorting","sorting","xamarin","xamarin-listview"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SyncfusionExamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-07-31T07:20:45.000Z","updated_at":"2025-09-24T10:55:14.000Z","dependencies_parsed_at":"2025-09-25T23:32:14.946Z","dependency_job_id":null,"html_url":"https://github.com/SyncfusionExamples/xamarin-forms-listview-custom-sorting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SyncfusionExamples/xamarin-forms-listview-custom-sorting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2Fxamarin-forms-listview-custom-sorting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2Fxamarin-forms-listview-custom-sorting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2Fxamarin-forms-listview-custom-sorting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2Fxamarin-forms-listview-custom-sorting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SyncfusionExamples","download_url":"https://codeload.github.com/SyncfusionExamples/xamarin-forms-listview-custom-sorting/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2Fxamarin-forms-listview-custom-sorting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30331650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-sorting","sorting","xamarin","xamarin-listview"],"created_at":"2024-12-16T03:18:01.767Z","updated_at":"2026-03-10T11:04:49.866Z","avatar_url":"https://github.com/SyncfusionExamples.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xamarin-forms-listview-custom-sorting\nXamarin Forms ListView provides support to custom sort the items using Comparer.\n\n## Sample\n\n```xaml\n\u003csync:SfListView x:Name=\"listView\"\n                    ItemSize=\"70\" \n                    FocusBorderThickness=\"0\"\n                    SelectionBackgroundColor=\"#ECECEC\" IsScrollBarVisible=\"False\"\n                    ItemsSource=\"{Binding ContactsInfo}\"\u003e\n    \n    \u003csync:SfListView.DataSource\u003e\n        \u003cdataSource:DataSource\u003e\n            \u003cdataSource:DataSource.SortDescriptors\u003e\n                \u003cdataSource:SortDescriptor\u003e\n                    \u003cdataSource:SortDescriptor.Comparer\u003e\n                        \u003clocal:CustomSortComparer/\u003e\n                    \u003c/dataSource:SortDescriptor.Comparer\u003e\n                \u003c/dataSource:SortDescriptor\u003e\n            \u003c/dataSource:DataSource.SortDescriptors\u003e\n        \u003c/dataSource:DataSource\u003e\n    \u003c/sync:SfListView.DataSource\u003e\n    \n    \u003csync:SfListView.ItemTemplate\u003e\n        \u003cDataTemplate\u003e\n            \u003cViewCell\u003e\n                \u003cViewCell.View\u003e\n                    \u003ccode\u003e\n                    . . .\n                    . . .\n                    \u003ccode\u003e\n                \u003c/ViewCell.View\u003e\n            \u003c/ViewCell\u003e\n        \u003c/DataTemplate\u003e\n    \u003c/sync:SfListView.ItemTemplate\u003e\n\u003c/sync:SfListView\u003e\n\nCustomSortComparer:\npublic class CustomSortComparer : IComparer\u003cobject\u003e\n{\n    public int Compare(object x, object y)\n    {\n        if (x.GetType() == typeof(ListViewContactsInfo))\n        {\n            var xitem = (x as ListViewContactsInfo).ContactName;\n            var yitem = (y as ListViewContactsInfo).ContactName;\n\n            if (xitem.Length \u003e yitem.Length)\n            {\n                return 1;\n            }\n            else if (xitem.Length \u003c yitem.Length)\n            {\n                return -1;\n            }\n            else\n            {\n                if (string.Compare(xitem, yitem) == -1)\n                    return -1;\n                else if (string.Compare(xitem, yitem) == 1)\n                    return 1;\n            }\n        }\n\n        return 0;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncfusionexamples%2Fxamarin-forms-listview-custom-sorting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyncfusionexamples%2Fxamarin-forms-listview-custom-sorting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncfusionexamples%2Fxamarin-forms-listview-custom-sorting/lists"}