This question is locked. New answers and comments are not allowed.
How can I directly get the TabItem's Index in a TabStrip? There is no Index property.
Currently I use this function:
Thanks for your help,
Christian
Currently I use this function:
private int GetTabIndex(RadElement Item) {...but that can't be the solution. ;-)
int i = 0;
foreach(RadElement E in fTab.Items) {
if (E == Item) return i;
i++;
}
return -1;
}
Thanks for your help,
Christian
6 Answers, 1 is accepted
0
Hi Christian,
Indeed we currently do not have an Index property of RadTabStrip, but you could use the following code block to retrieve the index of TabItem in the RadTabStrip:
If you need any further assistance please write us back.
Kind regards,
Ray
the telerik team
Instantly find answers to your questions at the new Telerik Support Center
Indeed we currently do not have an Index property of RadTabStrip, but you could use the following code block to retrieve the index of TabItem in the RadTabStrip:
private int GetIndex(TabItem item) |
{ |
return this.radTabStrip.TabStripElement.Items.IndexOf(item); |
} |
If you need any further assistance please write us back.
Kind regards,
Ray
the telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Marturo77
Top achievements
Rank 1
answered on 23 May 2007, 08:14 PM
Hi, i use this instruccion and receive this message by the compiler
cannot convert from 'Telerik.WinControls.RadElement' to 'Telerik.WinControls.RadItem'
can you help me
thanks!
cannot convert from 'Telerik.WinControls.RadElement' to 'Telerik.WinControls.RadItem'
can you help me
thanks!
0
Hello Marturo77,
Could you please open a support ticket and send us a sample project which reproduces the faulty behavior? The code I have pasted has been checked and verified that it works. I think that we are missing something else here.
I'm looking forward for your project.
Regards,
Rob
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Could you please open a support ticket and send us a sample project which reproduces the faulty behavior? The code I have pasted has been checked and verified that it works. I think that we are missing something else here.
I'm looking forward for your project.
Regards,
Rob
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
carisch
Top achievements
Rank 1
answered on 08 Aug 2007, 05:07 PM
first reply failed....grrrrr.
I have 5 tabs, if I hide tab 4, the space where 4 was stays. I wanted to set the index, but don't think I can without removing ALL from the collection and adding back.
What is the solution for this?
I can't think of why you'd want to hide a tab, but leave a big empty space in the strip where it was.
Please help,
Thanks,
I have 5 tabs, if I hide tab 4, the space where 4 was stays. I wanted to set the index, but don't think I can without removing ALL from the collection and adding back.
What is the solution for this?
I can't think of why you'd want to hide a tab, but leave a big empty space in the strip where it was.
Please help,
Thanks,
0
carisch
Top achievements
Rank 1
answered on 08 Aug 2007, 05:40 PM
Okay, maybe this isn't so bad.
private void OrderTabs() |
{ |
RadItemCollection show = new RadItemCollection(); |
RadItemCollection hide = new RadItemCollection(); |
foreach (RadItem tab in radTab.Items) |
{ |
if (tab.Visibility == ElementVisibility.Visible) |
show.Add(tab); |
else |
hide.Add(tab); |
} |
radTab.Items.Clear(); |
radTab.Items.AddRange(show); |
radTab.Items.AddRange(hide); |
} |
0
Hello Brian,
You could hide the tab by setting its Visibility property but that tab will still be in the Items collection. You will see a space between the tabs because you've most probably set that property to hidden, but not to collapsed.
The Hidden state means that the item is not shown but its bounds are still calculated in the layout logic. The Collapsed state is similar to an advanced hidden state, i.e the item is not shown and its bounds are not taken into account.
If you need further assistance please feel free to write us.
All the best,
Ray
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You could hide the tab by setting its Visibility property but that tab will still be in the Items collection. You will see a space between the tabs because you've most probably set that property to hidden, but not to collapsed.
The Hidden state means that the item is not shown but its bounds are still calculated in the layout logic. The Collapsed state is similar to an advanced hidden state, i.e the item is not shown and its bounds are not taken into account.
If you need further assistance please feel free to write us.
All the best,
Ray
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center