This is a migrated thread and some comments may be shown as answers.

Selection based on tab value

1 Answer 129 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Developer
Top achievements
Rank 1
Developer asked on 24 Feb 2016, 11:07 AM
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.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 25 Feb 2016, 02:24 PM
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
Tags
TabStrip
Asked by
Developer
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or