DataBound event not being triggered when using custom DataAdaptor to populate popup list

Hello,

I am using a custom DataAdaptor to retrieve the items for populating the autocomplete popup list. I need to hook into the point when the data is retrieved from the DataAdaptor. I would expect this to be the 

DataBound event based on the documentation "DataBound event triggers when the data source is populated in the popup list."

However, this event never seems to be fired. Please advise how I can execute my code at the point records have been retrieved from the ReadAsync call.

Thanks,
Chuck


3 Replies

DR Deepak Ramakrishnan Syncfusion Team December 19, 2021 07:26 AM UTC

 
 Hi Chuck, 
 
Greetings from Syncfusion support. 
 
We request you to use ‘OnActionComplete’  which will get triggered once the data fetched from the server successfully and you can get the items to be populated in popup through the Result property of the event arguments. You can refer the following code for your reference. 
 
 
<SfDropDownList TValue="string" TItem="OrderDetails" PopupHeight="230px" Placeholder="Select a name" Query="@RemoteDataQuery" > 
    <SfDataManager Url="https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Orders" CrossDomain="true" Adaptor="Syncfusion.Blazor.Adaptors.ODataAdaptor" /> 
    <DropDownListEvents TValue="string" TItem="OrderDetails" OnActionComplete="ActionCompleteHandler"></DropDownListEvents> 
    <DropDownListFieldSettings Text="CustomerID" Value="CustomerID" /> 
</SfDropDownList> 
 
@code { 
 
    public Query RemoteDataQuery = new Query().Select(new List<string> { "CustomerID" }).Take(6).RequiresCount(); 
    public class OrderDetails 
    { 
        public int? OrderID { get; set; } 
        public string CustomerID { get; set; } 
        public int? EmployeeID { get; set; } 
        public double? Freight { get; set; } 
        public string ShipCity { get; set; } 
        public bool Verified { get; set; } 
        public DateTime? OrderDate { get; set; } 
        public string ShipName { get; set; } 
        public string ShipCountry { get; set; } 
        public DateTime? ShippedDate { get; set; } 
        public string ShipAddress { get; set; } 
    } 
 
    public void ActionCompleteHandler(ActionCompleteEventArgs<OrderDetails> args) 
    { 
        var results = args.Result; 
    } 
 
} 
 
 
 
API documentation :

 
  
 
Thanks, 
Deepak R. 



CR Chuck Richardson January 24, 2022 11:50 PM UTC

Hello Deepak,


Apologies for the slow reply. I can confirm OnActionComplete is working as described and addresses my requirement.


Thanks,


Chuck



SP Sureshkumar P Syncfusion Team January 25, 2022 04:14 AM UTC

Hi Chuck, 
 
Thanks for your update. 
 
Regards, 
Sureshkumar P 


Loader.
Up arrow icon