Hi there - I have a drop down list embedded in a column and would like to reset it once whatever selected action (1) has finished (2).
I've tried to set row data and full grid refresh. Thank you.
Building on the sample you provided in another of my forum threads ( Get selected record from drop down changed | Blazor Forums | Syncfusion ), I'm looking for a way to reset the drop down after it's been selected and the action has run in the handler.
Here, I selected 'One', and updated the row data.
Then I want to reset the drop down to it's original state, or better yet, rebind the the drop down data since the row has changed (see attached sample).
I've modified the sample from the other thread and attached it.
<GridColumn HeaderText="Customer Name" Width="150">
<Template>
<SfDropDownList Placeholder="OrderID" ID="OrderID" @bind-Value="@DropValue" TItem="KeyValuePair<string, int>" TValue="int" DataSource="@GetData()">
...
</SfDropDownList>
</Template>
</GridColumn>
public List<Order> Orders { get; set; }
SfGrid<Order> Grid { get; set; }
public int DropValue { get; set; }
...
public async Task ValueChangehandler(Syncfusion.Blazor.DropDowns.ChangeEventArgs<int, KeyValuePair<string,int>> args)
{
var SelectedRecords = await Grid.GetSelectedRecordsAsync().ConfigureAwait(false);
var check = SelectedRecords.FirstOrDefault();
//--
check.Freight = 10d;
await this.Grid.SetRowDataAsync(check.OrderID, check).ConfigureAwait(false);
DropValue = 0;
// TODO: reset drop down list..how do I get a handle to the drop down and reset it? args.Value = null? Or, rebind the data?
// Thank you :)
}
|