Selection based on tab value

2 posts, 0 answers
  1. Developer
    Developer avatar
    50 posts
    Member since:
    Apr 2014

    Posted 24 Feb 2016 Link to this post

    I have a radtabstrip that contains 3 rad tabs.  I have some code that assigns a value to each of these tabs.
    I need a way which the value of each tab can be reviewed and then set the selected value to which ever one has the highest value.

    Any suggestions appreciated.
  2. Eyup
    Eyup avatar
    3644 posts

    Posted 25 Feb 2016 Link to this post


    You can traverse the tabs and compare their values:
    double maxValue = 0;
    int index = 0;
    foreach (RadTab tab in RadTabStrip1.Tabs)
        double tabValue = 0;
        if (double.TryParse(tab.Value, out tabValue))
            if (tabValue > maxValue)
                maxValue = tabValue;
                index = tab.Index;
    RadTabStrip1.Tabs[index].Selected = true;
    RadTabStrip1.Tabs[index].PageView.Selected = true;

    I hope this will prove helpful.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top