Home Forums WPF controls Xceed Toolkit Plus for WPF propertygrid binding string[] error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • lsl
    Participant
    Post count: 2
    #44860 |

    I have a class like

    class A
    {
       public string[] xx{get...;set...;}
    }
    PropertyGrid.DataContext = new A();
    

    when I edit xx on propertygrid will get error

    
    System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=Text; DataItem='PropertyGridEditorPrimitiveTypeCollectionControl' (Name=''); target element is 'MultiLineTextEditor' (Name=''); target property is 'Text' (type 'String') NullReferenceException:'System.NullReferenceException: 未将对象引用设置到对象的实例。
       在 Xceed.Wpf.Toolkit.PrimitiveTypeCollectionControl.CreateItemsSource()
       在 Xceed.Wpf.Toolkit.PrimitiveTypeCollectionControl.ComputeItemsSource()
       在 Xceed.Wpf.Toolkit.PrimitiveTypeCollectionControl.PersistChanges()
       在 Xceed.Wpf.Toolkit.PrimitiveTypeCollectionControl.OnTextChanged(String oldValue, String newValue)
       在 Xceed.Wpf.Toolkit.PrimitiveTypeCollectionControl.OnTextChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
       在 System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       在 System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       在 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       在 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       在 System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       在 MS.Internal.Data.PropertyPathWorker.SetValue(Object item, Object value)
       在 MS.Internal.Data.ClrBindingWorker.UpdateValue(Object value)
       在 System.Windows.Data.BindingExpression.UpdateSource(Object value)'
    

    I used latest version

      <package id="Xceed.Products.Wpf.Toolkit.Base" version="3.4.17280.14430" targetFramework="net461" />
      <package id="Xceed.Wpf.Toolkit" version="3.4.17280.14430" targetFramework="net461" />
    

    is this a bug or something I got mistake? thank you

    lsl
    Participant
    Post count: 2

    [Editor(typeof(CollectionEditor), typeof(CollectionEditor))]
    I try add on xx ,but I can not add string into it because add button is unenable

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.