If I have a grid like
<TelerikGrid @
ref
=
"@GridRef"
Data=
"@GridData"
> ...... </TelerikGrid>
private
ObservableCollection<WrittenVM> GridData {
get
;
set
; }
public
TelerikGrid<WrittenVM> GridRef {
get
;
set
; }
Everything works and GridRef gets a value
If I use this code
@
if
(GridData ==
null
)
{
<p><em>Loading...</em></p>
}
else
{
<TelerikGrid @
ref
=
"@GridRef"
Data=
"@GridData"
> ...... </TelerikGrid>
}
private
ObservableCollection<WrittenVM> GridData {
get
;
set
; }
public
TelerikGrid<WrittenVM> GridRef {
get
;
set
; }
GridRef doesn't get a value and stays null
The loading text is displayed but I use
protected
override
async Task OnAfterRenderAsync(
bool
firstRender)
{
if
(firstRender)
{
.....
if
(GridRef !=
null
)
{
await GridRef.SetState(desiredState);
}
StateHasChanged();
}
}
To make a custom state of the grid