Hi Gordon,
Greetings from Syncfusion support.
We have modified the sample based on this requirement, please download and refer the sample from the link below,
In above sample, we have maintained separate references for the SfDropDownList rendered inside Grid Template. Now by using these references, we have called the ClearAsync method of Dropdown to clear the input box.
Please refer the highlighted codes below,
<GridColumn HeaderText="Customer Name" Width="150">
<Template>
@{
var id = context as Order;
}
<SfDropDownList Placeholder="Select one..." @ref="DropRef[id.OrderID]" TItem="KeyValuePair<string, int>" TValue="int" DataSource="GetData()">
<DropDownListEvents TValue="int" TItem="KeyValuePair<string, int>" ValueChange="(e) => ValueChangehandler(e, id.OrderID)" />
<DropDownListFieldSettings Value="Value" Text="Key" />
</SfDropDownList>
</Template>
</GridColumn>
private Dictionary<int?, SfDropDownList<int,KeyValuePair<string, int>>> DropRef = new Dictionary<int?, SfDropDownList<int,KeyValuePair<string, int>>>(); //for storing DropDownList reference dynamicallypublic int? UniqueDropKey { get; set; }public async Task ValueChangehandler(Syncfusion.Blazor.DropDowns.ChangeEventArgs<int, KeyValuePair<string, int>> args, int? UniqueKey){ ... UniqueDropKey = UniqueKey; this.DialogVisible = true;} async Task Dialog_OnUpdate(){ ... await DropRef[UniqueDropKey].ClearAsync(); this.DialogVisible = false;}
|
Please get back to us if you need further assistance.
Regards,
Renjith R