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

Beginner question - How to visually edit tabs?

10 Answers 375 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Todd
Top achievements
Rank 1
Todd asked on 29 Oct 2019, 05:46 PM

Ok, stupid beginner question here, but how do I visually edit what goes into each tab for WPF UI Desktop using Visual Studio 2019?

When I drag the Tab Control into the design window, it places it just fine.  But, if I try to add anything, the items do not show up per tab.  Is there some trick to be able to edit a multi-tab XAML document visually?

10 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 31 Oct 2019, 03:01 PM

Hello Todd,

If I understand this correctly, you want to drag/drop a control in the Visual Studio's designer (from the toolbox) and this operation should add the control into RadTabItem's content. Please correct me if I am wrong.

If this is your case, you can select the corresponding RadTabItem in the designer by clicking on it. Then drag/drop a control inside the area where the content should be.

Note that the design-time selection and adding into the content will work only if the "design" folder is presented in the directory from where the Telerik dlls are referenced. The folder contains dlls implementing additional design-time logic and are automatically used by Visual Studio (without the need of referencing them manually). 

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Todd
Top achievements
Rank 1
answered on 04 Nov 2019, 06:54 PM

Create a new WPF UI Project for C#.

Add a RAD Tab Control.  It appears properly in the design view.

Select a RAD Tab Item in the Design View.

Drag a RAD Button to the Design View.  It adds a new TAB and does not put the button in the Design View.

Native Visual Studio Tab Controls and buttons do not do this but work properly.

0
Todd
Top achievements
Rank 1
answered on 04 Nov 2019, 06:59 PM
Is there a Discord for Telerik?  This support forum seems like a very slow way to do these things.
0
Todd
Top achievements
Rank 1
answered on 04 Nov 2019, 07:08 PM

By the way, you can see the problem in the XAML window.  Telerik is not putting the RADButton in the hierarchy of the tab.  It is trying to add the button as another tab item.  Does not seem to matter what I click.

See below for the code that is created.  When I try VS Native controls, they work as expected.

<Grid>
        <telerik:RadTabControl HorizontalAlignment="Stretch" Margin="128,49,226,168" VerticalAlignment="Stretch">
            <telerik:RadTabItem x:Name="RadTabItem10" Header="Tab item 1"/>
            <telerik:RadTabItem x:Name="RadTabItem11" Header="Tab item 2"/>
            <telerik:RadTabItem x:Name="RadTabItem12" Header="Tab item 3"/>
            <telerik:RadButton Content="Button" Height="Auto" Width="Auto"/>
        </telerik:RadTabControl>
    </Grid>

 

0
Martin Ivanov
Telerik team
answered on 06 Nov 2019, 04:08 PM

Hello Todd,

Thank you for the additional information. I was able to reproduce this on my side. I will investigate this and let you know about my findings tomorrow.

About the Discord, no, Telerik doesn't have a channel there. Also, note that this is a community based forum, which means that it is not necessary to receive an answer from the Telerik team. If you need a guaranteed answer and a shorter timespan between the replies, I would suggest you to use the support system in your telerik.com account, and open a ticket from there.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Martin Ivanov
Telerik team
answered on 08 Nov 2019, 12:57 PM

Hello Todd,

It turned out that the issue on my side was caused by some dlls mixing. Here are some steps that you can try in order to setup the environment you are looking for.

  1. Create a new WPF application. No need to use the Telerik Visual Studio Extensions. This can be a clean WPF project.
  2. Make sure that the Visual Studio ToolBox uses the Telerik version that you want to use in your project. You can ensure this by opening the ToolBox Configuration Wizard and clicking on the Finish button. This will restart Visual Studio.
  3. When the project starts again, open the Visual Studio ToolBox and find RadTabControl. Then drag drop it into the view. This will add the control with few tabs in XAML.
  4. Select one of the RadTabItems by clicking on it in the designer or in XAML. This will add a border around it.
  5. Find an element (for example RadButton) in the toolbox and drag it over the selected tab item. This will show a border indicating that you can drop inside the tab item.
  6. Drop the element insider the tab item.

You can see those steps shown in the attached picture.

Can you please try this and let me know if it helps?

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Todd
Top achievements
Rank 1
answered on 08 Nov 2019, 09:39 PM

It still is not putting it in the right place.  It keeps adding the button to the end.

<telerik:RadTabControl HorizontalAlignment="Stretch" Margin="27,34,80,75" VerticalAlignment="Stretch">
            <telerik:RadTabItem x:Name="RadTabItem1" Header="Tab item 1"/>
            <telerik:RadTabItem x:Name="RadTabItem2" Header="Tab item 2"/>
            <telerik:RadTabItem x:Name="RadTabItem3" Header="Tab item 3"/>
            <telerik:RadButton Content="Button" Height="Auto" Width="Auto"/>
        </telerik:RadTabControl>

I can manually edit the XAML to make it work; but that defeats the whole purpose.

0
Todd
Top achievements
Rank 1
answered on 08 Nov 2019, 09:57 PM
Ok, think I got it to work if I drag and drop the item right on top of the tab itself, and not the tab window.  Is there any way for it to actually appear in the tabbed window properly?
0
Todd
Top achievements
Rank 1
answered on 08 Nov 2019, 10:28 PM
Well, scratch that... When I add any other controls it replaces what is there.  So, its still not working.
0
Martin Ivanov
Telerik team
answered on 13 Nov 2019, 04:52 PM

Hello Todd,

Thank you for the additional information. You are on the right track. In order to add items in the RadTabControl's content area, you will need to click onto a RadTabItem in order to select it. However, if you drag/drop over the RadTabItem, its Content gets replaced. To achieve your requirement you will need to drop over the content area when a tab is selected. But, I am afraid that currently, this doesn't work, because of a changed introduced in the design-time related logic of RadTabControl.

I have logged a bug report in our feedback portal where you can track this issue's status. Also, updated your Telerik points.

To work this around, add an empty Grid with a transparent Background to the RadTabItem instances in XAML. This will allow you to drag/drop inside the content area when you select a tab. Check the attached video to see how to do this.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TabControl
Asked by
Todd
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Todd
Top achievements
Rank 1
Share this question
or