RadzenDropDownDataGrid Reload/Refresh Data

What is the best way to get the Data updated on the control RadzenDropDownDataGrid. For example I add a new dataset or I delete a dataset, the RadzenDropDownDataGrid is not showing the new data. The new Data shows, after I interact with the control

I try already:

await InvokeAsync(StateHasChanged);
await StateHasChanged();

Thanks

These will just schedule UI refresh, you might need to to reget your data bound to the DataGrid Data property.

Well, I do so, but it is still not working, is there something I miss?

<RadzenDropDownDataGrid TValue="string" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowFiltering="true" AllowClear="true" Visible="<at_sign>ToogleValueEntrySelect"
Data=<at_sign>_SQLSoNO Style="width:100%" Disabled="<at_sign>isSubmitting"
TextProperty="Cust_name" ValueProperty="SoNO" AllowFilteringByAllStringColumns="true"
Change=<at_sign>(args => OnChangeDropDown(args, "DropDownDataGrid with filtering by all string columns"))>





<at_sign>code {

ObservableCollection<SQLSoNO> _SQLSoNO = new ObservableCollection<SQLSoNO>();

// After I add or delete an DB entry, I newly read the DB into the ObservableCollection, which is bound to the RadzenDropDownDataGrid
async Task SelectDB()
{
_SQLSoNO.Clear();

... read from SQL and read the data from the SQL DB new to the ObservableCollection:

_SQLSoNO.Add(new SQLSoNO { SoNO = reader[2].ToString(), Custno = reader[8].ToString(), Cust_name = reader[9].ToString() });

await InvokeAsync(StateHasChanged);
}

public class SQLSoNO
{
    public string SoNO { get; set; }
    public string Custno { get; set; }
    public string Cust_name { get; set; }
}

}

Try setting a new value to _SQLSoNO not just adding new items to it. For example

_SQLSoNO = _SQLSoNO.ToList();

I found a soultion:

added a reference to the Element:
@ref="wcsSoNOGrid"
RadzenDropDownDataGrid wcsSoNOGrid;

and than reset the element "before" I add the Data new to the ObservableCollection, which is binded to the element

wcsSoNOGrid.Reset();
await InvokeAsync(StateHasChanged);
....
_soStatus.Add(new SOStatus { order = items["order"].ToString(), time = parseTime.ToString().ToString(), .....
....

This is actually working for me

Thank you - this worked for me also.

In my case, I also had to use:

    await InvokeAsync(StateHasChanged);
    await Task.Delay(1);

before and after the grid reset.

Maybe in the future the DropDownDataGrid can work like the regular drop down.

Mike