void grid_ItemsSourceUpdated(object sender, ItemsSourceUpdatedEventArgs e)
 {
     try
     {
         youtubeGrid.Columns.FirstOrDefault(x => x.Header.ToString() == "DownloadUrl").Visibility = System.Windows.Visibility.Hidden;
         youtubeGrid.SelectedItem = null;
     }
     catch (Exception) { }
 }
Esempio n. 2
0
        void grid_ItemsSourceUpdated(object sender, ItemsSourceUpdatedEventArgs e)
        {
            var grid = sender as BaseDataGrid;

            if (grid.SortDescriptions != null && e.New is ICollectionView)
            {
                var listCollectionView = CollectionViewSource.GetDefaultView(e.New);

                grid.SortDescriptions.ForEach(listCollectionView.SortDescriptions.Add);
            }
        }