private void cBSortByDate_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (zapobiec) { //Take the item from the Conbo Box ComboBoxItem typeItem = (ComboBoxItem)cBSortByDate.SelectedItem; string value = typeItem.Content.ToString(); DataTable dt = actionsOnDatabase.sort(value.ToLower()); updateLocal(dt); } }