Hi... i am using xamdatagrid in my project and i have define my own style.I have added style in usercontrol.resources instead of xamdatagrid.resources. Some borber lines are coming and its not nice... So, plz help me to solve this proble.i am sending an attached file and in that header border line should eliminate and when i make filter on fields filter icon should change color to red.
This is the style i am adding for xamdatagrid....
<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>
Hello,
Thank you for your post I have been looking into it and I created a sample project using your Styles with modifications, so now everything looks as you want. Basically I copied the default Style for the LabelPresenter, because there are Borders which BorderBrush should be set. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
I have created a sample project for you showing you how to style the HeaderCellControl and the CellControl elements. You can use the sample as a base for any further customization that you want to make.
Hope this helps you.
Thanks a lot... But can Column1 can come down (come under) column 0? This is my actual requirement.Because i am displaying 20 columns with pagenumber... Is it possible to come like column 0 should be top and column 1 bottom.Two rows style.
Hello again,
Currently only the XamDataGrid supports two rows style for the headers, so if you want I can log a product idea for such functionality in the XamGrid.
s.... please do it...
I have sent your Product Idea (Columns in multiple rows) directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI13030123
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com