Reset embedded drop down list

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.


3 Replies

JP Jeevakanth Palaniappan Syncfusion Team August 20, 2021 01:17 PM UTC

Hi Gordon, 

Greetings from Syncfusion support. 

We have checked your query but we are quite unclear about your exact requirement. So kindly share us the below details, 

  1. Share us more information about your query.
  2. Share us the complete grid rendering code with model class and datasource.
  3. Do you want to change the status column value when the dropdown column values is changed?.
  4. Share us a video demo showing your requirement.

The above requested details will be helpful for us to validate your requirement and to provide you with a better solution as early as possible. 

Regards, 
Jeevakanth SP. 



GO Gordon August 21, 2021 01:00 PM UTC

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. 


Attachment: BlazorApp_c4f4862c.zip


RS Renjith Singh Rajendran Syncfusion Team August 24, 2021 03:37 AM UTC

Hi Gordon, 

Based on this scenario, we suggest you to set the @bind-Value property for to achieve this requirement. Please refer and use the below highlighted codes. 

<GridColumn HeaderText="Customer Name" Width="150"> 
    <Template> 
      <SfDropDownList Placeholder="OrderID" ID="OrderID" @bind-Value="@DropValue" TItem="KeyValuePair<stringint>" TValue="int" DataSource="@GetData()"> 
          ... 
      </SfDropDownList> 
   </Template> 
</GridColumn> 
 
    public List<Order> Orders { getset; } 
    SfGrid<Order> Grid { getset; } 
    public int DropValue { getset; } 
    ... 
    public async Task ValueChangehandler(Syncfusion.Blazor.DropDowns.ChangeEventArgs<intKeyValuePair<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 :) 
    } 


Please get back to us if you need further assistance. 

Regards, 
Renjith R 


Loader.
Up arrow icon