Hi guys,
I'm trying to set the dropdown values on my datagrid from a table on my database and I can't seem to do it.
I can make it work with a hard-coded list like in your online examples, and I can make it work with selecting a value from the table the grid populates, but either of these are suitable in my case - I need the user to pick a value from a list and I need that list to be based on a database table that another process maintains.
Below is as far as i can get, but it seems like the edit params takes the empty list (ie before the OnInitializedAsync fills it) and then doesn't pick up the changes.
in my grid I have:
EditType="EditType.DropDownEdit" EditorSettings="@KeyWordTypeEditParams"
in the code is;
public static List<NewsLinkEntityType> NewsLinkEntityTypes;
public IEditorSettings KeyWordTypeEditParams = new DropDownEditCellParams
{
Params = new DropDownListModel<object, object>() { DataSource = NewsLinkEntityTypes, AllowFiltering = true }
};
protected override async Task OnInitializedAsync()
{
NewsLinkEntityTypes = await AlertDataServices.GetNewsLinkEntityTypes(); //database call to populate
}
Any help would be most appreciated.