
The two windows showed error!
The first window with a gray WinForm DataGridView in a WindowsFormsHost,
and the second window whit a red one.
AS the picture showing, the red window cannot display normally.
Is there any way to solve this problem?
Wish your help.
Thank you !
My xaml code:
<Page x:Class="WpfBrowserApplication9.Page1" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
Title="Page1" xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" |
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" |
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"> |
<Grid> |
<my:RadWindow Name="radWindow1" VerticalAlignment="Top" > |
<wfi:WindowsFormsHost Height="200" Width="300"> |
<wf:DataGridView x:Name="xy"></wf:DataGridView> |
</wfi:WindowsFormsHost> |
</my:RadWindow> |
<my:RadWindow Name="radWindow2"> |
<wfi:WindowsFormsHost Height="200" Width="300"> |
<wf:DataGridView x:Name="xzy" BackgroundColor="Red"></wf:DataGridView> |
</wfi:WindowsFormsHost> |
</my:RadWindow> |
<telerik:RadButton Height="23" HorizontalAlignment="Right" Margin="0,0,48,2" Name="radButton1" VerticalAlignment="Bottom" Width="75" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Click="radButton1_Click">Button</telerik:RadButton> |
</Grid> |
</Page> |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Text; |
using System.Windows; |
using System.Windows.Controls; |
using System.Windows.Data; |
using System.Windows.Documents; |
using System.Windows.Input; |
using System.Windows.Media; |
using System.Windows.Media.Imaging; |
using System.Windows.Navigation; |
using System.Windows.Shapes; |
namespace WpfBrowserApplication9 |
{ |
/// <summary> |
/// Page1.xaml |
/// </summary> |
public partial class Page1 : Page |
{ |
public Page1() |
{ |
InitializeComponent(); |
radWindow1.Show(); |
} |
private void radButton1_Click(object sender, RoutedEventArgs e) |
{ |
radWindow2.Show(); |
} |
} |
} |
22 Answers, 1 is accepted
Unfortunately the WindowsFormsHost always appears above the WPF application and we don't know for a work-around for this problem.
Regards,Miroslav Nedyalkov
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.

That is realy bad news for me, because I will use some Winform Controls in my application.
As the RadDocumentPane control show this problem too, is there any other controls for this Solution?
Thank you!

The WindowsFormsHost always appears above the WPF application, so I have to change my solution now.
Thank you!

I have a similar problem, but my WindowsFormsHost is not displayed above, but not displayed at all, though the GUI is reacting to it.
I wanted to display a TX Textcontrol Editor element within a WpfWindow. With a standard WPF Window it worked fine (As shown in the attached file screenshot_wpfwindow.jpg).
My Code:
<Window x:Class="RSSoftware.WpfTextControlTest.WpfTextControlStandardWindow" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:tx="clr-namespace:RSSoftware.WpfTextControlTest" |
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" |
Title="TextControlWpfWindow" Height="800" Width="800"> |
<Grid x:Name="grid1"> |
<Grid.RowDefinitions> |
<RowDefinition Height="Auto"/> |
<RowDefinition/> |
</Grid.RowDefinitions> |
<Button Content="Fett" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Click="BoldButton_Click"/> |
<Grid x:Name="TextControlGrid" Grid.Row="1"> |
<wfi:WindowsFormsHost HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
<tx:TxUserControl x:Name="TX"/> |
</wfi:WindowsFormsHost> |
</Grid> |
</Grid> |
</Window> |
Now I wanted to display it in a RadWindow.
My Code:
<telerik:RadWindow x:Class="RSSoftware.WpfTextControlTest.WpfTextControlRadWindow" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" |
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" |
xmlns:tx="clr-namespace:RSSoftware.WpfTextControlTest" |
Header="TextControlRadWindow" Width="800" Height="600" WindowStartupLocation="CenterScreen"> |
<Grid> |
<Grid.RowDefinitions> |
<RowDefinition Height="Auto"/> |
<RowDefinition /> |
</Grid.RowDefinitions> |
<Button Content="Fett" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Click="BoldButton_Click"/> |
<Grid x:Name="TextControlGrid" Grid.Row="1"> |
<wfi:WindowsFormsHost HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
<tx:TxUserControl x:Name="TX"/> |
</wfi:WindowsFormsHost> |
</Grid> |
</Grid> |
</telerik:RadWindow> |
However, strange effects occured. As shown in the attached file screenshot_radwindow.jpg, the WindowsForms-element is not displayed. Remarkably, the element is still "there". If I move the Mouse over the area, the arrow switches to an input-sign and if i mark the area blind with the mouse, I can write text and copy it (With CTRL+C and CTRL+V) to an editor. The element is there, it is just not visible. I have tried to change the Visibility-Property and the Front- and Background-Colors of both the WindowsFormsHost and the UserControl, without a change.
I have also tried to replace the TxUserControl with a simple Windows Forms Label (wf:Label Text="Hello"), the same effect occurs, so it is not based on TextControl.
I want to use the RadWindow for getting a modern look with theming for the whole application and I hope someone here is able to help me.
Thanks in advance!
Unfortunately this is a limitation of the WPF WindowsFormsHost - when you put either the WebBrowser control or the WindowsFormsHost control into a window with AllowTransperancy property set to true, both controls are not visible. What I could suggest you is to use standard WPF window instead of using the RadWindow control for hosting the WindowsFormsHost control.
Sincerely yours,Miroslav Nedyalkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

Unfortunatly, I have to include a word processing component into my WPF-Application and use the modern Look & Feel of the themed telerik controls. When the WindowsHost is not usable, I am not able to use TextControl at the moment.
Do you know any other Editor for WPF I may use with the Telerik Components?
The RichTextBox included in WPF works with FlowDocuments but I have to edit FixedDocuments which should be prepared for printing. The editor must be able to handle tables, formats and templates.
Or is there a way to use a standard window and the borders and themes of the telerik elements?
Thanks in advance
If you use the WPF Window you will still be able to use the WindowsFormsHost control. The problem is when you need a window that allows transparency (that allows you to change its look and feel, like the RadWindow for example). If this is not important you could still use the RadControls for WPF and just not use the RadWindow control.
Hope this helps!
Kind regards,Miroslav Nedyalkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

I have the same problem, the WindowsFormsHost does not appear at all inside RadWindow
i can't use the normal window, i have to use the RadWindow
Please let me know if there is a solution for this problem?
Thanks,
Akram
There is a feature of the RadWindow control that allows you to make the WPF window non-transparent. To do this you need to set the attached property WindowInteropHelper.AllowTransparency to false to the RadWindow control.
Hope this helps.
Kind regards,
Miroslav Nedyalkov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.


This property should be available with the official release as well. What version of RadControls for WPF do you use? Could you please verify if you added a reference to Telerik.Windows.Controls.Navigation, please?
Regards,
Miroslav Nedyalkov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Thank you.

The WPF controls depend completely in the transparent feature, so if you disable this feature then you will loss most of the WPF's styles.
I know this is a bad news but Teleric must find an appropriate solution for this case.
Thanks,
Akram
Our themes are not designed for non-transparent host, so the will not look very nice if placed in such - you will need to do some more work for that. You also will need to disable the animations of the RadWindow control by setting the AnimationManager.AnimationSelector attached property to null.
We are aware of these shortcomings, but there is no way to resolve them, as we cannot animate the Win32 window with WPF animations and we cannot render partially transparent visuals when our host is not transparent.
Please let us know if something else is not working correctly in your case.
Regards,
Miroslav Nedyalkov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

can any one help me /?

hi Akram
how you did this
WindowInteropHelper.AllowTransparency to false to the RadWindow control. ???


can u give me the email ID ?

Thanks,
Akram

