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

ViewMode not Changing

1 Answer 29 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Phillip Foster
Top achievements
Rank 1
Phillip Foster asked on 25 Feb 2011, 10:20 PM
I may be doing something wrong here, but I've added a button to my form that would allow the user to change the view mode. 
Basically, its just not working. The pageview never changes modes. What am i doing wrong?

The code is here:


private void btnView_Click(object sender, EventArgs e)
       {
           if (pvChecklist.ViewMode == PageViewMode.Stack)
               pvChecklist.ViewMode = PageViewMode.Strip;
           if (pvChecklist.ViewMode == PageViewMode.Strip)
               pvChecklist.ViewMode = PageViewMode.ExplorerBar;
           if (pvChecklist.ViewMode == PageViewMode.ExplorerBar)
               pvChecklist.ViewMode = PageViewMode.Stack;
       }

1 Answer, 1 is accepted

Sort by
0
Accepted
Phillip Foster
Top achievements
Rank 1
answered on 25 Feb 2011, 10:23 PM
nvm. i fixed it.. I made the following change and it works.

private void btnView_Click(object sender, EventArgs e)
     {
         PageViewMode pvm = new PageViewMode();
 
         if (pvChecklist.ViewMode == PageViewMode.Stack)
             pvm = PageViewMode.Strip;
         if (pvChecklist.ViewMode == PageViewMode.Strip)
             pvm = PageViewMode.ExplorerBar;
         if (pvChecklist.ViewMode == PageViewMode.ExplorerBar)
             pvm = PageViewMode.Stack;
 
         pvChecklist.ViewMode = pvm;
     }
Tags
PageView
Asked by
Phillip Foster
Top achievements
Rank 1
Answers by
Phillip Foster
Top achievements
Rank 1
Share this question
or