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

Design view poup inside xaml

4 Answers 44 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Fredrik
Top achievements
Rank 1
Veteran
Iron
Fredrik asked on 13 May 2020, 08:28 AM

I am not sure this is the place, but it's driving me crazy.

In my xaml code, when I click the code for RadComboBox, I get a popup (see attached image).

If I click the popup I am sent to the design view (see attached). When I click the xaml tab I am redirected back to the design view after seeing the xaml code for a split second.

Does anyone know waht it might be that is causing this behavior?

 

Thanks in advance!

4 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 18 May 2020, 07:23 AM

Hello Fredrik,

Thank you for the shared pictures. 

I tried to reproduce the demonstrated behavior in a sample project on my end, however I was not able to. That is why I am attaching the project that I used for testing. Can you check it out and let me know, if you can replicate the same behavior in it?

If that is indeed the case, can you share a sample video so that I can get a better understanding of the scenario? If the result from the pictures is not reproducible, can you modify the project in order to get the same behavior and send back the project in a new support ticket (since project files cannot be attached to forum posts)? This will hopefully allow me to investigate further and better assist you. 

On a side note, for the time being, you can consider Disabling XAML UI designer.

I am looking forward to your reply.

Regards,
Vladimir Stoyanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Fredrik
Top achievements
Rank 1
Veteran
Iron
answered on 18 May 2020, 12:25 PM

I found the reason.

After loading the viewmodel in Main.xaml

<Window x:Class="DropDownWithHeaders.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:DropDownWithHeaders"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <local:Example DataContext="{Binding ViewModel}" />
    </Grid>
</Window>

namespace DropDownWithHeaders
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public ViewModel ViewModel { get; set; }
        public MainWindow()
        {
            InitializeComponent();
            ViewModel = new ViewModel();
        }
    }
}

 

And the adding d:DataContext="{d:DesignInstance Type=viewmodels:ViewModel}" to Example.Xaml the behaviour occurs. I do not need the d:DataContext so I have removed it. How ever. None of the other control I use behaves this way. In this project I use RadGridView, RadRichText, RadFilterView, and RadComboBox (so far).

<UserControl x:Class="DropDownWithHeaders.Example"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:local="clr-namespace:DropDownWithHeaders"
             xmlns:viewmodels="clr-namespace:DropDownWithHeaders"
             mc:Ignorable="d"
             d:DataContext="{d:DesignInstance Type=viewmodels:ViewModel}"
             d:DesignHeight="300" d:DesignWidth="300">


0
Vladimir Stoyanov
Telerik team
answered on 21 May 2020, 09:04 AM

Hello Fredrik,

Thank you for the update.

Please, allow me to start by saying that the opening of the dropdown is a design-time feature of the RadComboBox. That said, I tried to replicate the behavior described in your first reply of the views being switched, however I was not able to. I am attaching back the modified version of the sample project along with a video showing my tests(you can drag&drop the video in Internet Explorer in order to watch it).

On a side note, I do hope that you will find the approach of removing the DataContext setter suitable for your scenario. 

Regards,
Vladimir Stoyanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Fredrik
Top achievements
Rank 1
Veteran
Iron
answered on 21 May 2020, 09:13 AM

Thank you!

 

Yes, it works for me with removing the DataContext setter.

Tags
ComboBox
Asked by
Fredrik
Top achievements
Rank 1
Veteran
Iron
Answers by
Vladimir Stoyanov
Telerik team
Fredrik
Top achievements
Rank 1
Veteran
Iron
Share this question
or