DataBound event not firing

Hello,

I have a dropdown inside my grid edit dialog:

 <SfDropDownList @bind-Value="@AddOrEditDto.MennyisegiEgyseg" TValue="OptionDto<int>" TItem="OptionDto<int>" Placeholder="Mennyiség egység" AllowFiltering="true" FloatLabelType="FloatLabelType.Always" Query="cbMEQuery">

                                                                <SfDataManager Url="api/me/options" CrossDomain="true" Adaptor="Adaptors.UrlAdaptor" Offline=true></SfDataManager>

                                                                <DropDownListEvents DataBound="@OnDropDownDataBound" TValue="OptionDto<int>" TItem="OptionDto<int>"></DropDownListEvents>

                                                                <DropDownListFieldSettings Text="Text" />

                                                            </SfDropDownList>


                                                            <SfButton CssClass="btn-form" IconCss="e-icons e-refresh" OnClick="@(async () => { cbMEQuery = new Query(); })"></SfButton>


    private void OnDropDownDataBound(DataBoundEventArgs args)

    {

        // Here, you can customize your code.

        DataBounded = true;

    }

    public bool DataBounded { get; set; } = false;


The problem is that the DataBound event never firing. Thanks for help!


12 Replies

MM Mohanraj Mathaiyan Syncfusion Team April 15, 2022 11:29 AM UTC

Hi SZL,


We are currently validating your requirement and we will update further details in two business day (4/19/2022).


Regards,

Mohanraj M



MM Mohanraj Mathaiyan Syncfusion Team April 20, 2022 12:49 PM UTC

Hi SZL,


Greetings from Syncfusion support.


We suggest you to use OnActionComplete event instead of DataBound event. This event triggers after data is fetched successfully.

Documentation : https://blazor.syncfusion.com/documentation/dropdown-list/events#onactioncomplete


We have also attached sample code for your reference.

<SfDropDownList TItem="GameFields" TValue="string" DataSource="@Games">

<DropDownListEvents TItem="GameFields" TValue="string" OnActionComplete="@OnActionCompletehandler"></DropDownListEvents>

<DropDownListFieldSettings Text="Text" Value="ID"></DropDownListFieldSettings>

</SfDropDownList>

 

@code {

public class GameFields

{

        public string ID { get; set; }

        public string Text { get; set; }

}

 

private List<GameFields> Games = new List<GameFields>() {

        new GameFields(){ ID= "Game1", Text= "American Football" },

        new GameFields(){ ID= "Game2", Text= "Badminton" },

        new GameFields(){ ID= "Game3", Text= "Basketball" },

        new GameFields(){ ID= "Game4", Text= "Cricket" },

     };

 

     private void OnActionCompletehandler()

    {

        // Here, you can customize your code.

    }

}



Regards,

Mohanraj M



Attachment: databound_b8abd41e.zip


SZ SZL April 20, 2022 02:04 PM UTC

Hi,

Thank you, this will be perfect I think. 

I have only one problem:

When I set the OnActionBegin and OnActionComplete events, after click on the refresh button at runtime the application and the browser freezing. This button uses the Query parameter to refresh the dropdown datasource. 

When I remove the two event handler the refresh button works again.

Can you help me please what cause this behavior?


I attach my code again:

 <SfDropDownList @bind-Value="@AddOrEditDto.MennyisegiEgyseg" TValue="OptionDto<int>" TItem="OptionDto<int>" TabIndex="9" Placeholder="Mennyiség egység" AllowFiltering="true" FloatLabelType="FloatLabelType.Always" Query="cbMEQuery">

                                                                <SfDataManager Url="api/mennyisegiegyseg/options" CrossDomain="true" Adaptor="Adaptors.UrlAdaptor" Offline=true></SfDataManager>

                                                                <DropDownListEvents OnActionBegin="@OnActionBeginHandler" OnActionComplete="@OnActionCompletehandler" TValue="OptionDto<int>" TItem="OptionDto<int>"></DropDownListEvents>

                                                                <DropDownListFieldSettings Text="Text" />

                                                            </SfDropDownList>

// Refresh button:

                                                            <SfButton Type="button" CssClass="btn-form" IconCss="e-icons e-refresh" OnClick="@(async () => { cbMEQuery = new Query(); })"></SfButton>



    private void OnActionBeginHandler(ActionBeginEventArgs args)

    {

        // Here, you can customize your code.

        DataBounded = false;

    }


    private void OnActionCompletehandler(ActionCompleteEventArgs<OptionDto<int>> args)

    {

        // Here, you can customize your code.

        DataBounded = true;

    }


    public bool DataBounded { get; set; } = true;

    protected Query cbMEQuery { get; set; }




SZ SZL replied to SZL April 20, 2022 06:51 PM UTC

I have some additional information: the OnActionBegin event handler causes the problem, with only the OnActionCompleted event handler working. 



SP Sureshkumar P Syncfusion Team April 21, 2022 02:54 PM UTC

Based on your shared information, we have validated your reported requirement from our end. We will update you with further details in one business day (April 22nd,2022).



SP Sureshkumar P Syncfusion Team April 26, 2022 02:01 PM UTC

Thanks for your shared information. We have confirmed the reported issue is an issue at our end and this fix will be included in our upcoming patch release, which is expected to be rolled out on May 17th,2022.

You can track the status of this issue from the below feedback.

Feedback: https://www.syncfusion.com/feedback/34457

Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization



SZ SZL replied to Sureshkumar P April 27, 2022 07:19 AM UTC

Thank you for help!



SP Sureshkumar P Syncfusion Team April 28, 2022 05:46 AM UTC

SZL,


Thanks for your update.


Regards,

Sureshkumar P



SP Sureshkumar P Syncfusion Team May 19, 2022 12:34 PM UTC

We are facing complexity to resolve this issue. We will include it in the upcoming weekly patch release.

Which is expected to be rolled out on May 31st, 2022.



SP Sureshkumar P Syncfusion Team May 31, 2022 10:54 AM UTC

Hi SZL,


We are glad to announce that the fix for the reported issue has been implemented in the weekly patch release 20.1.57. We request you to update the NuGet to the latest version to get rid of this issue.


Find the release notes here: https://blazor.syncfusion.com/documentation/release-notes/20.1.57?type=all#dropdownlist


Regards,

Sureshkumar P



SZ SZL replied to Sureshkumar P June 1, 2022 06:42 AM UTC

Hy,


Thank you, I tested it, it seems good.


Thanks for help!


BR, SZL



SP Sureshkumar P Syncfusion Team June 2, 2022 05:32 AM UTC

SZL,


Thanks for your update.


Regards,

Sureshkumar P


Loader.
Up arrow icon