Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Listview does not change upon update
- <GridViewColumn Width="70" Header="Status">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <!--<CheckBox IsChecked="{Binding Path=Status, Mode= Twoway}" HorizontalContentAlignment="Center" IsEnabled="False"/>-->
- <TextBlock Text="{Binding Path=Status, Mode= Twoway}" TextAlignment="Center" Loaded="Page_Loaded"/>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- public partial class tblADRMaster: INotifyPropertyChanged
- {
- public string Status
- {
- get { return _status; }
- set
- {
- if (_status != value)
- {
- _status = value;
- OnPropertyChanged("Status");
- }
- }
- }
- }
- ObservableCollection<tblADRMaster> list = new ObservableCollection<tblADRMaster>();
- CurrentCase = FileMaintenanceBusiness.Instance.GetADRMasterInfobyKeywordRefresh(caseNo.CaseIDSystem, "CaseIDSystem");
- foreach (var c in listFrWWC)
- {
- if (c.CaseIDSystem != CurrentCase.CaseIDSystem)
- list.Add(c);
- else
- list.Add(CurrentCase);
- }
- foreach (var caseMaster in list)
- {
- caseMaster.IsMissingDocs = GetMissingDoc(caseMaster.tblADRDispositions);
- caseMaster.IsProblemCase = !string.IsNullOrEmpty(caseMaster.ProblemNote) ? "Yes" : "No";
- caseMaster.Status = GetStatus(caseMaster);
- }
- lvAdrMaster.ItemsSource = list;
- Text="{Binding Path=Status, Mode= Twoway, UpdateSourceTrigger=PropertyChanged}"
- private ListCollectionView EmpCollectionView
- {
- get
- {
- return (ListCollectionView)CollectionViewSource.GetDefaultView(ListOfEmp);
- }
- }
- private ObservableCollection<Employee> listOfEmp = new ObservableCollection<Employee>();
- public ObservableCollection<Employee> ListOfEmp
- {
- get { return listOfEmp; }
- set { listOfEmp = value; }
- }
- public void OnAdd(object sender)
- {
- ToggleButton tb = sender as ToggleButton;
- EmpCollectionView.SortDescriptions.Clear();
- if (tb.IsChecked == true)
- {
- EmpCollectionView.SortDescriptions.Add(new SortDescription(tb.Content.ToString(), ListSortDirection.Ascending));
- EmpCollectionView.Refresh();
- }
- else
- {
- EmpCollectionView.SortDescriptions.Add(new SortDescription(tb.Content.ToString(), ListSortDirection.Descending));
- EmpCollectionView.Refresh();
- }
- }
Add Comment
Please, Sign In to add comment