Selection based on tab value

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

    Posted 24 Feb 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
    2942 posts

    Posted 25 Feb 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
  3. DevCraft R3 2016 release webinar banner
Back to Top