Selection based on tab value

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

    Posted 24 Feb Link to this post

    Hi,
    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
    Admin
    Eyup avatar
    3015 posts

    Posted 25 Feb Link to this post

    Hello,

    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.

    Regards,
    Eyup
    Telerik
    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. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top