Broken Binding

Grids for WPF Forum

Posted 5 years ago by Miles Merckel
Version: 14.2.0611
Avatar

Hi

 

I'm having trouble with some "simple" binding.

 

Copied from the "Editors Integration" example I have copied the categorize button section

 

<RadioButton x:Name="categorizeButton" IsChecked="True" GroupName="PropertyDisplayType">
    <Image Source="/Resources/Images/Categorize16.png" Width="16" Height="16" />
</RadioButton>

<propgrid:PropertyGrid x:Name="propGrid" IsSummaryVisible="False" IsCategorized="{Binding IsChecked, ElementName=categorizeButton}" IsItemDefaultContextMenuEnabled="False">

 This gives the error

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=categorizeButton'. BindingExpression:Path=IsChecked; DataItem=null; target element is 'PropertyGrid' (Name='propertyGridEeprom'); target property is 'IsCategorized' (type 'Boolean')

 

I have also tried binding SortImportance from multiple PropertyGridPropertyItem's so a single item this produces a similar error

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=propPdc50'. BindingExpression:Path=SortImportance; DataItem=null; target element is 'PropertyGridPropertyItem' (Name='propPdc1000'); target property is 'SortImportance' (type 'PropertyGridSortImportance')

 

Using event handlers I can make it work.

 

I'm sure these features worked early on, may be my environment is unstable. Any suggestions would be much appreciated.

 

Regards

Miles

Comments (1)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Miles,

Unfortunately I'm not sure, but a binding on the root level of the PropertyGrid would be all core WPF and out of our control. It sounds like something with how the controls are oriented with regard to each other isn't allowing the core WPF data binding logic to work properly and find the other control. Make sure they aren't in different XAML trees or anything like that.


Actipro Software Support

The latest build of this product (v2019.1 build 0682) was released 30 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.