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.
Hello,
I have logged this behavior with our developers in our tracking system, with an issue ID of 144406. I have also created a support ticket on your behalf with number CAS-118030-P8R2W0 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.
BTW: I get the same error if I use XamDataCards in place of the XamDataPresenter with a CardView.
That is the approach that I am currently taking and I get the error. The style files are not currently included or referenced from my application and I am already using the "Theme" property.
I originally included the style XAML files to help me investigate this error, the error was not caused by their inclusion.
Replace your XamDataGrid with a XamDataPresenter and you will get the error (I got the error when using your sample application).
This is the change that I made to get the error:
<!--<igWPF:XamDataGrid Theme="Metro" BindToSampleData="True" Grid.Row="0" HorizontalAlignment="Left" Margin="10,10,0,0" Name="xamDataGrid1" VerticalAlignment="Top" />--> <igWPF:XamDataPresenter BindToSampleData="True" Theme="Metro" x:Name="dpBlastTypes" AutoFit="True" Grid.Row="0">
<igWPF:XamDataPresenter.View> <igWPF:CardView> <igWPF:CardView.ViewSettings> <igWPF:CardViewSettings HeaderVisibility="Visible" AllowCardHeightResizing="True" AllowCardWidthResizing="True" Orientation="Horizontal" /> </igWPF:CardView.ViewSettings> </igWPF:CardView> </igWPF:XamDataPresenter.View> </igWPF:XamDataPresenter>
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.
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.