Telerik Forums
UI for WPF Forum
3 answers
149 views
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

<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> 
 

Atanas
Telerik team
 answered on 22 Oct 2008
1 answer
68 views
I have an issue where when I try to declare a Grouping for my grid using XAML, the designer in VS2008 breaks.

When trying to group on Subject.Name of the DataBound object I get the following error in the designer.

"Subject.Name is neither a DataColumn nor a DataRelation for table Customers." This is more interesting because I'm not referencing anything anywhere called "Customers".

Regards

Justin Taylor
Atanas
Telerik team
 answered on 21 Oct 2008
1 answer
125 views
Hi,

Thanks for giving answers.

 1).  By your code iam able to change the headerstyles perfectly to Parent but,
        I need to change at a single time for child also.I  may use single or double 
       RadGridView.

2). How to change the Scrollbar color.

3). Which you have given steps to Ticket , There are few options are iam unable
      to find.
4) I want to hide GroupPanel for child and Display for Parent.

Plz help me........As soon as.

Atanas
Telerik team
 answered on 21 Oct 2008
4 answers
371 views
Hi team ,

Please as soon as possible send me by tomorrow morning.


i need on Single click cell should be in edit  mode.currently when we double click we are getting cell in edit mode


Thank you.
Atanas
Telerik team
 answered on 20 Oct 2008
1 answer
168 views
Hi All,

Iam using RAD Grid for WPF,

Current i am having a problem with handling validation from BO

How can we use "ValueToDisplayTextConverter"...

How can i call BO Validatio for RAD Grid ?

Can any one help me in this ?

With Regards
Krishna M
Atanas
Telerik team
 answered on 20 Oct 2008
2 answers
438 views
Greetings,
  I have run into an issue when changing the GridViewRow background color.  I have changed the background color based on IsAlternating in the example below: (Note that VerticalGridLinesVisibility is set to True)
<Window.Resources> 
        <Style TargetType="{x:Type telerik:GridViewRow}" > 
            <Style.Triggers> 
                <DataTrigger Binding="{Binding IsAlternating}" Value="False"
                    <DataTrigger.Setters> 
                        <Setter Property="Background" Value="#ABD5F3" /> 
                    </DataTrigger.Setters> 
                </DataTrigger> 
                <DataTrigger Binding="{Binding IsAlternating}" Value="True"
                    <DataTrigger.Setters> 
                        <Setter Property="Background" Value="#CAEEFE" /> 
                    </DataTrigger.Setters> 
                </DataTrigger> 
            </Style.Triggers> 
        </Style> 
    </Window.Resources> 
    <Grid> 
        <telerik:RadGridView Name="radGridViewStyleSimpleTheme" VerticalGridlinesVisibility="Visible"
            <telerik:Theming.Theme> 
                <simple:SimpleTheme /> 
            </telerik:Theming.Theme> 
        </telerik:RadGridView> 
    </Grid> 

In this example the grid will not show vertical lines with in the rows.  I'm guessing this is due to how the controls are layered and the control (Border?) that serves as the row background is overlaying the base grid structure and hiding the grid lines.

I was going to attempt to just change the cell colors themselves based on whether or not they were in an alternating row, however I haven't found a way to accomplish that. I have been unable to find a way to tell if the cell is in an alternating row.

Is there tweak I can make to the control templates to allow grid lines to show in this scenario?

Thanks,
  Chris
Christopher
Top achievements
Rank 1
 answered on 17 Oct 2008
1 answer
127 views
Hi

I have created a windows user control (non wpf) which comprises of :- the WPF RadGridView control hosted in a ElementHost.

When adding a my user control to a controls collection at runtine I get the following error:-

Failed object initialization (ISupportInitialize.EndInit). The result of a query cannot be enumerated more than once.  Error at object 'Telerik.Windows.Controls.GridView.GridViewItemsControl' in markup file 'Telerik.Windows.Controls.GridView;;;Component/Themes/GridView/Telerik/TableView.Templates.xaml'.

any Ideas?

P
Dimitar Dobrev
Telerik team
 answered on 17 Oct 2008
1 answer
113 views
Hi All,

I am using RAD Grid for WPF...

I am trying to change only "Header Style" i.e. changing the font size, fontFamily, fontStyle..

Can any one help me it this...

With Regards
Krishna M
Dimitar Dobrev
Telerik team
 answered on 17 Oct 2008
7 answers
184 views
Hi,
         I am using RadGrid for WPF.My requirement is to show the Cursor in the first cell of Newly Inserted Record.
Can anybody suggest a way to do this ?

Regards,
Krishna
Dimitar Dobrev
Telerik team
 answered on 17 Oct 2008
2 answers
240 views
Greetings,
   I am attempting to do some custom styling based on the Simple theme.  I looked over the example provided on this post (http://www.telerik.com/community/forums/thread/b311D-bkeeck.aspx) however it does not work with the latest builds of the WPF gridview control.

Specifically I am having trouble styling the GridViewHeaderRow (or GridViewHeaderCell) and the row selectors (I haven't found the object name for these yet).

The following is a small piece of code from the styling: (Note the dark blue is for testing purposes, end goal is a gradient brush)
<Window x:Class="radGridStyling.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:radGrid="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:Simple="clr-namespace:Telerik.Windows.Controls.Simple;assembly=Telerik.Windows.Controls.Simple" 
    Title="Window1" Height="401" Width="654" > 
    <Window.Resources> 
        <Style TargetType="{x:Type radGrid:GridViewRow}" > 
            <Style.Triggers> 
                <DataTrigger Binding="{Binding IsAlternating}" Value="False"
                    <DataTrigger.Setters> 
                        <Setter Property="Background" Value="#ABD5F3" /> 
                    </DataTrigger.Setters> 
                </DataTrigger> 
                <DataTrigger Binding="{Binding IsAlternating}" Value="True"
                    <DataTrigger.Setters> 
                        <Setter Property="Background" Value="#CAEEFE" /> 
                    </DataTrigger.Setters> 
                </DataTrigger> 
            </Style.Triggers> 
        </Style> 
 
        <Style TargetType="{x:Type radGrid:GridViewHeaderRow}" > 
            <Setter Property="Background" Value="DarkBlue" /> 
        </Style> 
 
        <Style TargetType="{x:Type radGrid:GridViewHeaderCell}" > 
            <Setter Property="Background" Value="DarkBlue" /> 
        </Style> 
 
    </Window.Resources> 
     
    <Grid> 
        <radGrid:RadGridView Margin="26,22,79,43" Name="radGridView1" > 
            <radGrid:Theming.Theme> 
                <Simple:SimpleTheme/> 
            </radGrid:Theming.Theme> 
        </radGrid:RadGridView> 
    </Grid> 
</Window> 
 

In the example above, the GridViewRow style changes work as expected. However the GridViewHeaderRow and GridViewHeaderCell styles have no impact.

Any guidance would be greatly appreciated!

Thanks,
  Chris
Christopher
Top achievements
Rank 1
 answered on 16 Oct 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?