hi... i am using xamdatagrid in my project and strange exception is raised. Actually in my project i am using 2 usercontrols and in first usrcontrol i have two grid. Select first grid will populate in second grid. Then i will press next button in that second usercontrol 3 grid will populate.i have back button in 2 usercontrol.If i press that button 1 usercontrol is coming with an exception as "'selectorArrow_Active' name cannot be found in the name scope of 'System.Windows.Controls.ControlTemplate'." i was looking in ur forum and they are saying to remove this seletor arrow. How to remove that. plz help to solve this problem. i am sending exception report in notepad.plz verify it.
Hello,
Thank you for your post. I have been looking into it and one possible reason for getting this exception is if you copied the default Style for the RecordSelector and removed a Path called “selectorArrow_Active” which is used in one of the defined animations. Please let me know if this helps you, if not could you please provide me with an isolated sample project where this is reproduced, so I can investigate it further for you.
Looking forward for your reply.
hi stefan... i am not using default style and i mausing metro theme in my xamdatagrid and using some my custom style in my xamdatagrid.... which is given below...
<Style TargetType="{x:Type igDP:DataRecordCellArea}"> <!--<Setter Property="OverridesDefaultStyle" Value="True" Background="#FF535353" />--> <Setter Property="BackgroundSelected" Value="#FFA3A3A3"/> <Setter Property="BackgroundActive" Value="#FFA3A3A3"/> <Setter Property="BackgroundHover" Value="#FFA3A3A3"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:DataRecordCellArea}"> <ControlTemplate.Resources> <Storyboard x:Key="timelineIsActive"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Active" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/> </DoubleAnimationUsingKeyFrames> </Storyboard> <Storyboard x:Key="timelineIsActive_off"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Active" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/> </DoubleAnimationUsingKeyFrames> </Storyboard> <Storyboard x:Key="timelineIsSelected"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Selected" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/> </DoubleAnimationUsingKeyFrames> </Storyboard> <Storyboard x:Key="timelineIsSelected_off"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Selected" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/> </DoubleAnimationUsingKeyFrames> </Storyboard> <Storyboard x:Key="timelineHover"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Hover" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/> </DoubleAnimationUsingKeyFrames> </Storyboard> <Storyboard x:Key="timelineHover_off"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Hover" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </ControlTemplate.Resources> <Controls:CardPanel>
<!-- Background --> <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" CornerRadius="{TemplateBinding CornerRadius}"/>
<!-- Background Alternate --> <Border x:Name="Alternate" Visibility="Collapsed" Background="{TemplateBinding BackgroundAlternate}" BorderBrush="{TemplateBinding BorderAlternateBrush}" BorderThickness="0" CornerRadius="{TemplateBinding CornerRadius}" Opacity="1"/>
<!-- Background Selected --> <Border x:Name="Selected" Visibility="Visible" Background="{TemplateBinding BackgroundSelected}" BorderBrush="Transparent" BorderThickness="0" CornerRadius="{TemplateBinding CornerRadius}" Opacity="0"/>
<!-- Background Hover --> <Border x:Name="Hover" Visibility="Visible" Background="#FF444444" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="Transparent" BorderThickness="0" Opacity="0"/>
<!-- Background Active --> <Border x:Name="Active" Visibility="Collapsed" Background="{TemplateBinding BackgroundActive}" BorderBrush="Transparent" BorderThickness="0" CornerRadius="{TemplateBinding CornerRadius}"/>
<ContentPresenter x:Name="CellContent" Style="{TemplateBinding ForegroundStyle}" Content="{TemplateBinding Content}"/> </Controls:CardPanel> <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsAlternate" Value="True"/> <Condition Property="IsFilterRecord" Value="False"/> <Condition Property="IsAddRecord" Value="False"/> </MultiTrigger.Conditions> <Setter TargetName="Alternate" Property="Visibility" Value="Visible"/> <Setter TargetName="CellContent" Property="Style" Value="{Binding Path=ForegroundAlternateStyle, RelativeSource={RelativeSource TemplatedParent}}"/> </MultiTrigger>
<MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsActive" Value="True"/> <Condition Property="IsFilterRecord" Value="False"/> </MultiTrigger.Conditions> <Setter TargetName="CellContent" Property="Style" Value="{Binding Path=ForegroundActiveStyle, RelativeSource={RelativeSource TemplatedParent}}"/> <Setter Property="Visibility" TargetName="Active" Value="Visible"/> </MultiTrigger>
<EventTrigger RoutedEvent="igDP:DataRecordCellArea.HoverBegin"> <EventTrigger.Actions> <BeginStoryboard Storyboard="{StaticResource timelineHover}"/> </EventTrigger.Actions> </EventTrigger>
<EventTrigger RoutedEvent="igDP:DataRecordCellArea.HoverEnd"> <EventTrigger.Actions> <BeginStoryboard Storyboard="{StaticResource timelineHover_off}"/> </EventTrigger.Actions> </EventTrigger>
<EventTrigger RoutedEvent="igDP:DataRecordCellArea.Selected"> <EventTrigger.Actions> <BeginStoryboard Storyboard="{StaticResource timelineIsSelected}"/> </EventTrigger.Actions> </EventTrigger>
<EventTrigger RoutedEvent="igDP:DataRecordCellArea.Deselected"> <EventTrigger.Actions> <BeginStoryboard Storyboard="{StaticResource timelineIsSelected_off}"/> </EventTrigger.Actions> </EventTrigger>
<Trigger Property="IsFilterRecord" Value="True"> <Setter Property="Visibility" TargetName="Hover" Value="Collapsed"/> <Setter Property="Visibility" TargetName="Selected" Value="Collapsed"/> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="BackgroundSelected" Value="#FFF78A09"/> <Setter Property="BorderThickness" Value="0" /> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="BorderThickness" Value="0" /> <Setter Property="BorderSelectedBrush" Value="Transparent" /> <Setter Property="BorderActiveBrush" Value="Transparent" /> <Setter Property="BorderPrimaryBrush" Value="Transparent" /> <Setter Property="BorderFieldSelectedBrush" Value="Transparent" /> </Trigger>
<!-- <Trigger Property="SortStatus" Value="Ascending"> <Setter Property="Background" Value="Orange"/> </Trigger> <Trigger Property="SortStatus" Value="Descending"> <Setter Property="Background" Value="Yellow"/> </Trigger>--> </Style.Triggers> </Style>
<Style TargetType="{x:Type Controls:ExpanderBar}"> <!--<Setter Property="Background" Value="#FFF78A09"/>--> <Setter Property="Background" Value="#FF444444"/> <Style.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter Property="Background" Value="#FF444444" /> </Trigger> </Style.Triggers> </Style>
<Style TargetType="{x:Type igDP:DataRecordPresenter}"> <Setter Property="HeaderAreaBackground" Value="#FF333333" /> </Style>
<Style TargetType="{x:Type igDP:LabelPresenter}"> <Setter Property="Background" Value="#FF4A4A4A" /> <Setter Property="Foreground" Value="#FFAFAFAF" /> <Setter Property="Margin" Value="-10,0,0,0" /> <Setter Property="FontSize" Value="16" /> <Style.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter Property="LabelHighlight" Value="#FF4A4A4A" /> </Trigger> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="LabelHighlight" Value="#FF4A4A4A" /> </Trigger> </Style.Triggers> </Style>
<Style TargetType="{x:Type igDP:FilterCellValuePresenter}"> <Style.Triggers> <Trigger Property="HasActiveFilters" Value="True"> <Setter Property="Background" Value="#FFA3A3A3" /> </Trigger> </Style.Triggers> </Style>
<Style TargetType="{x:Type igDP:FilterButton}"> <Style.Triggers> <Trigger Property="HasActiveFilters" Value="True"> <Setter Property="Background" Value="#FFA3A3A3" /> </Trigger> </Style.Triggers> </Style>
In this i am not using any selectorArrow... If by default i am using default style how can i access it and remove that selective arrow animation storyboard....
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Hi... thanks it is working fine but what the style i have added in Grid.resources will differ in xamdatagrid.resources. Actually i have added new post regarding this.I am sending the png file so that plz solve by solving this.... i am added style also what i have added in grid.resources.
<Grid.Resources><Style TargetType="{x:Type igDP:DataRecordCellArea}"><Setter Property="BackgroundSelected" Value="#44F78A09"/><Setter Property="BackgroundActive" Value="#44F78A09"/><Setter Property="BackgroundHover" Value="#44F78A09"/><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type igDP:DataRecordCellArea}"><ControlTemplate.Resources><Storyboard x:Key="timelineIsActive"><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Active" Storyboard.TargetProperty="(UIElement.Opacity)"><SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/></DoubleAnimationUsingKeyFrames></Storyboard><Storyboard x:Key="timelineIsActive_off"><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Active" Storyboard.TargetProperty="(UIElement.Opacity)"><SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/></DoubleAnimationUsingKeyFrames></Storyboard><Storyboard x:Key="timelineIsSelected"><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Selected" Storyboard.TargetProperty="(UIElement.Opacity)"><SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/></DoubleAnimationUsingKeyFrames></Storyboard><Storyboard x:Key="timelineIsSelected_off"><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Selected"Storyboard.TargetProperty="(UIElement.Opacity)"><SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/></DoubleAnimationUsingKeyFrames></Storyboard><Storyboard x:Key="timelineHover"><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Hover" Storyboard.TargetProperty="(UIElement.Opacity)"><SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/></DoubleAnimationUsingKeyFrames></Storyboard><Storyboard x:Key="timelineHover_off"><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Hover" Storyboard.TargetProperty="(UIElement.Opacity)"><SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="0"/></DoubleAnimationUsingKeyFrames></Storyboard></ControlTemplate.Resources><Controls:CardPanel>
<!-- Background --><Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"BorderThickness="0" CornerRadius="{TemplateBinding CornerRadius}"/>
<!-- Background Alternate --><Border x:Name="Alternate" Visibility="Collapsed" Background="{TemplateBinding BackgroundAlternate}"BorderBrush="{TemplateBinding BorderAlternateBrush}"BorderThickness="0"CornerRadius="{TemplateBinding CornerRadius}"Opacity="1"/>
<!-- Background Selected --><Border x:Name="Selected"Visibility="Visible"Background="{TemplateBinding BackgroundSelected}"BorderBrush="Transparent"BorderThickness="0"CornerRadius="{TemplateBinding CornerRadius}"Opacity="0"/>
<!-- Background Hover --><Border x:Name="Hover"Visibility="Visible"Background="#FF444444"CornerRadius="{TemplateBinding CornerRadius}"BorderBrush="Transparent"BorderThickness="0"Opacity="0"/>
<!-- Background Active --><Border x:Name="Active"Visibility="Collapsed"Background="{TemplateBinding BackgroundActive}"BorderBrush="Transparent"BorderThickness="0"CornerRadius="{TemplateBinding CornerRadius}"/>
<ContentPresenter x:Name="CellContent" Style="{TemplateBinding ForegroundStyle}" Content="{TemplateBinding Content}"/></Controls:CardPanel><ControlTemplate.Triggers><MultiTrigger><MultiTrigger.Conditions><Condition Property="IsAlternate" Value="True"/><Condition Property="IsFilterRecord" Value="False"/><Condition Property="IsAddRecord" Value="False"/></MultiTrigger.Conditions><Setter TargetName="Alternate" Property="Visibility" Value="Visible"/><Setter TargetName="CellContent" Property="Style"Value="{Binding Path=ForegroundAlternateStyle, RelativeSource={RelativeSource TemplatedParent}}"/></MultiTrigger>
<MultiTrigger><MultiTrigger.Conditions><Condition Property="IsActive" Value="True"/><Condition Property="IsFilterRecord" Value="False"/></MultiTrigger.Conditions><Setter TargetName="CellContent" Property="Style" Value="{Binding Path=ForegroundActiveStyle, RelativeSource={RelativeSource TemplatedParent}}"/><Setter Property="Visibility" TargetName="Active" Value="Visible"/></MultiTrigger>
<EventTrigger RoutedEvent="igDP:DataRecordCellArea.HoverBegin"><EventTrigger.Actions><BeginStoryboard Storyboard="{StaticResource timelineHover}"/></EventTrigger.Actions></EventTrigger>
<EventTrigger RoutedEvent="igDP:DataRecordCellArea.HoverEnd"><EventTrigger.Actions><BeginStoryboard Storyboard="{StaticResource timelineHover_off}"/></EventTrigger.Actions></EventTrigger>
<EventTrigger RoutedEvent="igDP:DataRecordCellArea.Selected"><EventTrigger.Actions><BeginStoryboard Storyboard="{StaticResource timelineIsSelected}"/></EventTrigger.Actions></EventTrigger>
<EventTrigger RoutedEvent="igDP:DataRecordCellArea.Deselected"><EventTrigger.Actions><BeginStoryboard Storyboard="{StaticResource timelineIsSelected_off}"/></EventTrigger.Actions></EventTrigger>
<Trigger Property="IsFilterRecord" Value="True"><Setter Property="Visibility" TargetName="Hover" Value="Collapsed"/><Setter Property="Visibility" TargetName="Selected" Value="Collapsed"/></Trigger>
</ControlTemplate.Triggers></ControlTemplate></Setter.Value></Setter></Style>
<Style TargetType="{x:Type igDP:CellValuePresenter}"><Setter Property="BackgroundSelected" Value="#FFF78A09"/><Setter Property="BorderThickness" Value="0" /><Style.Triggers><Trigger Property="IsSelected" Value="True"><Setter Property="BorderThickness" Value="0" /><Setter Property="BorderSelectedBrush" Value="Transparent" /><Setter Property="BorderActiveBrush" Value="Transparent" /><Setter Property="BorderPrimaryBrush" Value="Transparent" /><Setter Property="BorderFieldSelectedBrush" Value="Transparent" /></Trigger></Style.Triggers></Style>
<!-- <Style TargetType="{x:Type Controls:ExpanderBar}"><Setter Property="Background" Value="#FF444444"/><Style.Triggers><Trigger Property="IsPressed" Value="True"><Setter Property="Background" Value="#FF444444" /></Trigger></Style.Triggers></Style>-->
<Style TargetType="{x:Type igDP:DataRecordPresenter}"><Setter Property="BorderBrush" Value="#FF333333"/><Setter Property="HeaderAreaBackground" Value="#FF333333" /><Setter Property="BorderThickness" Value="1"/></Style>
<Style TargetType="{x:Type igDP:LabelPresenter}"><Setter Property="Background" Value="#FF4A4A4A" /><Setter Property="Foreground" Value="#FFAFAFAF" /><Setter Property="Margin" Value="0,0,0,0" /><Setter Property="FontSize" Value="16" /><Style.Triggers><Trigger Property="IsPressed" Value="True"><Setter Property="LabelHighlight" Value="#FF4A4A4A" /></Trigger><Trigger Property="IsMouseOver" Value="True"><Setter Property="LabelHighlight" Value="#FF4A4A4A" /></Trigger></Style.Triggers></Style>
<Style TargetType="{x:Type igDP:FilterCellValuePresenter}"><Style.Triggers><Trigger Property="HasActiveFilters" Value="True"><Setter Property="Background" Value="#FFA3A3A3" /></Trigger></Style.Triggers></Style>
<Style TargetType="{x:Type igDP:FilterButton}"><Style.Triggers><Trigger Property="HasActiveFilters" Value="True"><Setter Property="Background" Value="#FFA3A3A3" /></Trigger></Style.Triggers></Style>
</Grid.Resources>
I can suggest you see this blog from Andrew Smith:
http://ko.infragistics.com/community/blogs/andrew_smith/archive/2009/12/09/common-style-issues-when-using-the-theme-property.aspx
which explains in details how to use both Styles and Themes.
Hope this helps you.