I have a XamTabControl with two tabs.
The first tab has a XamDataGrid with a collection of objects. The 2nd tab has a UserControl. When I select the row I want to view I set the datacontext of the usercontrol to a viewmodel then set SelectedIndex on the tab control to switch the view.
I expect the 2nd tab to come into view but nothing happens.
Is there something else I need to do to make this work?
Hello James,
In order to proceed, it would be helpful if you provide a small sample project of your own if you have one. If you don’t - feel free to modify the one I’ve attached previously and send it back.
Please let me know if I can provide any further assistance.
Hi Svetla,
I was not able to resolve this issue. I stated that in my last response.
I am using a viewmodel to set the SelectedIndex value for switching the tab and the tab never gets selected.
Did you manage to resolve the issue?
Let me know if you have any questions.
I tried the example and it works fine - I am using 16.2.
However I am using MVVM with SelectedIndex on the XamTabControl bound to a property in a view model.
Changing SelectedIndex does not change the tab.
My XAML is a bit different but I will try using XAML similar to what you sent to see if it helps.
Thanks
I followed the steps you suggested and was unable to reproduce the behavior you're describing. I’ve created a sample with XamTabControl with two tab items and xamDataGrid in the first one. On selecting a row, the selected index is changed to the second tab.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 17.1.20171.2073.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.