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

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

                                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):

                                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.

                                • 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 -

                                • 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.