Hi all,
I am trying to change the controltemplate for the DistinctFilterControl of each column in a grid (we need to change the colors to match our corporate colors). I used Expression Blend to grab a copy of the template, and started modifying the colors from there. I got the colors changed, but now the actual filter mechanism doesn't work - the dropdown of distinct values has no items listed. I didn't change the binding of the CheckBoxList (on line 116 of the template, below) at all... how do I fix this?
Thanks,
-Doug
I am trying to change the controltemplate for the DistinctFilterControl of each column in a grid (we need to change the colors to match our corporate colors). I used Expression Blend to grab a copy of the template, and started modifying the colors from there. I got the colors changed, but now the actual filter mechanism doesn't work - the dropdown of distinct values has no items listed. I didn't change the binding of the CheckBoxList (on line 116 of the template, below) at all... how do I fix this?
Thanks,
-Doug
<ControlTemplate x:Key="DistinctFilterTemplate" TargetType="{x:Type telerik:DistinctFilterControl}"> | |
<StackPanel> | |
<StackPanel.Resources> | |
<BooleanToVisibilityConverter x:Key="booleanConverter"/> | |
</StackPanel.Resources> | |
<telerik:GridViewFilteringDropDown x:Name="PART_Dropdown" VerticalAlignment="Stretch" Width="30" Height="30"> | |
<Border HorizontalAlignment="Stretch" x:Name="border" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Background="#00FFFFFF"> | |
<Grid Width="11" Height="12"> | |
<Path Fill="#FF000000" Stretch="Fill" Width="11" Height="12" SnapsToDevicePixels="True" Data="F1M3.9987,3.9963L15,3.9963 15,4.99479 3.9987,4.99478 3.9987,3.9963z M4.9987,4.99739L14,4.99739 14,5.99609 4.9987,5.99609 4.9987,4.99739z M5.99902,5.99869L13,5.9987 13,7 11.9984,7 11.9984,8.00391 10.999,8.00391 10.999,16.0002 7.99853,16.0002 7.99853,8.00391 6.99772,8.00391 6.99772,7 5.99902,7 5.99902,5.99869z"/> | |
<Path Fill="#FF006699" Stretch="Fill" HorizontalAlignment="Center" Margin="0,1,0,0" VerticalAlignment="Top" Width="5" Height="3" SnapsToDevicePixels="True" Canvas.Left="3" Canvas.Top="1" Data="M7,5L12,5 12,6 7,6 7,5z M8,6L11,6 11,7 8,7 8,6z M9,7L9.99999,7 9.99999,8 9,8 9,7z"> | |
<Path.Visibility> | |
<TemplateBinding Property="HasFilterValues"> | |
<!--NOTE: Visual Studio's XAML renderer currently doesn't parse TemplateBinding.Converter as an attached property, and fails the show the XAML. It will compile and run correctly. --> | |
<TemplateBinding.Converter> | |
<BooleanToVisibilityConverter/> | |
</TemplateBinding.Converter> | |
</TemplateBinding> | |
</Path.Visibility> | |
</Path> | |
</Grid> | |
</Border> | |
</telerik:GridViewFilteringDropDown> | |
<telerik:GridViewFilteringPopup HorizontalAlignment="Left" Margin="0,0,0,0" x:Name="PART_Popup" VerticalAlignment="Top" AllowsTransparency="True" IsOpen="{Binding Path=IsChecked, ElementName=PART_Dropdown, Mode=TwoWay}" Placement="Bottom" StaysOpen="False"> | |
<Border HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="#89006699" BorderThickness="1,0,1,1" CornerRadius="0,0,5,5"> | |
<Border.Background> | |
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> | |
<GradientStop Color="#E5D1EFF9" Offset="0.004"/> | |
<GradientStop Color="#E5ADE0F3" Offset="1"/> | |
</LinearGradientBrush> | |
</Border.Background> | |
<Border BorderBrush="#CC009DD9" BorderThickness="1,0,1,1" CornerRadius="0,0,5,5"> | |
<StackPanel> | |
<telerik:ClearFilterButton Margin="0,0,0,5" Content="Clear Filter" Foreground="#FF000000" FilterDescription="{Binding Path=FilterDescription, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type telerik:DistinctFilterControl}}}" Target="{Binding ElementName=listDistinctValues, Mode=OneTime}"> | |
<telerik:ClearFilterButton.Style> | |
<Style TargetType="{x:Type Button}"> | |
<Setter Property="FocusVisualStyle"> | |
<Setter.Value> | |
<Style> | |
<Setter Property="Control.Template"> | |
<Setter.Value> | |
<ControlTemplate> | |
<Rectangle Stroke="#FF000000" StrokeDashArray="1 2" StrokeThickness="1" Margin="2,2,2,2" SnapsToDevicePixels="True"/> | |
</ControlTemplate> | |
</Setter.Value> | |
</Setter> | |
</Style> | |
</Setter.Value> | |
</Setter> | |
<Setter Property="Background"> | |
<Setter.Value> | |
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0"> | |
<GradientStop Color="#FFF3F3F3" Offset="0"/> | |
<GradientStop Color="#FFEBEBEB" Offset="0.5"/> | |
<GradientStop Color="#FFDDDDDD" Offset="0.5"/> | |
<GradientStop Color="#FFCDCDCD" Offset="1"/> | |
</LinearGradientBrush> | |
</Setter.Value> | |
</Setter> | |
<Setter Property="BorderBrush" Value="#FF707070"/> | |
<Setter Property="BorderThickness" Value="1,1,1,1"/> | |
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> | |
<Setter Property="HorizontalContentAlignment" Value="Center"/> | |
<Setter Property="VerticalContentAlignment" Value="Center"/> | |
<Setter Property="Padding" Value="1,1,1,1"/> | |
<Setter Property="Template"> | |
<Setter.Value> | |
<ControlTemplate TargetType="{x:Type Button}"> | |
<Border x:Name="border1" Background="#FFB3C1DE" BorderBrush="#E59AACD3" BorderThickness="0,1,0,1"> | |
<Border Margin="0,0,0,0" x:Name="border" IsEnabled="True" BorderBrush="#FFFFFFFF" BorderThickness="0,1,0,1"> | |
<Border.Background> | |
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> | |
<GradientStop Color="#7FFFFFFF" Offset="0"/> | |
<GradientStop Color="#33FFFFFF" Offset="1"/> | |
<GradientStop Color="#00FFFFFF" Offset="0.531"/> | |
<GradientStop Color="#33FFFFFF" Offset="0.513"/> | |
</LinearGradientBrush> | |
</Border.Background> | |
<ContentPresenter HorizontalAlignment="Center" Margin="0,2,0,2" x:Name="contentPresenter" VerticalAlignment="Center" Width="Auto" Height="Auto" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" RecognizesAccessKey="True"/> | |
</Border> | |
</Border> | |
<ControlTemplate.Triggers> | |
<Trigger Property="IsPressed" Value="True"> | |
<Setter Property="Background" TargetName="border"> | |
<Setter.Value> | |
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> | |
<GradientStop Color="#7FFFFFFF" Offset="0"/> | |
<GradientStop Color="#33FFFFFF" Offset="1"/> | |
<GradientStop Color="#4CFFFFFF" Offset="0.5"/> | |
<GradientStop Color="#00FFFFFF" Offset="0.504"/> | |
</LinearGradientBrush> | |
</Setter.Value> | |
</Setter> | |
<Setter Property="Background" TargetName="border1" Value="#FF8A9EC6"/> | |
</Trigger> | |
<Trigger Property="IsEnabled" Value="False"> | |
<Setter Property="Foreground" Value="#FFADADAD"/> | |
<Setter Property="Opacity" TargetName="contentPresenter" Value="0.2"/> | |
<Setter Property="Background" TargetName="border"> | |
<Setter.Value> | |
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> | |
<GradientStop Color="#7FFFFFFF" Offset="0"/> | |
<GradientStop Color="#33FFFFFF" Offset="1"/> | |
<GradientStop Color="#00FFFFFF" Offset="0.549"/> | |
<GradientStop Color="#33FFFFFF" Offset="0.527"/> | |
</LinearGradientBrush> | |
</Setter.Value> | |
</Setter> | |
</Trigger> | |
</ControlTemplate.Triggers> | |
</ControlTemplate> | |
</Setter.Value> | |
</Setter> | |
</Style> | |
</telerik:ClearFilterButton.Style> | |
</telerik:ClearFilterButton> | |
<telerik:CheckBoxList HorizontalAlignment="Stretch" MaxHeight="500" x:Name="listDistinctValues" Foreground="#FF000000" FilterDescription="{Binding Path=FilterDescription, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type telerik:DistinctFilterControl}}}"/> | |
</StackPanel> | |
</Border> | |
</Border> | |
</telerik:GridViewFilteringPopup> | |
</StackPanel> | |
</ControlTemplate> | |