Hi Oliver,
Greetings from Syncfusion.
Query: DataGrid - issue when adding @ref I am trying to add @ref to a SfGrid. Getting an error when building. Any idea what I may missing here?
We suspect that you have not defined the Grid reference in @code section. You can resolve the reported problem by defining the Grid reference in @code section like below. Find the below code snippets for your reference.
|
<SfGrid @ref="Grid" DataSource="@Orders" Toolbar=@Tool>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
</GridColumns>
</SfGrid>
@code{
SfGrid<Order> Grid;
public List<Order> Orders { get; set; }
.. .
} |
Reference:
Please let us know if you have any concerns.
Regards,
Rahul