This question is locked. New answers and comments are not allowed.
I need to synchronize updates in edit mode I have chosen to display the information of the item.
I set IsTextSearchEnabled = "False" FilteringMode = "None"
But now when I enter a character, it calls the selectAll method. I need this feature, but I do not want it was selectAll
Help me !
| <Common:IscCombo x:Name="cboISBN" IsTextSearchEnabled="False" DataContext="{Binding}" FilteringMode="None" StaysOpenOnEdit="True" SelectedTextPath="strValue" ItemsSource="{Binding Path=DataModel.ISBN,Mode=TwoWay}" KeyDown="cboISBN_KeyDown" KeyUp="cboISBN_KeyUp" SelectedItem="{Binding Path=DataModel.ISBNSelected,Mode=TwoWay}" DisplayMemberPath="strValue" Style="{StaticResource ComboBoxStyle}"/> |
| private void cboISBN_KeyUp(object sender, KeyEventArgs e) |
| { |
| int iPos = _viewModel.DataModel.ISBN.IndexOf(_viewModel.DataModel.ISBNSelected); |
| ISBNData oNew = new ISBNData() { strValue = cboISBN.Text }; |
| _viewModel.DataModel.ISBN.RemoveAt(iPos); |
| _viewModel.DataModel.ISBN.Insert(iPos, oNew); |
| _viewModel.DataModel.ISBNSelected = _viewModel.DataModel.ISBN[iPos]; |
| //cboISBN.IsEditable = true; |
| } |
| private ObservableCollection<ISBNData> _iSBN; |
| public ObservableCollection<ISBNData> ISBN |
| { |
| get |
| { |
| return _iSBN; |
| } |
| set |
| { |
| if (value != _iSBN) |
| { |
| _iSBN = value; |
| OnPropertyChanged("ISBN"); |
| } |
| } |
| } |
| private ISBNData _iSBNSelected; |
| public ISBNData ISBNSelected |
| { |
| get |
| { |
| return _iSBNSelected; |
| } |
| set |
| { |
| if (value != null && value != _iSBNSelected) |
| { |
| if (value !=null && value.strValue == "<NEW>") |
| { |
| ISBNData o = new ISBNData(){strValue=string.Empty}; |
| ISBN.Insert(0, o); |
| _iSBNSelected = o; |
| } |
| else |
| { |
| _iSBNSelected = value; |
| } |
| OnPropertyChanged("ISBNSelected"); |
| } |
| } |
| } |
Init Method
| this.ItemDataModel.ISBN = new ObservableCollection<ISBNData>(); |
| ISBNData strNew = new ISBNData() { strValue = string.Empty }; |
| this.ItemDataModel.ISBN.Add(strNew); |
| this.ItemDataModel.ISBN.Add(new ISBNData() { strValue = "<NEW>"}); |
| //this.ItemDataModel.ISBN.Add(GVariable.gsvNew); |
| this.ItemDataModel.ISBNSelected = strNew; |