Trying to reset SfStepProgressBar back to step 1, but last step state persists

I am having trouble resetting the last item in my ItemSource of 

SfStepProgressBarItems collection ....


If I just set 

        StepProgressBar.ActiveStepIndex = -1;

        StepProgressBar.ActiveStepProgressValue = -1;

It does not update the "status" of all the items, and if i "walk" backwards from the last step item to the first step item, the last step item cannot be "reset" to "not started".

Anyone have some insight for me?

Brett


2 Replies

BW Brett Whittaker June 12, 2025 09:28 PM UTC

i sort of figured it out - or at least got it working for me, what i had to do was "walk" back the progress values on each active step something like this below, it appears the UI and the item data source are not connected - even if i clear my item data source, the UI state memory is not auto reset

    private async Task AnimateBackwardsAsync()
    {
        for (int i = StepProgressBarItems.Count - 1; i >= -1; i--)
        {
            MainThread.BeginInvokeOnMainThread(() => {
                ActiveStepIndex = i;
                ActiveStepProgressValue = -1;
            });
            await Task.Delay(30);
        }
    }



AJ Arul Jenith Berkmans Syncfusion Team June 13, 2025 03:44 PM UTC

Hi Brett Whittaker,

 

We have validated your scenario and recommend increasing the delay from 30ms to 250ms, as the backward animation requires additional time for each step to complete smoothly. Additionally, based on the information in your clipboard, please ensure that you reset the ActiveStepProgressValue to 0 when resetting the steps.

 

Here is a simple code snippet for resetting steps:

 

private async Task AnimateBackwardsToStep(int targetStep)

{

    // Start from current active step and walk backwards

    for (int i = ActiveStepIndex; i >= targetStep; i--)

    {

        await MainThread.InvokeOnMainThreadAsync(() =>

        {

            ActiveStepIndex = i;

            ActiveStepProgressValue = 0; // Reset progress to 0 for current step

        });

        await Task.Delay(250); // Internally we handle the backward animation, so it needs time to complete each step.

    }

}


 

We have attached a sample for your reference. Please review the sample for more information.

 

Regards,

Arul Jenith B.



Attachment: StepProgressBarSample_9186feb9.zip

Loader.
Up arrow icon