I am relatively new to SilverLight Applications and I'd like to create a tab control in which the RadTabItem can be moved.
So when the TabItem is clicked then dragged, it can be placed in the TabControl once the mouse is released.
Thanks
Héla
5 Answers, 1 is accepted
As far as i understand your question you want to do something similar to one of our online demos. Please check this demo at http://demos.telerik.com/silverlight/#TabControl/DragReorder and tell us if this works for you.
All the best,
Boyan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thx for your answer.It's what I needed to know.
My reply is a little bit late coz i've already found the answer in an other example.
Thx again and good luck for you!
Héla
<tnav:RadTabControl x:Name="MyTab" AllowDragReorder="True" ItemsSource="{Binding list, Converter={StaticResource tc}}"/>
public class TabConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
List<PortfolioTab> source = value as List<PortfolioTab>;
DataTemplate dt = App.Current.Resources["tabHeader"] as DataTemplate;
if (source != null)
{
List<RadTabItem> result = new List<RadTabItem>();
host = someUserControl;
foreach (PortfolioTab tab in source)
{
result.Add(
new RadTabItem()
{
Tag = tab.TabID,
Header = tab.TabTitle,
Content = host
});
}
return result;
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
You have to return an ObservableCollection<RadTabItem> instead of a List<RadTabItem>. While reordering the tabs the ItemsSource changes and the ObservableCollection will notice the changes.
I have attached a sample project that demonstrates the usage of ObservableCollection. Have a look at it and try the approach in your application.
Let me know if you experience any additional problems.
All the best,
Kiril Stanoev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thanks much for your time.