Skip to content

Commit 7dfd5f6

Browse files
Adding Core TreeGrid GS sample
Adding Core TreeGrid GS sample
1 parent 1bb7994 commit 7dfd5f6

File tree

79 files changed

+75336
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+75336
-2
lines changed

Pages/Error.cshtml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@page
2+
@model ErrorModel
3+
@{
4+
ViewData["Title"] = "Error";
5+
}
6+
7+
<h1 class="text-danger">Error.</h1>
8+
<h2 class="text-danger">An error occurred while processing your request.</h2>
9+
10+
@if (Model.ShowRequestId)
11+
{
12+
<p>
13+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
14+
</p>
15+
}
16+
17+
<h3>Development Mode</h3>
18+
<p>
19+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
20+
</p>
21+
<p>
22+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
23+
It can result in displaying sensitive information from exceptions to end users.
24+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
25+
and restarting the app.
26+
</p>

Pages/Error.cshtml.cs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
using System.Diagnostics;
4+
5+
namespace mycoreproject.Pages
6+
{
7+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
8+
[IgnoreAntiforgeryToken]
9+
public class ErrorModel : PageModel
10+
{
11+
public string? RequestId { get; set; }
12+
13+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
14+
15+
private readonly ILogger<ErrorModel> _logger;
16+
17+
public ErrorModel(ILogger<ErrorModel> logger)
18+
{
19+
_logger = logger;
20+
}
21+
22+
public void OnGet()
23+
{
24+
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
25+
}
26+
}
27+
28+
}

Pages/Index.cshtml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@page
2+
@model IndexModel
3+
@{
4+
ViewData["Title"] = "Home page";
5+
var taskData = TreeGridData.GetDefaultData();
6+
}
7+
8+
<ejs-treegrid id="treegrid"
9+
dataSource="taskData"
10+
childMapping="Children"
11+
treeColumnIndex="1"
12+
allowPaging=true
13+
allowSorting=true
14+
allowFiltering=true>
15+
<e-treegrid-columns>
16+
<e-treegrid-column field="TaskId"
17+
headerText="Task ID"
18+
textalign=Right
19+
width="95"></e-treegrid-column>
20+
<e-treegrid-column field="TaskName"
21+
headerText="Task Name"
22+
width="180"></e-treegrid-column>
23+
<e-treegrid-column field="StartDate"
24+
headerText="Start Date"
25+
format="yMd"
26+
textAlign="Right"
27+
width="115"></e-treegrid-column>
28+
<e-treegrid-column field="EndDate"
29+
format="yMd"
30+
headerText="End Date"
31+
textAlign="Right"
32+
width="115"></e-treegrid-column>
33+
<e-treegrid-column field="Duration"
34+
headerText="Duration"
35+
textAlign="Right"
36+
width="100"></e-treegrid-column>
37+
<e-treegrid-column field="Progress"
38+
headerText="Progress"
39+
textAlign="Right"
40+
width="105"></e-treegrid-column>
41+
<e-treegrid-column field="Priority"
42+
headerText="Priority"
43+
width="100"></e-treegrid-column>
44+
</e-treegrid-columns>
45+
</ejs-treegrid>

0 commit comments

Comments
 (0)