Hello when setting the grid DataSource I am getting the following error: Uncaught (in promise) Error: System.InvalidCastException: Invalid cast from 'System.String' to 'Syncfusion.EJ2.RazorComponents.DataManagerRequest'. My code is:
<EjsGrid id="Grid" ref="otherGrid" >
<GridEditSettings allowAdding="true" allowEditing="true" allowDeleting="true" Mode="@EditMode.Dialog"></GridEditSettings>
<GridColumns>
<GridColumn ref=@col Field=@nameof(OrdersDetails.CustomerID) HeaderText="Customer Name" Width="120"></GridColumn>
<GridColumn Field=@nameof(OrdersDetails.OrderDate) HeaderText=" Order Date" Format="yMd" TextAlign="@TextAlign.Right" Width="130"></GridColumn>
<GridColumn Field=@nameof(OrdersDetails.Freight) HeaderText="Freight" Format="C2" TextAlign="@TextAlign.Right" MinWidth="10" Width="120" MaxWidth="200"></GridColumn>
<GridColumn Field=@nameof(OrdersDetails.ShipCountry) HeaderText="Ship Country" Width="150"></GridColumn>
</GridColumns>
</EjsGrid>
@functions{
GridColumn col;
// EjsGrid defaultGrid;
EjsGrid otherGrid;
public string Temp { get; set; }
public List<OrdersDetails> gridData { get; set; }
protected override void OnAfterRender()
{
base.OnAfterRender();
this.otherGrid.DataSource = OrdersDetails.GetAllRecords();
col.Template = "<a rel='nofollow' href='counter'>redirect</a>";
this.otherGrid.GridLines = GridLine.Both;
}
}