I was wondering if someone knows how to do what is asked in the title. I have tried setting selectedIndex to the tab I really want them to stay on and that tabs contents aredisplayed, the problem is that the actual tab shown as selected is the one I clicked, NOT the one whose details are actually being shown! It appears that the default behavior is to highlight what was clicked, not what is selected.

what exactly i'm trying to do is:
I've two tabs- the first one contains a datagrid with users details...so when I double click on a record, it takes me to the second tab which contains a form to change the details of the selected user. Now, the problem is if I navigate away from the second tab back to the first tab without saving the details, i want the application to show me an alert warning me to save the data...and keeps me in the same tab...

Thanks in advance for any help / insight.