Apply PropertyGridDataAccessorItem Style to specific PropGri

Grids for WPF Forum

Posted 13 years ago by Pat Maneely - Software Engineering Manager, Cobham Aerospace
Avatar
I have a PropertyGridDataAccessorItem Style that I want to target to only 1 of 10 PropertyGrid that are in the same Wizard Control.

If I target it to all PropertyGridDataAccessorItems it screws up the rest of my propertyGrids and they don't render at all.

I gave the style a keyname,MyPageStyle for example, but I don't know the syntax to apply it to a specific propertyGrid's Data Accessor. If I apply it to the propertyGrids Style property the xaml 'compiler' complains.

So here's the style...


<Style x:Key="MyPageStyle" TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
...
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Hidden" />
</MultiDataTrigger>
...
</Style.Triggers>
</Style>


How would I apply this style to a specific propertyGrid?

My propertyGrid's in a WizardPage...

<propgrid:PropertyGrid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
IsSummaryVisible="True"
SelectedObject="{Binding Path=CommSysData}">
<propgrid:PropertyGrid.DataFactory>
<local:CustomDataFactory />
</propgrid:PropertyGrid.DataFactory>
</propgrid:PropertyGrid>



thanks

[Modified at 08/02/2011 06:44 PM]

Comments (6)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Pat,

You can do something like:
<propgrid:PropertyGrid  ...> 
    <propgrid:PropertyGrid.Resources> 
        <Style x:Key="{x:Type propgrid:PropertyGridDataAccessorItem}" TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}"
            BaseOn="{StaticResource MyPageStyle}" /> 
    </propgrid:PropertyGrid.Resources> 
</propgrid:PropertyGrid>
Or you can just define the entire Style in the PropertyGrid's Resources.


Actipro Software Support

Posted 13 years ago by Pat Maneely - Software Engineering Manager, Cobham Aerospace
Avatar
Thanks - that worked!

Sorry for all the newbie questions...
Posted 13 years ago by Pat Maneely - Software Engineering Manager, Cobham Aerospace
Avatar
Oops It works but not w/out a bunch of binding errors.

Its kind of interesting The first two PropertyGrids don't have any binding problems. Once I apply the Style sheet to the PropertyGrid(SysDataPG), all the PropertyGrids AFTER that have binding problem. The binding problems appear to be caused by the style sheet trying to resolve binding to property that are in the previous PropertyGrid? I'm not sure if that makes sense.

Thanks for your help - I really like the controls.

Here is the entire XAML and Binding errors. Sorry for the long post, but I figured I'd give it all to you so there was less confusion. I've renamed some of the objects, but I think its still representative.




<Window x:Class="local.ConfigSetup"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:MyApp"
xmlns:propgrid="http://schemas.actiprosoftware.com/winfx/xaml/propgrid"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes"
xmlns:wizard="http://schemas.actiprosoftware.com/winfx/xaml/wizard"
Title="Configuration"
Width="600" MaxWidth="600"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow">
<Window.Resources>

<local:BoolInverterConverter x:Key="BoolInverterConverter"/>


<Style x:Key="SysDataPgStyle" TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding DataAccessorType, RelativeSource={RelativeSource Self}}" Value="Category" />
<Condition Binding="{Binding DisplayName, RelativeSource={RelativeSource Self}}" Value="Misc" />
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Hidden" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding DataAccessorType, RelativeSource={RelativeSource Self}}" Value="Category" />
<Condition Binding="{Binding DisplayName, RelativeSource={RelativeSource Self}}" Value="System #1" />
<Condition Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type propgrid:PropertyGrid}}, Path=DataContext.SysData.Count}" Value="0" />
</MultiDataTrigger.Conditions>
<Setter Property="IsExpanded" Value="False" />
<Setter Property="Visibility" Value="Hidden" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding DataAccessorType, RelativeSource={RelativeSource Self}}" Value="Category" />
<Condition Binding="{Binding DisplayName, RelativeSource={RelativeSource Self}}" Value="System #2" />
<Condition Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type propgrid:PropertyGrid}}, Path=DataContext.SysData.Count}" Value="0" />
</MultiDataTrigger.Conditions>
<Setter Property="IsExpanded" Value="False" />
<Setter Property="Visibility" Value="Hidden" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding DataAccessorType, RelativeSource={RelativeSource Self}}" Value="Category" />
<Condition Binding="{Binding DisplayName, RelativeSource={RelativeSource Self}}" Value="System #2" />
<Condition Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type propgrid:PropertyGrid}}, Path=DataContext.SysData.Count}" Value="1" />
</MultiDataTrigger.Conditions>
<Setter Property="IsExpanded" Value="False" />
<Setter Property="Visibility" Value="Hidden" />
</MultiDataTrigger>
</Style.Triggers>
</Style>


<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip"
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=(Validation.Errors).CurrentItem.ErrorContent}"/>
</Trigger>
</Style.Triggers>
</Style>


<Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip"
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=(Validation.Errors).CurrentItem.ErrorContent}"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>

<wizard:Wizard x:Name="ConfigSetupWizard" WindowTitleBehavior="PageTitle" WindowTitleBaseText="Configuration Wizard"
PageSequenceType="Stack" BackwardProgressTransitionDuration="0:0:0.5" ForwardProgressTransitionDuration="0:0:0.5"
IsWindowDialogResultUpdatingEnabled="True"
HelpButtonVisible="False"
FinishButtonEnabled="{Binding ValidConfig}">
<wizard:Wizard.TransitionSelector>
<shared:MultiTransitionSelector>

<shared:BarWipeTransition />
</shared:MultiTransitionSelector>
</wizard:Wizard.TransitionSelector>
<wizard:WizardPage x:Name="ConfigSetupWelcomePg" PageType="Exterior"
Caption="Welcome to the &#13;Configuration Wizard"
Description="This will guide you through creating your configurtion"
HelpButtonVisible="False">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<TextBlock Grid.Row="1" TextWrapping="Wrap">To continue, click Next.</TextBlock>
</Grid>
</wizard:WizardPage>
<wizard:WizardPage x:Name="msmFSPPage"
Caption="System Configuration Parameters"
Description="This page contains the Parameters necessry to configuration System"
Title="System Configuration Parameters Page"
HelpButtonVisible="False"
NextButtonEnabled="{Binding Path=SysData.CapableSystem}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0"
Content="Configuration Name" />
<TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
MaxLines="1" Margin="-100,0,0,0" HorizontalAlignment="Stretch" Width="Auto"
Text="{Binding Path=SysData.Name}"/>

<propgrid:PropertyGrid Name="SysDataPG" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
IsSummaryVisible="True"
SelectedObject="{Binding Path=SysData}">
<propgrid:PropertyGrid.Resources>
<Style x:Key="{x:Type propgrid:PropertyGridDataAccessorItem}" TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}"
BasedOn="{StaticResource SysDataPgStyle}" />
</propgrid:PropertyGrid.Resources>
<propgrid:PropertyGrid.DataFactory>
<local:CustomDataFactory />
</propgrid:PropertyGrid.DataFactory>
</propgrid:PropertyGrid>
</Grid>
</wizard:WizardPage>
<wizard:WizardPage x:Name="msmSIPage"
Caption="Schema Information"
Description="This page contains the Schema Information for the Module"
Title="Schema Information Page"
HelpButtonVisible="False"
FinishButtonEnabled="{Binding ValidConfig}">
<propgrid:PropertyGrid Name="msmSIPg"
IsSummaryVisible="True" SelectedObject="{Binding Path=MsmSI}">
<propgrid:PropertyGrid.DataFactory>
<propgrid:TypeDescriptorFactory />
</propgrid:PropertyGrid.DataFactory>
</propgrid:PropertyGrid>
</wizard:WizardPage>
<wizard:WizardPage x:Name="SysParmsPage"
Caption="System Parameters"
Description="This page contains System Parameters"
Title="System Parameters Page"
HelpButtonVisible="False"
FinishButtonEnabled="{Binding ValidConfig}">
<propgrid:PropertyGrid Name="msmASPPg"
IsSummaryVisible="True" SelectedObject="{Binding Path=MsmASP}">
<propgrid:PropertyGrid.DataFactory>
<propgrid:TypeDescriptorFactory />
</propgrid:PropertyGrid.DataFactory>
</propgrid:PropertyGrid>
</wizard:WizardPage>
<wizard:WizardPage x:Name="ConvParmsPage"
Caption="Conventional Parameters"
Description="This page contains Conventional Parameters"
Title="Conventional Parameters Page"
HelpButtonVisible="False">
<propgrid:PropertyGrid IsSummaryVisible="True" SelectedObject="{Binding Path=MsmCP}">
<propgrid:PropertyGrid.DataFactory>
<propgrid:TypeDescriptorFactory />
</propgrid:PropertyGrid.DataFactory>
</propgrid:PropertyGrid>
</wizard:WizardPage>
</wizard:Wizard>
</Window>



Here are all the Binding errors. They are emitted by Visual Studio when the Schema Info Page(msmSIPage) is displayed. It has the MsmSI PropertyGrid, but shouldn't have any Style applied.

The First two (2) are always emitted - I don't understand that either because the MsmSIPage and associated SelectedObject (MsmSI) don't have these properties

System.Windows.Data Error: 39 : BindingExpression path error: 'SysData' property not found on 'object' ''WizardPage' (Name='msmSIPage')'. BindingExpression:Path=SysData.Name; DataItem='WizardPage' (Name='msmSIPage'); target element is 'TextBox' (Name=''); target property is 'Text' (type 'String')
System.Windows.Data Error: 39 : BindingExpression path error: 'SysData' property not found on 'object' ''WizardPage' (Name='msmSIPage')'. BindingExpression:Path=SysData; DataItem='WizardPage' (Name='msmSIPage'); target element is 'PropertyGrid' (Name='SysDataPG'); target property is 'SelectedObject' (type 'Object')



THese are only emitted when the Style is applied to the System Config Page (msmFSPPage)


System.Windows.Data Error: 39 : BindingExpression path error: 'SysData' property not found on 'object' ''WizardPage' (Name='msmSIPage')'. BindingExpression:Path=DataContext.SysData.RT5KCount; DataItem='PropertyGrid' (Name='SysDataPG'); target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 39 : BindingExpression path error: 'SysData' property not found on 'object' ''WizardPage' (Name='msmSIPage')'. BindingExpression:Path=DataContext.SysData.RT5KCount; DataItem='PropertyGrid' (Name='SysDataPG'); target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 39 : BindingExpression path error: 'SysData' property not found on 'object' ''WizardPage' (Name='msmSIPage')'. BindingExpression:Path=DataContext.SysData.RT5KCount; DataItem='PropertyGrid' (Name='SysDataPG'); target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'PropertyGridDataAccessorItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.TreeListViewItem', AncestorLevel='1''. BindingExpression:Path=IsExpanded; DataItem=null; target element is 'TreeListViewToggleButton' (Name=''); target property is 'IsChecked' (type 'Nullable`1')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.TreeListViewItem', AncestorLevel='1''. BindingExpression:Path=HasItems; DataItem=null; target element is 'TreeListViewToggleButton' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.TreeListViewItem', AncestorLevel='1''. BindingExpression:Path=IsExpanded; DataItem=null; target element is 'TreeListViewToggleButton' (Name=''); target property is 'IsChecked' (type 'Nullable`1')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.TreeListViewItem', AncestorLevel='1''. BindingExpression:Path=HasItems; DataItem=null; target element is 'TreeListViewToggleButton' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.TreeListViewItem', AncestorLevel='1''. BindingExpression:Path=IsExpanded; DataItem=null; target element is 'TreeListViewToggleButton' (Name=''); target property is 'IsChecked' (type 'Nullable`1')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.TreeListViewItem', AncestorLevel='1''. BindingExpression:Path=HasItems; DataItem=null; target element is 'TreeListViewToggleButton' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.TreeListViewItem', AncestorLevel='1''. BindingExpression:Path=IsExpanded; DataItem=null; target element is 'TreeListViewToggleButton' (Name=''); target property is 'IsChecked' (type 'Nullable`1')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='ActiproSoftware.Windows.Controls.PropertyGrid.TreeListViewItem', AncestorLevel='1''. BindingExpression:Path=HasItems; DataItem=null; target element is 'TreeListViewToggleButton' (Name=''); target property is 'NoTarget' (type 'Object')

[Modified at 08/04/2011 11:44 AM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Pat,

Please try to limit code posts to a few short snippets. If you need to include more code, then please put together a small sample project that reproduces your issue and email it over then we can take a closer look. Be sure to remove any executables or change the extension of the zip file to ensure it gets past our email filters.

The PropertyGrid binding errors are a known issue, which unfortunately we have no real control over. They are due to a timing issue in WPF and we have no way to turn them off. If you have a sample project you can send, we can see if there's a way to work around these errors in your case.


Actipro Software Support

Posted 13 years ago by Pat Maneely - Software Engineering Manager, Cobham Aerospace
Avatar
I apologize. I didn't see a way to attach a zip file. I will email in the future.


So - Are the binding error benign? If so I will ignore them.

I will put together a sample for you soon.


thanks
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Pat,

The PropertyGrid ones can generally be ignored, yes. We realize they are very annoying and clutter up the output, which is why we make every effort to fix these based on individual cases.

The other ones you pointed out may be an issue though, but those have to do with your custom bindings.


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.