Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
HI, I create scaffolding page but I got this error message: (Visual Studio 2019 NetCore3.1)
Error CS0234 The type or namespace name 'EJ2' does not exist in the namespace 'Syncfusion' (are you missing an assembly reference?) MyBalzorApp C:\SyncFusion\SyncfusionScaffolding\MyBalzorApp\Pages\RazorDataGrid.razor 4 Active
@page "/RazorDataGrid"
@using MyBalzorApp.Model;
@using Syncfusion.EJ2.Blazor.Data;
@using Syncfusion.EJ2.Blazor;
@using Syncfusion.EJ2.Blazor.Grids;
@using MyBalzorApp.Data
@inject CtrlDataGridService data;
@code {
public class CustomAdaptor : DataAdaptor {
public CtrlDataGridService data = new CtrlDataGridService();
public override object Read(DataManagerRequest dm, string key = null)
{
IEnumerable DataSource = data.GetAllOrders().ToList();
if (dm.Search != null && dm.Search.Count > 0)
{
// Searching
DataSource = DataOperations.PerformSearching(DataSource, dm.Search);
}
if (dm.Sorted != null && dm.Sorted.Count > 0)
{
// Sorting
DataSource = DataOperations.PerformSorting(DataSource, dm.Sorted);
}
if (dm.Where != null && dm.Where.Count > 0)
{
// Filtering
DataSource = DataOperations.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator);
}
int count = DataSource.Cast().Count();
if (dm.Skip != 0)
{
//Paging
DataSource = DataOperations.PerformSkip(DataSource, dm.Skip);
}
if (dm.Take != 0)
{
DataSource = DataOperations.PerformTake(DataSource, dm.Take);
}
return dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = count } : (object)DataSource;
}
public override object Insert(DataManager dataManager, object value, string key)
{
data.AddOrder(value as Customers);
return value;
}
public override object Update(DataManager dataManager, object value, string keyField, string key)
{
data.UpdateOrder(value as Customers);
return value;
}
}
EjsGrid Grid;
}