SelectedIndex is reseted

Hello, i use this control in contentPresenter


<syncfusion:SfStepProgressBar

                Grid.Column="1"

                VerticalAlignment="Center"

                AnimationDuration="0"

                ItemsSource="{Binding AllStatusesText}"

                ItemsStretch="Fill"

                Orientation="Horizontal"

                SelectedIndex="1">

                <syncfusion:SfStepProgressBar.ItemContainerStyle>

                    <Style TargetType="syncfusion:StepViewItem">

                        <Setter Property="Content" Value="{Binding ValString}" />

                        <Setter Property="TextSpacing" Value="8" />

                        <Setter Property="SecondaryContentTemplate">

                            <Setter.Value>

                                <DataTemplate />

                            </Setter.Value>

                        </Setter>

                    </Style>

                </syncfusion:SfStepProgressBar.ItemContainerStyle>


            </syncfusion:SfStepProgressBar>


First time selected item worked corectly, with animation o no. But when i switching node it stops display selected node, but steps rendered correctly.

If i bind  SelectedIndex to Prop it is ride exception DoubleAnimation error


9 Replies 1 reply marked as answer

GR Gayathri Ramalingam Syncfusion Team October 5, 2021 09:40 AM UTC

Hi Anton,  
 
Thank you for using Syncfusion products. 
 
We tried to reproduce the issue “SelectedIndex is not reseted properly in Step ProgressBar, but it is working fine as expected. 
  
We have created a simple sample based on the provided information and the sample can be downloaded from the below link.  
 
Kindly provide the following details to investigate further on this issue.   
1.      Modify / Simple sample with which the issue could be reproduced. 
2.      Replication procedure to reproduce the issue or screen shot illustrating the issue. 
 
The above details will be more helpful for us to reproduce the issue in our side and assist you with the better solution at the earliest.   
 
 
With Regards, 
Gayathri R 
 
 




AN Anton October 5, 2021 11:59 AM UTC

Hello!


Modified sample


Attachment: DataBindingToObjects_1e5c1158.zip


GR Gayathri Ramalingam Syncfusion Team October 6, 2021 02:23 PM UTC

Hi Anton 
 
Thank you for your update.  
 
We were able to reproduce the issue “System.InvalidOperationException: 'No target was specified for 'System.Windows.Media.Animation.DoubleAnimation’." in our side and we suspect this to be a defect. We have forwarded this issue to our development team for further analysis and we will update further details by 08th October 2021. 
 
With Regards, 
Gayathri R 
 
 



GR Gayathri Ramalingam Syncfusion Team October 8, 2021 08:43 AM UTC

Hi Anton, 
 
Thank you for your patience. 
 
On further analyzation, we found that binding is not sets properly for ‘ItemSource’ and ‘SelectedIndex’ property of Step ProgressBar control. You have tried to set those property from ListView, but the mentioned path name is not sets properly. Please use the below code example to get this issue resolved.   
<syncfusion:SfStepProgressBar 
                    x:Name="stepprogressbar" 
                    Grid.Row="1" 
                    Grid.Column="1" 
                    VerticalAlignment="Center" 
                    AnimationDuration="0" 
                    ItemsSource="{Binding ElementName=_listView, Path=ItemsSource}" 
                    ItemsStretch="Fill" 
                    Orientation="Horizontal" 
                    SelectedIndex="{Binding ElementName=_listView, Path=SelectedIndex}"> 
 
We have modified the provided sample and it can be downloaded from below link, 
 
We created a video for illustrating the same and it can be downloaded from the below links, 
 
Could you please try the above suggested solution and let us know whether it meets your requirement or not?   
 
With Regards, 
Gayathri R 
 
 



AN Anton October 18, 2021 06:39 AM UTC

Hello!

Provided sample is about another thing! 


DataContext change not occur. My sample is about binding to collection of objects!


 ItemsSource="{Binding ElementName=_listView, Path=SelectedItem.StepViewItems}"


It is very different from provided workaround:

ItemsSource="{Binding ElementName=_listView, Path=ItemsSource}" 


A  want to display progress for each object on selection, NOT share single progress



GR Gayathri Ramalingam Syncfusion Team October 19, 2021 10:18 AM UTC

Hi Anton 
  
On further analyzation, we found that you want to bind the property from View model class. Please use the below code example to get this issue resolved.    
<syncfusion:SfStepProgressBar 
                    x:Name="stepprogressbar" 
                    Grid.Row="1" 
                    Grid.Column="1" 
                    VerticalAlignment="Center" 
                    AnimationDuration="0" 
                   ItemsSource="{Binding StepViewItems}" 
                    ItemsStretch="Fill" 
                    Orientation="Horizontal" 
                    SelectedIndex="{Binding SelectedItemIndex}"> 
 
 
Please find the sample link from below, 
 
If you want to bind the values from some other control, you should set the ‘Path’ name to property name which is in the same control. Please use the below code example to get this issue resolved.    
<syncfusion:SfStepProgressBar  
                    x:Name="stepprogressbar"  
                    Grid.Row="1"  
                    Grid.Column="1"  
                    VerticalAlignment="Center"  
                    AnimationDuration="0"  
                    ItemsSource="{Binding ElementName=_listView, Path=ItemsSource}"  
                    ItemsStretch="Fill"  
                    Orientation="Horizontal"  
                    SelectedIndex="{Binding ElementName=_listView, Path=SelectedIndex}">  
  
Please find the sample link from below, 
 
Note: If we want to bind the property using ‘ElementName’, the ‘Path’ name should be present in the control which mentioned in the ‘ElementName’. In the given code snippet, you have sets the element name as ‘ListView’ control but you have set the path name property from view model class. So that binding is not working. Kindly set the path name to property which present in the ListView control. 
 
With Regards,  
Gayathri R  
 




AN Anton October 19, 2021 12:21 PM UTC

Hello, your sample is about another things.

You soolve another problem. Look at the sample. It works, but selected index han no effect, because control does not handle DataConext changes correctly


Attachment: DataBindingToObjects_6e0319c4.zip


GR Gayathri Ramalingam Syncfusion Team October 20, 2021 02:11 PM UTC

Hi Anton 
 
Thank you for your update. 
 
We were able to reproduce the issue “SelectedIndex is not applied while binding the values from ListView control" in our side and we suspect this to be a defect. We have forwarded this issue to our development team for further analysis and we will update further details by 22nd October 2021. 
 
With Regards, 
Gayathri R 




GR Gayathri Ramalingam Syncfusion Team October 22, 2021 01:40 PM UTC

Hi Anton, 
Thank you for your patience. 
We have confirmed that the issue “SelectedIndex is not applied while dynamically changing ItemSource property.” is defect and logged defect report for this issue. The patch for this issue will be delivered on 12th November 2021.   
 
 
With Regards, 
Gayathri R 
 


Marked as answer
Loader.
Up arrow icon