Hi!Im using the latest version of Syncfusion Blazor (17.4.0.47)
I would like to get the selected item of a dropdownlist.
When i execute the button click and query _dropdown.Value, the result is always null.
I just updated the version, and it worked in older version of the components.
Thanks and regards,
Michael
Example code:
EjsDropDownList @ref="@_dropdown" TValue="int?" TItem="RowData" Placeholder="placeholder" DataSource="@list"
DropDownListFieldSettings Value="Id" Text="Text">
/EjsDropDownList
EjsButton OnClick="@Clicked" /EjsButton
@code {
public EjsDropDownList _dropdown;
public List list = new List() {
new RowData() { Id = 1, Text = "Text1"},
new RowData() { Id = 2, Text = "Text2"}
};
public void Clicked(MouseEventArgs args) {
var value = _dropdown.Value; // <= always null
}
public class RowData {
public int Id { get; set; }
public string Text { get; set; }
}
}
There are other (working) solutions, like hook the onChange event, buts not that clean, and i wouldnt like to do it with bindings...