Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RowData
- {
- public string Box1 { get; set; }
- public string Box2 { get; set; }
- public string Box3 { get; set; }
- };
- private ObservableCollection<RowData> Data = new ObservableCollection<RowData>();
- ...
- MyListView.ItemsSource = Data;
- MyGridViewColumn.DisplayMemberBinding = new Binding("Box1"));
- private void ListViewItem_DoubleClick(object sender, MouseButtonEventArgs e)
- {
- ListViewItem item = sender as ListViewItem;
- RowData data = item.DataContext as RowData;
- data.Box1 = "new string";
- }
- public class RowData : INotifyPropertyChanged
- {
- private string box1;
- public string Box1
- {
- get { return box1; }
- set
- {
- if(box1 == value) return;
- box1= value;
- NotifyPropertyChanged("Box1 ");
- }
- }
- //repet the same to Box2 and Box3
- public event PropertyChangedEventHandler PropertyChanged;
- private void NotifyPropertyChanged(String propertyName)
- {
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- }
Add Comment
Please, Sign In to add comment