Skip to main content
Home Forums General Silverlight Getting Started Want to Put NEXT & BACK Link to Application for go other page.
2 replies. Latest Post by Min-Hong Tang - MSFT on November 9, 2009.
(0)
viral0028
Member
23 points
161 Posts
11-04-2009 2:13 AM |
Hi,,,
I hv one page.. In this page i put 5 different Grid. with different content. now i want to Put NEXT & BACK button to Uper part this 5 grid.
if user click on Next page this Will show Next grid of current Grid. & vice vice versa for back..
How do i get Starts..
Please give me suggestion.
( if possible then i wnat use only One NEXT & BACK button)
Thx In Advance.
rabbott
258 points
37 Posts
11-04-2009 6:03 AM |
Hi, assuming your buttons are called buttonNext and buttonBack, and your grids are named grid1 through grid5:
private int gridIndex = 0;private void buttonBack_Click(object sender, RoutedEventArgs e){ gridIndex--; if (gridIndex < 0) gridIndex = 4; ShowGrids();}private void buttonNext_Click(object sender, RoutedEventArgs e){ gridIndex++; if (gridIndex > 4) gridIndex = 0; ShowGrids();}private void ShowGrids(){ grid1.Visibility = (gridIndex == 0 ? Visibility.Visible : Visibility.Collapsed); grid2.Visibility = (gridIndex == 1 ? Visibility.Visible : Visibility.Collapsed); grid3.Visibility = (gridIndex == 2 ? Visibility.Visible : Visibility.Collapsed); grid4.Visibility = (gridIndex == 3 ? Visibility.Visible : Visibility.Collapsed); grid5.Visibility = (gridIndex == 4 ? Visibility.Visible : Visibility.Collapsed);}
Regards,Rob
Min-Hong...
Contributor
3375 points
377 Posts
11-09-2009 9:24 PM |
Hi,
Rabbott could achieve what you want. And you may also do it use the navigation feature.
The whole ideal is like this:
Create a mainpage and nest a frame inside it.
Then create five Page(each contains a grid). Then you can navigate throught.
Best Regards