How to load my data details ?

Apr 19, 2011 at 8:04 AM

Hi

I can load my data to mainlistbox, but after i select one item, it gives me exception.

My mainlistbox_selectionchanged method :

 

private void MainListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

            if (MainListBox.SelectedItem != null)
            {
                Debug.WriteLine("MainListBox Selected Index = " + MainListBox.SelectedIndex);
                Debug.WriteLine("MainListBox Selected Item = " + MainListBox.SelectedItem);
               // Notes note = (MainListBox.SelectedItem as TableIndex<Notes, Tuple<DateTime, bool>, int>).LazyValue.Value;

                //find the right index
               

                //NavigationService.Navigate(new Uri("/DetailsPage.xaml?noteID=" + MainListBox.SelectedIndex, UriKind.Relative));
                

                Notes note = (MainListBox.SelectedItem as TableIndex<Notes, Tuple<DateTime, bool>, int>).LazyValue.Value;

                NavigationService.Navigate(new Uri("/DetailsPage.xaml?noteID=" + note.noteID, UriKind.Relative));
            }

            // If selected index is -1 (no selection) do nothing
            if (MainListBox.SelectedIndex == -1)
                return;



            
        }

Thanks

 

Coordinator
Apr 19, 2011 at 8:26 PM

What version or changeset of Sterling are you using? What is the exception you are receiving?