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

Canvas inside RadWindow

5 Answers 99 Views
Window
This is a migrated thread and some comments may be shown as answers.
mohammed
Top achievements
Rank 1
mohammed asked on 19 May 2009, 01:48 PM
Hello

When Iam using Canvas with some controls inside a 'RadWindow', I could not control the size of the controls, the controls are displayed outside the window, irrespective of the size of the window.
Here is a sample test code:

RdWindow with canvas inside:

 

<Grid x:Name="LayoutRoot" Background="White">

 

 

<Button Name="btn" Height="22" Width="70" Content="Click" Margin="10,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Click="Button_Click"></Button>

 

<telerikNavigation:RadWindow x:Name="win1" Width="auto" Height="auto">
<Canvas>

 

 

<StackPanel Orientation="Horizontal">

 

 

<TextBlock Name="tblck" Text="Name of Employee:"></TextBlock>

 

 

<TextBox Name="txt1" Height="22" Width="140"></TextBox>

 

 

<Button Name="btn1" Content="Click" Height="22" Width="80"></Button>

 

 

</StackPanel>

 

 

</Canvas>

 

 

</telerikNavigation:RadWindow>

 

</

Grid>

 

 

 


RdWindow without canvas inside:

 

<Grid x:Name="LayoutRoot" Background="White">

 

 

<Button Name="btn" Height="22" Width="70" Content="Click" Margin="10,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Click="Button_Click"></Button>

<telerikNavigation:RadWindow x:Name="win1" Width="auto" Height="auto">
<StackPanel Orientation="Horizontal">

 

 

<TextBlock Name="tblck" Text="Name of Employee:"></TextBlock>

 

 

<TextBox Name="txt1" Height="22" Width="140"></TextBox>

 

 

<Button Name="btn1" Content="Click" Height="22" Width="80"></Button>

 

 

</StackPanel>
</telerikNavigation:RadWindow>

 

</

Grid>

 

 

Please let me know how to solve this.

 

Thank you,

Irfan

5 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 20 May 2009, 07:19 AM
Hi mohammed,

That is because if you don't set Width and Height properties of the Canvas it always has DesiredSize (0, 0). When the RadWindow control is in a Normal state and it has not been resized it asks its content how big it wants to be and the Canvas tells it that it want to be (0, 0) and the window shrinks to its minimum size.

You can fix this by removing the Canvas or by setting its width and height.

Regards,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
mohammed
Top achievements
Rank 1
answered on 20 May 2009, 01:41 PM

Hello

I set the width and height of the canvas, first appearance of the window is fine, but the problem is when Iam resizing the window. When the window is resized the controls can still be seen outside the boundaries of the window, like they are floating outside the window.

 

How can I make the controls to be confined within the 'RadWindow' boudaries.

 

Thank you,

Mohammed Irfan.

0
Miroslav Nedyalkov
Telerik team
answered on 21 May 2009, 08:54 AM
Hello mohammed,

Unfortunately, the RadWindow control doesn't fully support Canvas at its content, because of the problem with the Canvas I already mentioned. I would recommend you not to use Canvas for laying out your controls in RadWindow.

Regards,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Iosu Buenetxea
Top achievements
Rank 1
answered on 24 Jan 2011, 09:53 AM
Hi,

I have installed last version (Q3 2010 Sp1: 2010.3 1314) and this issue still occurs.  Is there a workaround?  I must use Canvas for laying out my controls.

Regards,

Iosu.
0
Miroslav Nedyalkov
Telerik team
answered on 27 Jan 2011, 10:24 AM
Hi Iosu,

 This problem is caused by the nature of the Canvas control and most probably it will not be supported out-of-the-box. What I would suggest you is to place a grid control as content of the RadWindow and to place the canvas as content of the Grid. After that you may bind the Width and Height properties of the Canvas to the ActualWidth and ActualHeight properties of the Grid. This should fix part of the problems, but as the Canvas doesn't behave as a normal Panel there will be still some issues.

Hope this helps!

Regards,
Miroslav Nedyalkov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
Window
Asked by
mohammed
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
mohammed
Top achievements
Rank 1
Iosu Buenetxea
Top achievements
Rank 1
Share this question
or