Click here to Skip to main content
15,907,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am a beginner to Windows Store Apps. I am trying to create an app where first page will be a Grid App Page but on clicking on an item instead of displaying its content it should navigate to some other page. Where should I set link for it?

Thanks in advance. :)
Posted
Updated 27-May-14 4:35am
v2

1 solution

If the project is created using Grid App template, the page that gets loaded is "GroupedItemsPage". In order to change the navigation page on item click, go to the click event of the item in code-behind file...it could be something like this

C#
C#
void ItemView_ItemClick(object sender, ItemClickEventArgs e)
        {
            // Navigate to the appropriate destination page, configuring the new page
            // by passing required information as a navigation parameter
            var itemId = ((SampleDataItem)e.ClickedItem).UniqueId;
            this.Frame.Navigate(typeof(ItemDetailPage), itemId);
        }

so here you can change the page you need and pass required params
C#
this.Frame.Navigate(typeof(YourNewPage));



VB:

VB
Private Sub ItemView_ItemClick(sender As Object, e As ItemClickEventArgs)

       ' Navigate to the appropriate destination page, configuring the new page
       ' by passing required information as a navigation parameter
       Dim itemId As String = DirectCast(e.ClickedItem, Data.SampleDataItem).UniqueId
       Me.Frame.Navigate(GetType(ItemDetailPage), itemId)
   End Sub

so here you can change the page you need and pass required params
VB
Me.Frame.Navigate(GetType(YourNewPage))
 
Share this answer
 
v2
Comments
Irfan Project 4-Jul-14 7:05am    
Thanks a lot Naz_Firdouse!!!! :)
Your solution helped me a lot!

I was googling since a long time for its solution but was unable to get its answer... finally i gave it up....

But today you really made be happy with your awesome solution...
I tried your solution and most excitingly it really worked...!

Thank u so much....! :)
Naz_Firdouse 21-Jul-14 7:31am    
Glad to help others...:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900