Skip to content

Commit

Permalink
Merge pull request #2 from Backiaraj/listview
Browse files Browse the repository at this point in the history
Update the project
  • Loading branch information
rajendranr-5483 authored Nov 30, 2023
2 parents 3e73094 + 392c2d7 commit 5780781
Show file tree
Hide file tree
Showing 32 changed files with 708 additions and 374 deletions.
7 changes: 4 additions & 3 deletions App.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

<Router AppAssembly="@typeof(Program).Assembly">
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
39 changes: 0 additions & 39 deletions BlazorApp20.csproj

This file was deleted.

13 changes: 13 additions & 0 deletions Data/WeatherForecast.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace ListViewWithPagination.Data
{
public class WeatherForecast
{
public DateOnly Date { get; set; }

public int TemperatureC { get; set; }

public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);

public string? Summary { get; set; }
}
}
20 changes: 20 additions & 0 deletions Data/WeatherForecastService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace ListViewWithPagination.Data
{
public class WeatherForecastService
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};

public Task<WeatherForecast[]> GetForecastAsync(DateOnly startDate)
{
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
}).ToArray());
}
}
}
16 changes: 16 additions & 0 deletions ListViewWithPagination.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Blazor.Data" Version="23.1.44" />
<PackageReference Include="Syncfusion.Blazor.Lists" Version="23.1.44" />
<PackageReference Include="Syncfusion.Blazor.Navigations" Version="23.1.44" />
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.1.44" />
</ItemGroup>

</Project>
14 changes: 7 additions & 7 deletions BlazorApp20.sln → ListViewWithPagination.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32319.34
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApp20", "BlazorApp20.csproj", "{84D9E08F-24BA-4A52-B3C0-D01D60D74D4A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ListViewWithPagination", "ListViewWithPagination.csproj", "{A585F523-3213-4C82-880C-71A2D4A06829}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{84D9E08F-24BA-4A52-B3C0-D01D60D74D4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84D9E08F-24BA-4A52-B3C0-D01D60D74D4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84D9E08F-24BA-4A52-B3C0-D01D60D74D4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84D9E08F-24BA-4A52-B3C0-D01D60D74D4A}.Release|Any CPU.Build.0 = Release|Any CPU
{A585F523-3213-4C82-880C-71A2D4A06829}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A585F523-3213-4C82-880C-71A2D4A06829}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A585F523-3213-4C82-880C-71A2D4A06829}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A585F523-3213-4C82-880C-71A2D4A06829}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {232599DE-EAAC-4B3C-992D-F5C78D3422DE}
SolutionGuid = {5B9BD697-77B0-488C-9AF2-BEAB154D717B}
EndGlobalSection
EndGlobal
18 changes: 18 additions & 0 deletions Pages/Counter.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@page "/counter"

<PageTitle>Counter</PageTitle>

<h1>Counter</h1>

<p role="status">Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

@code {
private int currentCount = 0;

private void IncrementCount()
{
currentCount++;
}
}
42 changes: 42 additions & 0 deletions Pages/Error.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@page
@model ListViewWithPagination.Pages.ErrorModel

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Error</title>
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
</head>

<body>
<div class="main">
<div class="content px-4">
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>

@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}

<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
</div>
</div>
</body>

</html>
27 changes: 27 additions & 0 deletions Pages/Error.cshtml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;

namespace ListViewWithPagination.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }

public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);

private readonly ILogger<ErrorModel> _logger;

public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}

public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}
16 changes: 0 additions & 16 deletions Pages/Error.razor

This file was deleted.

47 changes: 47 additions & 0 deletions Pages/FetchData.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@page "/fetchdata"
@using ListViewWithPagination.Data
@inject WeatherForecastService ForecastService

<PageTitle>Weather forecast</PageTitle>

<h1>Weather forecast</h1>

<p>This component demonstrates fetching data from a service.</p>

@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}

@code {
private WeatherForecast[]? forecasts;

protected override async Task OnInitializedAsync()
{
forecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now));
}
}
2 changes: 1 addition & 1 deletion Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<SfPager PageSize="1" TotalItemsCount="3" PageChanged="click">
</SfPager>

@code{
@code {
public SfDataManager DataManagerRef { get; set; }
public static List<VehicleData> Vehicles = new List<VehicleData> {
new VehicleData { Text = "Hennessey Venom", Id = "Vehicle-01" },
Expand Down
30 changes: 13 additions & 17 deletions Pages/_Host.cshtml
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
@page "/"
@namespace BlazorApp20.Pages
@using Microsoft.AspNetCore.Components.Web
@namespace ListViewWithPagination.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = null;
}

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BlazorApp20</title>
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="https://cdn.syncfusion.com/blazor/20.2.36/styles/bootstrap5.css" rel="stylesheet"/>
<script src="https://cdn.syncfusion.com/blazor/20.2.36/syncfusion-blazor.min.js" type="text/javascript"></script>
<link href="css/site.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
<link href="ListViewWithPagination.styles.css" rel="stylesheet" />
<link rel="icon" type="image/png" href="favicon.png"/>
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
</head>
<body>
<app>

<component type="typeof(App)" render-mode="ServerPrerendered" />

</app>
<body>
<component type="typeof(App)" render-mode="ServerPrerendered" />

<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
</environment>
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>

<script src="_framework/blazor.server.js"></script>
</body>
</body>
</html>
Loading

0 comments on commit 5780781

Please sign in to comment.