We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How binding a ViewModel property to SelectedItem

Hello,

I'm trying to binding the TabControlExt.SelectedItem to my property in my viewmodel but if I add a new tab or select an existing tab the SelectedItem isn't update.

My Xaml is this:

    <sync:TabControlExt ItemsSource="{Binding Path=Items}" 
                        CloseButtonType="Hide" 
                        ItemTemplate="{StaticResource CustomHeaderTemplate}"  
                        SelectedItem="{Binding Path=ItemSelected, Mode=TwoWay}"/>

How can I do?

3 Replies

VJ Victory Jessie Selvam D Syncfusion Team December 5, 2016 09:36 AM UTC

Hi CSharpino,

Thank you for using Syncfusion products.

We have checked bounding the SelectedItem property of TabControlExt in ViewModel class property and it is working as expected from our side. We have prepared a sample and video to demostrate the same and you can download them from the following link:

Sample: TabControl_SelectedItem_Binding

Video: Video

Please get back to us the modified sample reproducing the issue along with replication steps and Essential Studio version so that we can proceed further on this.

Regards,
Jessie


CS CSharpino December 20, 2016 11:43 AM UTC

Sorry for the delay in replying, 

I modified your example to reproduce the error.

The problem occurs if the collection is not populated in the constructor but then with the ADD button.



Attachment: TabControl_SelectedItem_Binding_8a046be5.zip


VJ Victory Jessie Selvam D Syncfusion Team December 21, 2016 11:26 AM UTC

Hi CSharpino,

We were able to reproduce the reported issue, "SelectedItem property binding is not working when items are populated at run time" and have logged a defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

Please let us know if you have any questions.

Regards,
Jessie

Loader.
Up arrow icon