コード例 #1
0
 public void Dispose()
 {
     if (selected.Count > 0)
     {
         var finalSelected = new List <int>();
         var dataStore     = grid.DataStore;
         if (dataStore != null)
         {
             // go through list to find indexes of previously selected items
             int row = 0;
             foreach (var item in dataStore)
             {
                 if (selected.Contains(item))
                 {
                     finalSelected.Add(row);
                 }
                 row++;
             }
         }
         grid.SelectedRows = finalSelected;
         if (finalSelected.Count != selectedCount)
         {
             grid.OnSelectionChanged(EventArgs.Empty);
         }
     }
     grid.supressSelectionChanged = false;
 }
コード例 #2
0
ファイル: GridViewSelection.cs プロジェクト: pcdummy/Eto
 private void ChangeSelection(Action a)
 {
     state = GridViewSelectionState.SelectionChanging;
     a();                                          // Causes GridView.OnSelectionChanged to trigger which calls SuppressSelectionChanged which returns true.
     state = GridViewSelectionState.SelectionChanged;
     gridView.OnSelectionChanged(EventArgs.Empty); // Calls SuppressSelectionChanged which returns false.
     state = GridViewSelectionState.Normal;        // This should already be done in SuppressSelectionChanged but repeated for robustness
 }