Current filter:
                                You should refresh the page.
                                  • Hi there,
                                    in the below code, How do we set StartupNavigationItem?
                                        protected override void OnLoggedOn(LogonEventArgs args)
                                            {
                                                base.OnLoggedOn(args);

                                                IModelApplication modelApp = (this.Model as ModelApplication);
                                            }
                                    Best regards,
                                    Duc

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Duc,
                                Thanks for contacting us.
                                Please use the following code in your XafApplication descendant class (YourSolutionName.Wxx/WxxApplication.xx):

                                [C#]
                                protected override void OnLoggedOn(LogonEventArgs args) { base.OnLoggedOn(args); IModelApplicationNavigationItems navigationItems = this.Model as IModelApplicationNavigationItems; if (navigationItems != null) foreach (IModelNavigationItem item in navigationItems.NavigationItems.AllItems) if (item.View != null & item.View.Id == "Department_ListView") { navigationItems.NavigationItems.StartupNavigationItem = item; break; } }

                                Let me know in case of any further difficulty.
                                Thanks,
                                Dennis

                                • Lukasz Stanczyk 2 12.11.2012

                                  Dennis - i have followed this one and i do see that navigationItems.NavigationItems.StartupNavigationItem = item; is executed, but the view is not loaded on startup.

                                • Lukasz Stanczyk 2 12.11.2012

                                  Actually i have noticed that it does work but the second time you log in. I put the code in my WinApplication.cs.

                                • Dennis (DevExpress) 12.11.2012

                                  @Lukasz: You can set the same property via the Model Editor at design time. Please let me know if this solution meets your needs.

                                • Lukasz Stanczyk 2 02.05.2013

                                  No - i need to be able to do it from code - my startup view depends on users role in the system. I have opened a separate ticket for this - http://www.devexpress.com/Support/Center/Question/Details/Q472833

                                • Dennis (DevExpress) 02.06.2013

                                  @Lukasz: I have just tested the code I originally posted above, and it all worked fine in my tests with MainDemo.Win. So, I would appreciate additional instructions on how to replicate this issue. Please post them in your other ticket.