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

Navigate() function of RadFrame error

1 Answer 63 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
xuan
Top achievements
Rank 1
xuan asked on 17 Mar 2009, 06:59 AM
When i use Navigate() function of RadFrame control. I met  an error at Frame.Navigate(navi);:
"Root visual should be Panel". please helps me to solve that problem!
 public TemplateFrame()
        {
            InitializeComponent();
            NavigatePage navi = new NavigatePage(new Page());
            Frame.Navigate(navi);
        }
NavigatePage is created like that :

 public partial class NavigatePage : UserControl,IFrame
    {
        public NavigatePage()
        {
            InitializeComponent();
        }
        public NavigatePage(Page nextPage)
        {
            InitializeComponent();
           LayoutRoot.Children.Add(nextPage);
        }

1 Answer, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 19 Mar 2009, 11:34 AM
Hello Xuan,

Can you please check if the application's RootVisual is set to RadFrameContainer:

private void Application_Startup(object sender, StartupEventArgs e)
        {
            this.RootVisual = new RadFrameContainer();
            NavigationService service = NavigationService.GetNavigationService();
            if (!NavigationService.LoadDeepLink())
            {
                service.Navigate(new Page1());
            }
        }
 
Note:
It is important that RadFrame must always be placed in RadFrameContainer! You can use RadFrame in this way:

    <telerik:RadFrameContainer>
                <telerik:RadFrame Source="Page2" Width="500" Height="300"></telerik:RadFrame>               
           </telerik:RadFrameContainer>

When you use navigation with RadFrame the navigation target is automatically set to the parent RadFrameContainer thet holds the frame.

For more examples visit:
http://demos.telerik.com/silverlight/#PageNavigation/FirstLook
http://www.telerik.com/help/silverlight/navigation-implement-navigation-framework.html

Please let me know if you have further questions.

Best wishes,
Boryana
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
xuan
Top achievements
Rank 1
Answers by
Bobi
Telerik team
Share this question
or