From 090479a82e37359ae2bd7a3a02e145c353385744 Mon Sep 17 00:00:00 2001 From: brauerj-gc <126491934+brauerj-gc@users.noreply.github.com> Date: Fri, 22 Nov 2024 03:50:33 -0500 Subject: [PATCH] Demos: Minor Improvements to Sample Pages (#5867) * Removing duplicate EmployeeData.Genders column * Minor improvements to Sample pages * Formating * Formating --------- Co-authored-by: Mladen Macanovic --- .../Tests/DataGrid/GroupSinglePage.razor | 3 +- .../Pages/Tests/ListViewPage.razor | 58 ++++++++++++++++++- .../Pages/Tests/SelectListPage.razor | 30 +++++++++- 3 files changed, 86 insertions(+), 5 deletions(-) diff --git a/Demos/Blazorise.Demo/Pages/Tests/DataGrid/GroupSinglePage.razor b/Demos/Blazorise.Demo/Pages/Tests/DataGrid/GroupSinglePage.razor index 0df770a7ac..34b8c4cc4d 100644 --- a/Demos/Blazorise.Demo/Pages/Tests/DataGrid/GroupSinglePage.razor +++ b/Demos/Blazorise.Demo/Pages/Tests/DataGrid/GroupSinglePage.razor @@ -19,7 +19,8 @@ Responsive ShowPager ShowPageSizes - Groupable> + Groupable + GroupBy="x => x.Gender"> diff --git a/Demos/Blazorise.Demo/Pages/Tests/ListViewPage.razor b/Demos/Blazorise.Demo/Pages/Tests/ListViewPage.razor index 886329f5b8..ffa3bf90f4 100644 --- a/Demos/Blazorise.Demo/Pages/Tests/ListViewPage.razor +++ b/Demos/Blazorise.Demo/Pages/Tests/ListViewPage.razor @@ -1,4 +1,5 @@ @page "/tests/listview" +@using System.Linq @@ -20,18 +21,71 @@ + + + + With custom item content + + + + +
+ @context.Item.Iso + @context.Item.Capital +
+ @context.Text +
+
+
+
+
+
+ + + + + Styling Individual Items + + + + + + + + Selected Item: @selectedListViewItem?.Name + + + + + @code { [Inject] public CountryData CountryData { get; set; } - public IEnumerable Countries; + public List Countries; private Country selectedListViewItem { get; set; } protected override async Task OnInitializedAsync() { - Countries = await CountryData.GetDataAsync(); + Countries = (await CountryData.GetDataAsync()).ToList(); await base.OnInitializedAsync(); } } \ No newline at end of file diff --git a/Demos/Blazorise.Demo/Pages/Tests/SelectListPage.razor b/Demos/Blazorise.Demo/Pages/Tests/SelectListPage.razor index 9447d7a9ec..b18d37724e 100644 --- a/Demos/Blazorise.Demo/Pages/Tests/SelectListPage.razor +++ b/Demos/Blazorise.Demo/Pages/Tests/SelectListPage.razor @@ -28,6 +28,33 @@ + + + + With Multiple Selections + + + + Select Value + + + + + + + Selected value(s): @(selectedListValues != null ? string.Join( ',', selectedListValues ) : "") + + + + + @code { @@ -36,12 +63,11 @@ public IEnumerable Countries; private string selectedListValue { get; set; } + IReadOnlyList selectedListValues { get; set; } protected override async Task OnInitializedAsync() { Countries = await CountryData.GetDataAsync(); await base.OnInitializedAsync(); } - - } \ No newline at end of file