Canvas inside RadWindow

6 posts, 0 answers
  1. mohammed
    mohammed avatar
    4 posts
    Member since:
    Mar 2009

    Posted 19 May 2009 Link to this post

    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

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 20 May 2009 Link to this post

    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.
  3. DevCraft banner
  4. mohammed
    mohammed avatar
    4 posts
    Member since:
    Mar 2009

    Posted 20 May 2009 Link to this post

    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.

  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 21 May 2009 Link to this post

    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.
  6. Iosu Buenetxea
    Iosu Buenetxea avatar
    91 posts
    Member since:
    Jan 2008

    Posted 24 Jan 2011 Link to this post

    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.
  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 27 Jan 2011 Link to this post

    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>>
Back to Top
DevCraft banner