I receive the following error at runtime when using the DataPresenter.
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=BtnImage'. BindingExpression:Path=ActualHeight; DataItem=null; target element is 'XamComboEditor' (Name=''); target property is 'Height' (type 'Double')
I am attempting to use the Metro theme but since it seems I cannot set "Theme" on the XamComboEditor in XAML I am using the Metro styles (including all required styles).
The issue seems to stem from DataPresenter but shows up regardless of if I include the DataPresenter styles or not. I started including these styles to rid myself of this error.
The error is not really impacting my application aside from throwing 3 binding errors which the user never sees. The error IS preventing me from performance profiling my application however.
Keep in mind that I get the error regardless of if the style files are included in my application. This is one of the source lines that apparently causes an issue:
From DataPresenterMetro.xaml in the FilterButtonStyleBase style:
<editors:XamComboEditor MinDropDownWidth="150" DropDownResizeMode="None" Opacity="0" ItemsSource="{Binding Operands, RelativeSource={RelativeSource TemplatedParent}}" SelectedItem="{Binding SelectedOperand, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsDropDownOpen="{Binding IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MaxWidth="1" Height="{Binding ActualHeight, ElementName=BtnImage}"/>
I am using the XamDataPresenter and I've specified a CardView. I am not allowing record filtering and I have no fields that would be edited with a combobox.
Note: I also get the same error if I change my XamDataPresenter with a CardView to a XamDataCards control. Currently I'm not even including the theme XAML files in the project and I still get the same thing.
The only idea that I have currently to get rid of this error is to include all the theme XAML files again and remove the Height binding for the XamComboEditor.
Hello,
I have been looking into your post and the best approach in your scenario would be to set the ‘Theme’ property of the XamDataPresenter instead of adding DataPresenterMetro.xaml.
I am attaching a sample application(DataGridXAMLComboThemeIssue.zip) where the binding error does not appear.
Let me know, if you need any further assistance on this matter.