Error message that states "Syncfusion does not contain a definition for Blazor"
I am trying to build a Blazor server app that uses Datagrids. I am able display grids and even edit them. However, if I attempt to use
Mode="Syncfusion.Blazor.Grids.EditMode.Dialog"
I get an error message that states Syncfusion does not contain a definition for Blazor.
The razor page, app.razor and program.cs are given below
@page "/accountgrowthmodels"
@using static PorfolioAnalysis.Components.Class_files.AccountGrowthModel
@using Syncfusion.Blazor.Grids
@rendermode InteractiveServer
<div class="d-inline-flex flex-column"
<h3>Account Growth Models</h3>
<br />
<SfGrid DataSource="PortfolioComposition" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })">
<GridEditSettings AllowAdding="true"
AllowDeleting="true"
AllowEditing="true"
ShowAddNewRow="false"
Mode="Syncfusion.Blazor.Grids.EditMode.Dialog">
</GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(PortfolioAccountElement.AccountType) HeaderText="Account Type" Format="P0" TextAlign="TextAlign.Center" AllowEditing="true" ></GridColumn>
<GridColumn Field=@nameof(PortfolioAccountElement.AccountPct) HeaderText="Percentage" Format="P0" TextAlign="TextAlign.Center" AllowEditing="true" ></GridColumn>
</GridColumns>
</SfGrid>
</div>
@code {
public List<NormalParameters> _normalDistributions = new List<NormalParameters>();
public List<PortfolioAccountElement> PortfolioComposition { get; set; } = new List<PortfolioAccountElement>();
protected override void OnInitialized()
{
GetListOfNormalParametersFromCsv();
GetListOfPortfolioAccountElementsFromCsv();
}
private void GetListOfNormalParametersFromCsv()
{
string path = GetFilePath("NormalParameters.csv");
_normalDistributions = ListOfObjFromCsvWithHeader(path, new NormalParameters());
}
private void GetListOfPortfolioAccountElementsFromCsv()
{
string path = GetFilePath("PortfolioAccountComposition.csv");
PortfolioComposition = ListOfObjFromCsvWithHeader(path, new PortfolioAccountElement());
}
}
App.razor:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base rel='nofollow' href="/" />
<link rel="stylesheet" rel='nofollow' href="bootstrap/bootstrap.min.css" />
<link rel="stylesheet" rel='nofollow' href="app.css" />
<link rel="stylesheet" rel='nofollow' href="PorfolioAnalysis.styles.css" />
<link rel="icon" type="image/png" rel='nofollow' href="favicon.png" />
<!--Syncfusion-->
<link rel='nofollow' href="BlazorServerApp.styles.css" rel="stylesheet" />
<link rel="stylesheet" rel='nofollow' href="BlazorServerApp.styles.css" />
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap5.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
<link rel='nofollow' href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
<HeadOutlet />
</head>
<body>
<Routes />
<script src="_framework/blazor.web.js"></script>
<!--Use below script reference if you are using Syncfusion.Blazor Single NuGet-->
<script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
</body>
</html>
Program.cs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base rel='nofollow' href="/" />
<link rel="stylesheet" rel='nofollow' href="bootstrap/bootstrap.min.css" />
<link rel="stylesheet" rel='nofollow' href="app.css" />
<link rel="stylesheet" rel='nofollow' href="PorfolioAnalysis.styles.css" />
<link rel="icon" type="image/png" rel='nofollow' href="favicon.png" />
<!--Syncfusion-->
<link rel='nofollow' href="BlazorServerApp.styles.css" rel="stylesheet" />
<link rel="stylesheet" rel='nofollow' href="BlazorServerApp.styles.css" />
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap5.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
<link rel='nofollow' href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
<HeadOutlet />
</head>
<body>
<Routes />
<script src="_framework/blazor.web.js"></script>
<!--Use below script reference if you are using Syncfusion.Blazor Single NuGet-->
<script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
</body>
</html>
Hi Dennis Imbro,
We are unable to reproduce the reported issue when attempting to reproduce the
issue. For your reference, we have attached a simple sample. To
further address the reported problem, we require some additional clarification
from your end. Please provide the details below to help us proceed:
- To analyze the reported issue, could you please provide a simple and reproducible sample that demonstrates the problem? This will assist us in identifying the issue more efficiently and providing a resolution.
- Alternatively, could you share your attempt to replicate the issue using the attached simple sample?
The information you provide will be very helpful in validating the reported query on our end and in providing a solution as quickly as possible. Thank you for your understanding.
Regards,
Prathap Senthil
Attachment: BlazorDataGrid_d6b4c602.zip
- 1 Reply
- 2 Participants
-
DI Dennis Imbro
- Nov 11, 2024 09:36 PM UTC
- Nov 12, 2024 01:06 PM UTC