I just added a style to my app (in appStyles.xaml) to hide the gridview distinct filter. The style is working but in design view of pages & windows i get the following errors:
This is what the resource declarations in the appStyles.xaml are:
Here's how i'm the style for the FilteringControl:
Here's from a window:
Not sure if i need to qualify the FilteringControl style with something or add another xmlns reference to the styles. Thanks
This is what the resource declarations in the appStyles.xaml are:
<
ResourceDictionary
xmlns
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<br> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"<
br
> xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"<
br
> xmlns:Telerik_Windows_Controls_MaskedTextBox="clr-namespace:Telerik.Windows.Controls.MaskedTextBox;assembly=Telerik.Windows.Controls.Input" >
Here's how i'm the style for the FilteringControl:
<
Style
TargetType
=
"{x:Type telerik:FilteringControl}"
><
br
> <
Setter
Property
=
"Template"
><
br
> <
Setter.Value
><
br
> <
ControlTemplate
TargetType
=
"{x:Type telerik:FilteringControl}"
><
br
> <
Border
BorderBrush
=
"{TemplateBinding BorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
CornerRadius
=
"1"
Margin
=
"{TemplateBinding Margin}"
><
br
> <
Border
BorderBrush
=
"White"
BorderThickness
=
"1"
Background
=
"{TemplateBinding Background}"
><
br
> <
Grid
><
br
> <
StackPanel
HorizontalAlignment
=
"{TemplateBinding HorizontalContentAlignment}"
MaxWidth
=
"350"
Margin
=
"{TemplateBinding Padding}"
MinWidth
=
"200"
VerticalAlignment
=
"{TemplateBinding VerticalContentAlignment}"
><
br
> <
StackPanel
x:Name
=
"PART_DistinctFilter"
Visibility
=
"{TemplateBinding DistinctFiltersVisibility}"
><
br
> <
CheckBox
x:Name
=
"PART_SelectAllCheckBox"
Visibility
=
"Collapsed"
Content
=
"Select All"
IsChecked
=
"{Binding SelectAll, Mode=TwoWay}"
Margin
=
"0,2"
telerik:LocalizationManager.ResourceKey
=
"GridViewFilterSelectAll"
><
br
> <
telerik:StyleManager.Theme
><
br
> <
telerik:MetroTheme
/><
br
> </
telerik:StyleManager.Theme
><
br
> </
CheckBox
><
br
> <
ListBox
x:Name
=
"PART_DistinctValuesList"
ItemsSource
=
"{Binding DistinctValues}"
ScrollViewer.HorizontalScrollBarVisibility
=
"Auto"
<br> MaxHeight="100" SelectionMode="Multiple" Visibility="Collapsed" ><
br
> <
ListBox.ItemTemplate
><
br
> <
DataTemplate
><
br
> <
CheckBox
Content
=
"{Binding ConvertedValue}"
IsChecked
=
"{Binding IsActive, Mode=TwoWay}"
VerticalContentAlignment
=
"Center"
><
br
> <
telerik:StyleManager.Theme
><
br
> <
telerik:MetroTheme
/><
br
> </
telerik:StyleManager.Theme
><
br
> </
CheckBox
><
br
> </
DataTemplate
><
br
> </
ListBox.ItemTemplate
><
br
> <
telerik:StyleManager.Theme
><
br
> <
telerik:MetroTheme
/><
br
> </
telerik:StyleManager.Theme
><
br
> </
ListBox
><
br
> </
StackPanel
><
br
> <
StackPanel
Margin
=
"0,2"
Visibility
=
"{TemplateBinding FieldFiltersVisibility}"
><
br
> <
TextBlock
Margin
=
"0,2,0,0"
telerik:LocalizationManager.ResourceKey
=
"GridViewFilterShowRowsWithValueThat"
Text
=
"Show rows with value that"
></
TextBlock
><
br
> <
telerik:RadComboBox
x:Name
=
"PART_Filter1ComboBox"
ItemsSource
=
"{Binding AvailableActions}"
SelectedItem
=
"{Binding Filter1.Operator, Mode=TwoWay}"
Margin
=
"0,2"
><
br
> <
telerik:RadComboBox.ItemTemplate
><
br
> <
DataTemplate
><
br
> <
TextBlock
><
br
> <
TextBlock.Text
><
br
> <
Binding
><
br
> <
Binding.Converter
><
br
> <
telerik:FilterOperatorConverter
/><
br
> </
Binding.Converter
><
br
> </
Binding
><
br
> </
TextBlock.Text
><
br
> </
TextBlock
><
br
> </
DataTemplate
><
br
> </
telerik:RadComboBox.ItemTemplate
><
br
> <
telerik:StyleManager.Theme
><
br
> <
telerik:MetroTheme
/><
br
> </
telerik:StyleManager.Theme
><
br
> </
telerik:RadComboBox
><
br
> <
ContentControl
x:Name
=
"PART_Filter1ContentControl"
DataContext
=
"{Binding Filter1}"
HorizontalContentAlignment
=
"Stretch"
Margin
=
"0,2"
VerticalContentAlignment
=
"Stretch"
/><
br
> <
telerik:RadComboBox
x:Name
=
"PART_LogicalOperatorsComboBox"
ItemsSource
=
"{Binding LogicalOperators}"
SelectedItem
=
"{Binding FieldFilterLogicalOperator, Mode=TwoWay}"
Margin
=
"0,2"
><
br
> <
telerik:RadComboBox.ItemTemplate
><
br
> <
DataTemplate
><
br
> <
TextBlock
><
br
> <
TextBlock.Text
><
br
> <
Binding
><
br
> <
Binding.Converter
><
br
> <
telerik:FilterCompositionLogicalOperatorConverter
/><
br
> </
Binding.Converter
><
br
> </
Binding
><
br
> </
TextBlock.Text
><
br
> </
TextBlock
><
br
> </
DataTemplate
><
br
> </
telerik:RadComboBox.ItemTemplate
><
br
> <
telerik:StyleManager.Theme
><
br
> <
telerik:MetroTheme
/><
br
> </
telerik:StyleManager.Theme
><
br
> </
telerik:RadComboBox
><
br
> <
telerik:RadComboBox
x:Name
=
"PART_Filter2ComboBox"
ItemsSource
=
"{Binding AvailableActions}"
SelectedItem
=
"{Binding Filter2.Operator, Mode=TwoWay}"
Margin
=
"0,2"
><
br
> <
telerik:RadComboBox.ItemTemplate
><
br
> <
DataTemplate
><
br
> <
TextBlock
><
br
> <
TextBlock.Text
><
br
> <
Binding
><
br
> <
Binding.Converter
><
br
> <
telerik:FilterOperatorConverter
/><
br
> </
Binding.Converter
><
br
> </
Binding
><
br
> </
TextBlock.Text
><
br
> </
TextBlock
><
br
> </
DataTemplate
><
br
> </
telerik:RadComboBox.ItemTemplate
><
br
> <
telerik:StyleManager.Theme
><
br
> <
telerik:MetroTheme
/><
br
> </
telerik:StyleManager.Theme
><
br
> </
telerik:RadComboBox
><
br
> <
ContentControl
x:Name
=
"PART_Filter2ContentControl"
DataContext
=
"{Binding Filter2}"
HorizontalContentAlignment
=
"Stretch"
Margin
=
"0,2"
VerticalContentAlignment
=
"Stretch"
/><
br
> </
StackPanel
><
br
> <
Grid
><
br
> <
Grid.ColumnDefinitions
><
br
> <
ColumnDefinition
/><
br
> <
ColumnDefinition
/><
br
> </
Grid.ColumnDefinitions
><
br
> <
Button
x:Name
=
"PART_ApplyFilterButton"
Content
=
"Filter"
Grid.Column
=
"0"
Height
=
"22"
Margin
=
"0,2,2,2"
telerik:LocalizationManager.ResourceKey
=
"GridViewFilter"
><
br
> <
telerik:StyleManager.Theme
><
br
> <
telerik:MetroTheme
/><
br
> </
telerik:StyleManager.Theme
><
br
> </
Button
><
br
> <
Button
x:Name
=
"PART_ClearFilterButton"
Content
=
"Clear Filter"
Grid.Column
=
"1"
Height
=
"22"
Margin
=
"2,2,0,2"
telerik:LocalizationManager.ResourceKey
=
"GridViewClearFilter"
><
br
> <
telerik:StyleManager.Theme
><
br
> <
telerik:MetroTheme
/><
br
> </
telerik:StyleManager.Theme
><
br
> </
Button
><
br
> </
Grid
><
br
> </
StackPanel
><
br
> <
telerik:RadButton
x:Name
=
"PART_FilterCloseButton"
HorizontalAlignment
=
"Right"
Height
=
"13"
Margin
=
"{TemplateBinding Padding}"
VerticalAlignment
=
"Top"
Width
=
"13"
><
br
> <
telerik:StyleManager.Theme
><
br
> <
telerik:MetroTheme
/><
br
> </
telerik:StyleManager.Theme
><
br
> <
Path
Data
=
"M4,4L5,4 5,5 4,5z M0,4L1,4 1,5 0,5z M3,3L4,3 4,4 3,4z M1,3L2,3 2,4 1,4z M2,2L3,2 3,3 2,3z M4,0L5,0 5,1 4,1 4,2 3,2 3,0.99999994 4,0.99999994z M0,0L1,0 1,0.99999994 2,0.99999994 2,2 1,2 1,1 0,1z"
Fill
=
"Black"
HorizontalAlignment
=
"{TemplateBinding HorizontalContentAlignment}"
Height
=
"6"
VerticalAlignment
=
"{TemplateBinding VerticalContentAlignment}"
Width
=
"6"
/><
br
> </
telerik:RadButton
><
br
> </
Grid
><
br
> </
Border
><
br
> </
Border
><
br
> </
ControlTemplate
><
br
> </
Setter.Value
><
br
> </
Setter
><
br
> <
Setter
Property
=
"Background"
Value
=
"#FFE4E4E4"
/><
br
> <
Setter
Property
=
"BorderBrush"
Value
=
"#FF848484"
/><
br
> <
Setter
Property
=
"Padding"
Value
=
"5"
/><
br
> <
Setter
Property
=
"Margin"
Value
=
"0,2,0,0"
/><
br
> <
Setter
Property
=
"BorderThickness"
Value
=
"1"
/><
br
> <
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Stretch"
/><
br
> <
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Stretch"
/><
br
> <
Setter
Property
=
"Foreground"
Value
=
"Black"
/><
br
> <
Setter
Property
=
"SnapsToDevicePixels"
Value
=
"True"
/><
br
> </
Style
>
Here's from a window:
<
Window
x:Class
=
"RawDataView"
<br> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<
br
> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<
br
> Title="Raw Data View" Height="437" Width="658" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" WindowStartupLocation="CenterOwner"><
br
><
br
> <
Window.Resources
><
br
> <
ResourceDictionary
><
br
>
<!--Set this here due to Telerik bug, so header cell and row colors match-->
<
br
> <
Style
x:Key
=
"headerRow"
TargetType
=
"telerik:GridViewHeaderRow"
><
br
> <
Setter
Property
=
"Background"
Value
=
"#FFF5F5FD"
/><
br
> </
Style
><
br
>
<!-- Import our app styles -->
<
br
> <
ResourceDictionary.MergedDictionaries
><
br
> <
ResourceDictionary
Source
=
"/app.Styles.xaml"
/><
br
> </
ResourceDictionary.MergedDictionaries
><
br
> </
ResourceDictionary
><
br
> </
Window.Resources
>
Not sure if i need to qualify the FilteringControl style with something or add another xmlns reference to the styles. Thanks