@page "/"
<SfAutoComplete @ref="autoCompleteObj" ID="CaseId" TValue="string" TItem="Countries" Placeholder="Case" @bind-Value="AutoVal" DataSource="@LocalData">
<AutoCompleteFieldSettings Value="Name"></AutoCompleteFieldSettings>
<AutoCompleteEvents TValue="string" ValueChange="onChange"></AutoCompleteEvents>
</SfAutoComplete>
@code {
public string AutoVal = "Canada";
public string dialogContent;
public class Countries
{
public string Name { get; set; }
public string Code { get; set; }
}
List<Countries> LocalData = new List<Countries>
{
new Countries() { Name = "Australia", Code = "AU" },
new Countries() { Name = "Bermuda", Code = "BM" },
new Countries() { Name = "Canada", Code = "CA" },
new Countries() { Name = "Cameroon", Code = "CM" },
new Countries() { Name = "Denmark", Code = "DK" },
new Countries() { Name = "France", Code = "FR" },
new Countries() { Name = "Finland", Code = "FI" },
new Countries() { Name = "Germany", Code = "DE" },
new Countries() { Name = "Greenland", Code = "GL" },
new Countries() { Name = "Hong Kong", Code = "HK" },
new Countries() { Name = "India", Code = "IN" },
new Countries() { Name = "Italy", Code = "IT" },
new Countries() { Name = "Japan", Code = "JP" },
new Countries() { Name = "Mexico", Code = "MX" },
new Countries() { Name = "Norway", Code = "NO" },
new Countries() { Name = "Poland", Code = "PL" },
new Countries() { Name = "Switzerland", Code = "CH" },
new Countries() { Name = "United Kingdom", Code = "GB" },
new Countries() { Name = "United States", Code = "US" },
};
private void onChange(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string> args)
{
var DropVal = args.Value;
var value = AutoVal;
}
public void closeDialog()
{
dialogObj.Hide();
}
}
|
public SfAutoComplete<string,Countries> autoCompleteObj; |