Guest User

Untitled

a guest
Aug 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. Listview does not change upon update
  2. <GridViewColumn Width="70" Header="Status">
  3. <GridViewColumn.CellTemplate>
  4. <DataTemplate>
  5. <!--<CheckBox IsChecked="{Binding Path=Status, Mode= Twoway}" HorizontalContentAlignment="Center" IsEnabled="False"/>-->
  6. <TextBlock Text="{Binding Path=Status, Mode= Twoway}" TextAlignment="Center" Loaded="Page_Loaded"/>
  7. </DataTemplate>
  8. </GridViewColumn.CellTemplate>
  9. </GridViewColumn>
  10.  
  11. public partial class tblADRMaster: INotifyPropertyChanged
  12. {
  13. public string Status
  14. {
  15. get { return _status; }
  16. set
  17. {
  18. if (_status != value)
  19. {
  20. _status = value;
  21. OnPropertyChanged("Status");
  22. }
  23. }
  24. }
  25. }
  26.  
  27. ObservableCollection<tblADRMaster> list = new ObservableCollection<tblADRMaster>();
  28. CurrentCase = FileMaintenanceBusiness.Instance.GetADRMasterInfobyKeywordRefresh(caseNo.CaseIDSystem, "CaseIDSystem");
  29. foreach (var c in listFrWWC)
  30. {
  31. if (c.CaseIDSystem != CurrentCase.CaseIDSystem)
  32. list.Add(c);
  33. else
  34. list.Add(CurrentCase);
  35.  
  36. }
  37. foreach (var caseMaster in list)
  38. {
  39. caseMaster.IsMissingDocs = GetMissingDoc(caseMaster.tblADRDispositions);
  40. caseMaster.IsProblemCase = !string.IsNullOrEmpty(caseMaster.ProblemNote) ? "Yes" : "No";
  41. caseMaster.Status = GetStatus(caseMaster);
  42. }
  43.  
  44. lvAdrMaster.ItemsSource = list;
  45.  
  46. Text="{Binding Path=Status, Mode= Twoway, UpdateSourceTrigger=PropertyChanged}"
  47.  
  48. private ListCollectionView EmpCollectionView
  49. {
  50. get
  51. {
  52. return (ListCollectionView)CollectionViewSource.GetDefaultView(ListOfEmp);
  53. }
  54. }
  55.  
  56.  
  57. private ObservableCollection<Employee> listOfEmp = new ObservableCollection<Employee>();
  58. public ObservableCollection<Employee> ListOfEmp
  59. {
  60. get { return listOfEmp; }
  61. set { listOfEmp = value; }
  62. }
  63.  
  64. public void OnAdd(object sender)
  65. {
  66. ToggleButton tb = sender as ToggleButton;
  67.  
  68. EmpCollectionView.SortDescriptions.Clear();
  69. if (tb.IsChecked == true)
  70. {
  71.  
  72. EmpCollectionView.SortDescriptions.Add(new SortDescription(tb.Content.ToString(), ListSortDirection.Ascending));
  73. EmpCollectionView.Refresh();
  74. }
  75. else
  76. {
  77. EmpCollectionView.SortDescriptions.Add(new SortDescription(tb.Content.ToString(), ListSortDirection.Descending));
  78. EmpCollectionView.Refresh();
  79. }
  80. }
Add Comment
Please, Sign In to add comment