Last post Jun 04, 2019 07:19 PM by mgebhard
Jun 04, 2019 07:14 PM|Norkle|LINK
I have a multiview that houses 9 views , which are powered by datagrids. The ActiveViewIndex gets the value from the enum lineup
enum TabPages : int
Test = 0,
Second = 2,
Third = 3,
...this checks to see if the page clicked was in the lineup:
if (mvTabViews.ActiveViewIndex == (int)TabPages.Third)
...and this sets the selected tab value:
int nSelectedTab = Convert.ToInt16(e.Item.Value);
...the other datagrids I have work, they display when the appropriate menu item is clicked. When I click on the one that is wired to the Third value, i get the error :
System.ArgumentOutOfRangeException: ActiveViewIndex is being set to '3'. It must be smaller than the current number of View controls '3'. For dynamically added views, make sure they are added before or in Page_PreInit event.
i'm not sure how to deal with the Page_PreInit event, as right now (I'm not the author of the code) the Page_PreInit event just initiates a master page for the mobile view of the application. All my other tabs on the menu work fine except this one on
Jun 04, 2019 07:19 PM|mgebhard|LINK
The error seems pretty clear. The code is trying to access a View index that does not exist.
We can't see the code so that's about all the help we can provide.