14 Answers, 1 is accepted
Thank you for sharing your code!
The RadWindow control has a BringToFront method, that does exactly the same thing and handles some more scenarios as well. Did you try using it instead adding custom methods for this?
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.
You are right - if you need to bring the window to the front of all windows on the computer you need to find the real window and activate it. Thank you for sharing your solution.
Best wishes,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.
The second time window appears behind Parent window. How to solve this problem?
Could you please open a support ticket and send us a sample project that reproduces the problem? This would be very helpful.
Regards,Miroslav Nedyalkov
the Telerik team
During developing my XBAP application I discovered 2 bugs in RadWindow.
1. When I set Owner property to parent RadWindow, and I open RadWindow as Modal, the modal Canvas is bad displayed (it don't cover all application pane, but it starts at left upper corner of parent window content).
2. Most important bug.
When I open few RadWindows (as modal) in browser eg. 1, 2, 3. Next I close windows 3, 2 , next I open again windows 2, 3 and when I close window 3, window 1 is focused and brought to front, but this should happen with window 2 not 1.
The same happens when:
open 1,2,3,4,5,6
close 6,5,4
open 4,5,6
close 6
Window 3 is focused, but should 5.
I resolved this bug by making CustomRadWindow, and override OnOpened method (I added OwnerWindow property, because I don't use Owner property - see description for bug 1)
protected override void OnOpened(RoutedEventArgs args) {
base.OnOpened(args);
if (this.OwnerWindow !=null ) {
Canvas cThis = ((Canvas)this.Parent);
Canvas cOwner = ((Canvas)this.OwnerWindow.Parent);
Canvas.SetZIndex(cThis,Canvas.GetZIndex(cOwner) + 1);
}
}
I think that bug 2 is connected with Z proprty. I saw in debugger that this internal property always have value 0. After I implemented by code, the value of Z started changing.
I logged this issue in PITS and we will fix fix it in one of the future releases. The ID is 2765. You could use this ID to track the progress of the issue in PITS.
Kind regards,Miroslav Nedyalkov
the Telerik team
Unfortunatelly I found more bugs.
1. When I use XBAP application, with modal RadWindows, and when I push Tab key,sometimes controls that are behind the current active Window (on parent window) are also focuesed. Tab key should work only on currently focused Window.
2. When child window is opening slow, and I click on parent window (child don't appear yet), sometimes parent window is focues. I think its caused by method BringToFront - When parent window is Focused it is also brought to front. As a result parent window appears before child window (after child window appears). To resolve this bug you should disable BrindToFront (or Focus event) for parent window at start of method ShowDialog. Event should be enabled when Child window was closed
Best regards.
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
if (!this.IsActiveWindow)
{
e.Handled = true;
}
}
But I think that this is not best solution.
Please fix the bugs. RadWindow should not let to focus controls that are not on actualy active window.
Thank you for reporting these issues. Your Telerik points are updated for reporting this abnormal behavior of our RadWindow control. We will fix these bugs in one of our future releases. You can track their progress in our Public Issue Tracking System (PITS) with Issue IDs = 2923 and 2953.
Please do not hesitate to contact us if you require any further information.
Regards,George
the Telerik team
Hi,
I am using BringToFront to bring my non modal window in front of all the windows on some message events. But If I have opened a modal window, this non modal comes on top of it if there comes any message. This makes me press Alt-Tab to see the modal window otherwise the UI becomes non responsive(as non modal window can not be moved).
Is there any way of BringToFront not overriding the modal window/modal alert?
What I can suggest you would be to also set the IsTopmost property of the RadWindow dialog to true. This way it would always stay on top - either if another Window is being brought to front.
Please give it a try and let me know if this helps.
Regards,
Kalin
Telerik by Progress
Hi Kalin,
There can be any modal window... sometimes the radalert where IsTopmost is not always available.
Is there any way to check for any open modal window so that BringToFront() can be avoided... or any alternative method to BringToFront() which does not bring the non modal in front of modal window?
Regards,
Mahesh
I am not sure if I get your requirement absolutely right but if you want to set the IsTopmost property for an Alert, you can apply it through Style:
<
Style
TargetType
=
"telerik:RadWindow"
x:Key
=
"WindStyle"
BasedOn
=
"{StaticResource RadWindowStyle}"
>
<
Setter
Property
=
"IsTopmost"
Value
=
"True"
/>
</
Style
>
private
void
OnOpenIcon1Clicked(
object
sender, RoutedEventArgs e)
{
RadWindow.Alert(
new
DialogParameters { ContentStyle = Application.Current.Resources[
"Icon1AlertStyle"
]
as
Style, Content =
"Dialog with Icon 1."
, Header =
"Dialog with Icon 1"
, WindowStyle = Resources[
"WindStyle"
]
as
Style});
}
Regards,
Stefan Nenchev
Telerik by Progress