DropDownList Element ID not passed in v18.3.35 ValueChange Event

Prior to v18.3.35 in the ValueChange event I was able to retrieve the Element.ID via args.Element.ID.  Now this value is null.

                     <SfDropDownList id="sp1" TValue="string" TItem="ScoreFields" PopupHeight="100px" Width="100px" Placeholder="Score" DataSource="@SetScores">
                        <DropDownListFieldSettings Text="Text" Value="ID"></DropDownListFieldSettings>
                        <DropDownListEvents TItem="ScoreFields" TValue="string" ValueChange="@ScoreUpdated"></DropDownListEvents>
                    </SfDropDownList>


    public void ScoreUpdated(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, ScoreFields> args)
    {
        switch (args.Element.ID)


1 Reply 1 reply marked as answer

BC Berly Christopher Syncfusion Team December 1, 2020 12:43 PM UTC

Hi Carl, 
  
Greetings from Syncfusion support. 
  
From the Syncfusion NuGet version 18.3.0.35, we cannot receive the DOM element in the event arguments due to component rendering structure. So, we suggest you get the component ID from the component instance or passing the component ID in the change event arguments as mentioned in the below code.   
  
<SfDropDownList ID="sp1" @ref="DropObj" TValue="string" TItem="Countries" PopupHeight="100px" Width="100px" Placeholder="Score" DataSource="@Country"> 
    <DropDownListFieldSettings Text="Name" Value="Code"></DropDownListFieldSettings> 
    <DropDownListEvents TItem="Countries" TValue="string" ValueChange="@(e => ScoreUpdated(e, "sp1"))"></DropDownListEvents> 
</SfDropDownList> 
 
 
@code{ 
    SfDropDownList<string, Countries> DropObj; 
    public void ScoreUpdated(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, Countries> args, string id) 
    { 
        var componentID = this.DropObj.ID; 
    } 
} 

  
  
Regards, 
Berly B.C 


Marked as answer
Loader.
Up arrow icon