prevent tab switching

5 posts, 0 answers
  1. Adam
    Adam  avatar
    30 posts
    Member since:
    Jun 2009

    Posted 30 Oct 2009 Link to this post

    How would I go about preventing the tab control from switching. Say I need to validate something inside some control inside the tab and if the validation fails the tab should not be allowed to switch?
  2. Simon yang
    Simon yang avatar
    15 posts
    Member since:
    Sep 2009

    Posted 31 Oct 2009 Link to this post

    Try this:
    private void tab_SelectionChanged(object sender,RoutedEventArgs e)
    {
           if (bisRefreshing)
              ((Telerik.Windows.Controls.RadSelectionChangedEventArgs)(e)).Handled = true;
    }
  3. DevCraft banner
  4. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 01 Nov 2009 Link to this post

    Hi Adam,

    With Q3.09 we are adding the PreviewSelectionChanged event for the RadTabControl. By using this event you will be able to prevent the user from selecting a particular node. The release will be live this week.

    Kind regards,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Larry
    Larry avatar
    22 posts
    Member since:
    Jun 2009

    Posted 04 Dec 2009 Link to this post

    I am having to use the code below - which I don't think I should need:

            private void TabControl_PreviewSelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)  
            {  
                RadTabItem navTo = e.AddedItems[0] as RadTabItem;  
                if (navTo.Visibility == Visibility.Collapsed)  
                {  
                    e.Handled = true;  
                }  
            }  
     

    When my app starts only one tab is visible.  Making choices on the main tab makes other tabs visible.  However, if the user clicks in a textbox and hits the right arrow twice they are taken to the second tab, even though it is supposed to be 'invisible'.

    Thanks,

    -ldl-

     

  6. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 07 Dec 2009 Link to this post

    Hi Larry,

    Unfortunately I was not able to reproduce the issue. I have attached my sample project. Could you please take a look at it let me know the steps to reproduce the problem.


    Best wishes,
    Kiril Stanoev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
DevCraft banner