The problem:
Object reference not set to an instance of an object ( AFTER clicking an item in GridView the 2nd time).
This Object somehow refers to UoMCollection.Clear() and problem encountered here: txtBlkUoM.Text = Uom.UoM.ToString();
-1-- Declare this in the page ObservableCollection UoMCollection = new ObservableCollection(); -2-- Gridview : Click an item in GridView, it will do the following: PopUpItem.IsOpen = true; ( this is the popUp Box ) GetAllUoMForThisItem(No); -2-- This will fill up another ListBox calls : lsBoxUoM private async void GetAllUoMForThisItem(string No) { var db = new SQLiteAsyncConnection(DBPath); ( I need to clear the content each time an item selected in GridView ) UoMCollection.Clear(); var allUoM = await db.QueryAsync("Select * From ItemUoM Where ItemNo = '" + No + "'"); foreach (var _UoM in allUoM) { string strUoM = _UoM.UoM; AddToList(strUoM); } lsBoxUoM.ItemsSource = null; lsBoxUoM.ItemsSource = UoMCollection; } private void AddToList(string uom) { UoMCollection.Add(new ItemUoM() { UoM = uom }); } -3-- Make a selection in this PopUpBox private void lsBoxUoM_SelectionChanged(object sender, SelectionChangedEventArgs e) { if( lsBoxUoM.SelectedIndex == -1); var Uom = (ItemUoM)lsBoxUoM.SelectedItem; txtBlkUoM.Text = Uom.UoM.ToString(); } -4- Close this PopBox after a selection is made and Start from (2) again