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.
Hi Srinivas,
You can download the latest Service Release by going to our web site -> click Account -> select your Product -> select Service Release tab
Let me know, if you need any further assistance on this matter.
How to download The development issue with ID of 144406 has been fixed and it is available in the latest Service Release.
Can you please more details for download links.
Hello,
The development issue with ID of 144406 has been fixed and it is available in the latest Service Release. You can download the Service Release by logging in our web site and then going to Account and Download.
I found a workaround. I am now referencing the following style files in my application:
<ResourceDictionary Source="Styles/Metro/DataPresenterGeneric_Brushes.xaml" /> <ResourceDictionary Source="Styles/Metro/DataPresenterGeneric_Express.xaml" /> <ResourceDictionary Source="Styles/Metro/DataPresenterGeneric.xaml" /> <ResourceDictionary Source="Styles/Metro/DataPresenterMetro_Brushes.xaml" /> <ResourceDictionary Source="Styles/Metro/DataPresenterMetro_Express.xaml" /> <ResourceDictionary Source="Styles/Metro/DataPresenterMetro.xaml" />
I am NOT using the Metro.xamDataPresenter.xaml file since it forces use of the style in the assembly (which has a problem). I fixed the problem in DataPresenterMetro.xaml and the solution is as follows:
In FilterButtonStyleBase in the Template setter, comment out the path element inside the CardPanel and add an AutoDisabledImage element named "BtnImage". The change is below, I am including the CardPanel and the XamComboEditor for context:
<igWindows:CardPanel IsHitTestVisible="False" Margin="{TemplateBinding Padding}"> <!--<Path Fill="{TemplateBinding Background}" Width="14" Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0,0 C0,0 11,0 11,0 11,0 7,4 7,4 7,4 7,8 7,8 7,8 4,8 4,8 4,8 4,4 4,4 4,4 0,0 0,0 z" Stretch="Fill"/>--> <igWindows:AutoDisabledImage x:Name="BtnImage" Stretch="None" igWindows:Utilities.SnapElementToDevicePixels="True" VerticalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding VerticalContentAlignment}"> <igWindows:AutoDisabledImage.Source> <BitmapImage UriSource="Images/Filter.png" /> </igWindows:AutoDisabledImage.Source> </igWindows:AutoDisabledImage>
<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}"/> </igWindows:CardPanel>
You will notice that the Path element is commented out. Apologies for pasting XAML into the thread.
With this approach you get the missing element and ignore the style in the assembly. Granted you have to include several files and the images folder to do it but overall I am happy that it is fixed. I might have just been able to name the Path "BtnImage" but at least this matches the pattern in the other theme files.
Hello Yanko,
Thank you. In the meantime I guess I'll change it to a XamDataGrid for the purpose of performance profiling.