Removing Tabs programmatically.

0 Answers 52 Views
TabControl
Noah
Top achievements
Rank 1
Noah asked on 11 Jun 2024, 04:19 PM

Hello,

I'm trying to remove tab items from RadTabControl where ItemsSource is bound to an ObservableCollection<RadTabItem>. However, when an item is deleted from the collection the tab does not disappear. The desired behavior is for the tab to disappear. What do I need to do to achieve this?

Here's what I have:

xaml declaration:


 <telerik:RadTabControl x:Name="radTabControl"  
                     
                                ItemsSource="{ Binding Tabs }"
                                Padding="0, 0, 0, 0" 
                                Margin="0, 0, 0, 0" >

         </telerik:RadTabControl>

 

Here, I declare Tabs as an observable collection:

   public ObservableCollection<RadTabItem> Tabs { get; set; }

Here is where the tab items are deleted:


  private void RemoveTab(int dev)
        {
                Tabs.Clear();
 
        }

 

I'm not very familiar with WPF and Telerik in general. Any help would be appreciated.

Thanks.

Dimitar
Telerik team
commented on 12 Jun 2024, 08:57 AM

Hi Noah, 

I have tested this and it works on my side. We do not have other reports of similar issues as well. Would it be possible to create a sample project that reproduces this and send it to me? This way I can properly investigate. 

Thank you in advance for your patience and cooperation. 

No answers yet. Maybe you can help?

Tags
TabControl
Asked by
Noah
Top achievements
Rank 1
Share this question
or