Telerik Forums
UI for WPF Forum
2 answers
105 views
Hello,

Are there any plans to include Office 2010 theme for WPF controls?  especially for ribbon controls?
Thanks in advance.

Shawn
Nikolay
Telerik team
 answered on 30 Mar 2011
1 answer
189 views
How can I set it to WindowStartupLocation.CenterOwner when I use RadWindow.Confirm(dialogParameters) to show the dialog?

I tried defining the Owner and the WindowStyle (in which I defined the WindowStartupLocation property to CenterOwner) but it did not work out on my computer.

I did search in Telerik documentation and this forum but did not find any clue. Did I do it correctly or is it a bug already known? How can I get around it?

Thanks in advance,
Stephen

*** Edit

Found the same issue already posted: http://www.telerik.com/community/forums/wpf/window/alert-confirm-multi-monitor-problem.aspx
Dani
Telerik team
 answered on 30 Mar 2011
2 answers
82 views
Hi,

I have a tree view control and in the data template of some of the nodes I have a text box to allow editing of internal settings. This works perfectly except for in two respects,

1) if you try and select text within the text box with the mouse it starts a drag of the tree item. I would like a way to have the tree ignore the drag when the text box is the clicked on control.. If I return handled from the PreviewDragStarted event then the selection of text works correctly but I am unsure of a way to distinguish at this point where the original click occurred

2) where I have more than one textbox in a data template I would like clicking 'tab' to move me to the next textbox, not the tree control itself/next control on page. I have played with the KeyboardNavigation.TabNavigation settings but not found anything that worked..

any thoughts appreciated.
Petar Mladenov
Telerik team
 answered on 30 Mar 2011
1 answer
80 views
i have a radwindow with this options

<telerik:RadWindow x:Name="windowDetalhesPrevisao"
                           Header="Detalhes do Lançamento da Previsão"
                           Grid.Row="3">

a simple grid with this options

             <telerik:RadWindow.Content>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="35" />
                        <RowDefinition Height="25" />
                        <RowDefinition Height="25" />
                        <RowDefinition />
                    </Grid.RowDefinitions>

and other things ... stackpanel...

finally, a radgridview

<telerik:RadGridView x:Name="GridDadosPrevisao"
                                         Grid.Row="3"
                                         HorizontalAlignment="Left"
                                         AutoGenerateColumns="True"
                                         IsReadOnly="True"
                                         FrozenColumnCount="2"
                                         ShowGroupPanel="False"
                                         CanUserReorderColumns="False"
                                         CanUserResizeColumns="False"
                                         CanUserSortColumns="False"                                                
                                         IsFilteringAllowed="False"
                                         Margin="5">
                    </telerik:RadGridView>

my problem is, this radgrid view dont create the scrollbar Horizontal first time,
but, when i close the window and open again, this radgridview create!

2 links with screenshot

first
http://img840.imageshack.us/i/24050593.jpg/

second
http://img850.imageshack.us/i/25696953.jpg/

see?
when i open the window, scrollbar dont be there and
the radgridview stay "CUT", incomplete.

when i close and open again, scrollbar be there, complete!

why?
what happens?

sorry for english
i am starter with english
i am from brazil!

thx guys!
Yana
Telerik team
 answered on 30 Mar 2011
4 answers
379 views
Hello,

I have a usercontrol with radTabControl + radGridView (version:2011.1.322.40), the code structure like this:

<Grid>
<telerik:RadTabControl>            
<telerik:RadTabItem> <Grid /> </telerik:RadTabItem>
<telerik:RadTabItem> <telerik:RadGridView ItemsSource="{Binding items1}" /> </telerik:RadTabItem>            
<telerik:RadTabItem> <telerik:RadGridView ItemsSource="{Binding items2}" /> </telerik:RadTabItem>            
<telerik:RadTabItem> <telerik:RadGridView ItemsSource="{Binding items3}" /> </telerik:RadTabItem>            
<telerik:RadTabItem> <telerik:RadGridView ItemsSource="{Binding items4}" /> </telerik:RadTabItem>            
</
telerik:RadTabControl>
</Grid>

I use it in MainWindow, like this:

<ContentControl ContentTemplate="{StaticResource DetialsDataTemplate}" 
                Content="{Binding Path=SelectedDetails}" />

The SelectedDetails is a entity returning from EF that support lazyloading.

Start application, it's ok to show first tab. When I click other tab to show gridview, It raise below exception:

System.NullReferenceException: Object reference not set to an instance of an object.

   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.MoveToPosition(GeneratorPosition position, GeneratorDirection direction, Boolean allowStartAtRealizedItem, GeneratorState& state)

   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.Generator..ctor(GridViewItemContainerGenerator factory, GeneratorPosition position, GeneratorDirection direction, Boolean allowStartAtRealizedItem)

   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.StartAt(GeneratorPosition position, GeneratorDirection direction, Boolean allowStartAtRealizedItem)

   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)

   at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)

   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)

   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Border.MeasureOverride(Size constraint)

  at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Control.MeasureOverride(Size constraint)

   at Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Border.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)

   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Border.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)

   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Border.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.Controls.Control.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)

   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.ContextLayoutManager.UpdateLayout()

   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)

   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()

   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()

   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)

   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

I really appreciate for any help.

Yu
Yu
Top achievements
Rank 1
 answered on 30 Mar 2011
9 answers
283 views
Hi there,

is it possible to write something into the RowHeader?
I need to have a grid looking like that in my attachment.

Greetings
Andrew
Top achievements
Rank 1
 answered on 29 Mar 2011
2 answers
200 views
I found what I think might be a bug in the RadComboBox. The standard WPF combobox does not exhibit the problem.

I have a form on which I have a ListBox of 'PlateType' ViewModels. In my form VM I have a SelectedPlateType property bound to the SelectedItem of the ListBox.. This property contains an observable collection of PlateWellLayout view model objects that is bound to the RadComboBox. I also have several RadNumericUpDown fields of the second object bound to properties of the SelectedPlateWellLayout object. When a PlateType is selected in the List box, the contained SelectedPlateWellLayout is set in the SelectedPlateType setter in the form viewmodel, and the RadComboBox reflects this change.

<ListBox x:Name="listPlateTypes" Margin="0,4,0,0" Background="Gainsboro" BorderBrush="Gray"
        BorderThickness="1" Padding="5" ItemsSource="{Binding Path=PlateTypes}"
        SelectedItem="{Binding Path=SelectedPlateType, Mode=TwoWay}"
        ItemTemplate="{StaticResource PlateTypeItemTemplate}">
</ListBox>
 
<tk:RadComboBox Height="30" Width="50"
        ItemsSource="{Binding Path=SelectedPlateType.PlateSubwells}"
        ItemTemplate="{StaticResource SubwellComboBoxTemplate}"
        SelectionBoxTemplate="{StaticResource SelectionBoxTemplate}"
        SelectedItem="{Binding Path=SelectedPlateWellLayout, Mode=TwoWay}" />

The problem is that an exception is thrown when selecting a new PlateType from the list box if any of the numeric up down controls has had a value changed and has the focus (see below).

If I switch back to a normal WPF combo, the problem does not happen.

Here is the exception:

03/28/2011 23:30:27.486 FATAL System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Telerik.Windows.Controls.RadComboBoxAutomationPeer.RaiseSelectionEvents(SelectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\ComboBox\RadComboBoxAutomationPeer.cs:line 173
   at Telerik.Windows.Controls.RadComboBox.OnSelectionChanged(SelectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\ComboBox\RadComboBox.cs:line 1891
   at System.Windows.Controls.Primitives.Selector.InvokeSelectionChanged(List`1 unselectedItems, List`1 selectedItems)
   at System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
   at System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(Object item, Boolean assumeInItemsCollection)
   at System.Windows.Controls.Primitives.Selector.OnSelectedItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
   at System.Windows.Data.BindingExpression.Invalidate(Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)
   at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName)
   at MS.Internal.Data.PropertyPathWorker.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
   at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
   at System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args)
   at GalaSoft.MvvmLight.ViewModelBase.RaisePropertyChanged(String propertyName) in C:\Dev\Products\CrystalMation\Source\CommonComponent\MVVMLight\GalaSoft.MvvmLight\ViewModelBase.cs:line 241
   at CMViewModelBase.FirePropertyChangedEvent(String propertyName) in C:\Dev\Products\CrystalMation\Source\CommonComponent\ViewModelHelper.root\ViewModelHelper\CMViewModelBase.cs:line 92
   at CMViewModelBase.OnPropertyChanged(String propertyName) in C:\Dev\Products\CrystalMation\Source\CommonComponent\ViewModelHelper.root\ViewModelHelper\CMViewModelBase.cs:line 79
   at CM.Imager.ViewModel.PlateTypeEditorViewModel.set_SelectedPlateType(PlateTypeEntityVM value) in C:\Dev\Products\CrystalMation\Source\Application\ImagerViewModel\PlateTypeEditorViewModel.cs:line 101


Please let me know if there is a work-around - I would like to use the RadComboBox if possible.

Version of Telerik being used:
2010.3.1314.35
Chris Boarman
Top achievements
Rank 1
 answered on 29 Mar 2011
2 answers
79 views
I'm storing National Drug Code (NDC) in this format: #####-####-## (eg. 12345-6789-01), but would like to allow users to enter without the hyphens.  I've tried a GridViewMaskedTextBoxColumn, and while that enforces the pattern, the hyphens are omitted.  So I'm wondering which event would be best to intercept the data and insert the hyphens myself?
Wellpartner
Top achievements
Rank 1
 answered on 29 Mar 2011
1 answer
123 views
Hi guys,

I have the following situation.
I have to show in a column image with a text. For that purpose I created datatemplate which consist text + image.

I would like to change default alignment  of hierarchical view. By default we have something like that:

item 1
------item 2
-------------item3

I would like to have the first item in the list (parent) like above and the childrens like below:

item 1
-----------item 2
-----------------------item 3

Would you please provide me with solution how to do it. This is kind of showstopper for us.       

thank you in advance.
Julin
Vanya Pavlova
Telerik team
 answered on 29 Mar 2011
1 answer
626 views
I have created some styles that apply globally to all GridView Controls but the style does not work correctly. It does not have any affect the RowIndicator Column Header nor the Fill Column Header (the header that shows to the right when the columns do not fill the width of the Grid). If, however, I set a key on the style, and then set the Style on an individual GridView, it works like expected.

Here are my global styles and key style.

Global Styles:
<Style TargetType="{x:Type telerik:GridViewHeaderCell}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:GridViewHeaderCell}">
                    <Grid x:Name="PART_HeaderCellGrid">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="GridViewHeaderCell" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2">
                            <Border BorderBrush="#FF98999B" BorderThickness="1" Background="{DynamicResource Office2007Silver}"/>
                        </Border>
                        <Border x:Name="GridViewHeaderCell_Over" BorderBrush="#FFFFC92B" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Opacity="0">
                            <Border BorderBrush="White" BorderThickness="1">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFFFBA3" Offset="1"/>
                                        <GradientStop Color="#FFFFFBDA" Offset="0"/>
                                        <GradientStop Color="#FFFFD25A" Offset="0.43"/>
                                        <GradientStop Color="#FFFEEBAE" Offset="0.42"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                        </Border>
                        <Border x:Name="GridViewHeaderCell_Selected" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" Opacity="0">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF616161" Offset="0"/>
                                    <GradientStop Color="#FF989898" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                            <Border BorderThickness="1">
                                <Border.BorderBrush>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFB69A78"/>
                                        <GradientStop Color="#FFFFE17A" Offset="0.126"/>
                                    </LinearGradientBrush>
                                </Border.BorderBrush>
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFFD74E" Offset="0.996"/>
                                        <GradientStop Color="#FFFFDCAB" Offset="0.17"/>
                                        <GradientStop Color="#FFFFB062" Offset="0.57"/>
                                        <GradientStop Color="#FFFFD18F" Offset="0.56"/>
                                        <GradientStop Color="#FFFFBA74"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                        </Border>
                        <ContentControl x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Foreground="{StaticResource GridBlueBrush}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="{TemplateBinding IsTabStop}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" BorderBrush="{DynamicResource GridBlueBrush}" FontWeight="Bold">
                            <ContentControl.Style>
                                <Style TargetType="{x:Type ContentControl}">
                                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                                </Style>
                            </ContentControl.Style>
                        </ContentControl>
                        <Path x:Name="PART_SortIndicator" Grid.ColumnSpan="2" Data="M0,0L1,0 2,0 3,0 4,0 5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0z" Fill="Black" HorizontalAlignment="Center" Height="3" Margin="0,3,0,0" Opacity="0" RenderTransformOrigin="0.5,0.5" Stretch="Fill" VerticalAlignment="Top" Width="5">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleY="-1" ScaleX="1"/>
                                    <SkewTransform AngleY="0" AngleX="0"/>
                                    <RotateTransform Angle="0"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                        <telerik:FilteringDropDown x:Name="PART_DistinctFilterControl" Grid.Column="1" IsTabStop="False" Margin="0,0,8,0" Visibility="{TemplateBinding FilteringUIVisibility}">
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                        </telerik:FilteringDropDown>
                        <Thumb x:Name="PART_LeftHeaderGripper" Grid.ColumnSpan="2" HorizontalAlignment="Left" IsTabStop="{TemplateBinding IsTabStop}">
                            <Thumb.Style>
                                <Style TargetType="{x:Type Thumb}">
                                    <Setter Property="Width" Value="8"/>
                                    <Setter Property="Background" Value="Transparent"/>
                                    <Setter Property="BorderBrush" Value="Transparent"/>
                                    <Setter Property="BorderThickness" Value="0"/>
                                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                                    <Setter Property="Padding" Value="0"/>
                                    <Setter Property="Cursor" Value="SizeWE"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Thumb.Style>
                        </Thumb>
                        <Thumb x:Name="PART_RightHeaderGripper" Grid.ColumnSpan="2" HorizontalAlignment="Right" IsTabStop="{TemplateBinding IsTabStop}">
                            <Thumb.Style>
                                <Style TargetType="{x:Type Thumb}">
                                    <Setter Property="Width" Value="8"/>
                                    <Setter Property="Background" Value="Transparent"/>
                                    <Setter Property="BorderBrush" Value="Transparent"/>
                                    <Setter Property="BorderThickness" Value="0"/>
                                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                                    <Setter Property="Padding" Value="0"/>
                                    <Setter Property="Cursor" Value="SizeWE"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Thumb.Style>
                        </Thumb>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True"/>
                                <Condition Property="SortingState" Value="None"/>
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Over">
                                            <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="GridViewHeaderCell_Over">
                                            <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.ExitActions>
                            <Setter Property="Foreground" Value="Black"/>
                        </MultiTrigger>
                        <Trigger Property="SortingState" Value="Ascending">
                            <Setter Property="Foreground" Value="Black"/>
                            <Setter Property="Opacity" TargetName="PART_SortIndicator" Value="1"/>
                            <Setter Property="LayoutTransform" TargetName="PART_SortIndicator">
                                <Setter.Value>
                                    <ScaleTransform ScaleY="1" ScaleX="1"/>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Opacity" TargetName="GridViewHeaderCell_Selected" Value="1"/>
                        </Trigger>
                        <Trigger Property="SortingState" Value="Descending">
                            <Setter Property="Foreground" Value="Black"/>
                            <Setter Property="Opacity" TargetName="PART_SortIndicator" Value="1"/>
                            <Setter Property="LayoutTransform" TargetName="PART_SortIndicator">
                                <Setter.Value>
                                    <ScaleTransform ScaleY="-1" ScaleX="1"/>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Opacity" TargetName="GridViewHeaderCell_Selected" Value="1"/>
                        </Trigger>
                        <Trigger Property="SortingState" Value="None">
                            <Setter Property="Opacity" TargetName="PART_SortIndicator" Value="0"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="{DynamicResource GrayGradientGradientBrush}"/>
        <Setter Property="BorderBrush" Value="#FF848484"/>
        <Setter Property="BorderThickness" Value="0,0,1,1"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="5,0,3,0"/>
        <Setter Property="Foreground" Value="{StaticResource GridBlueBrush}"/>
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="DropMarkPen">
            <Setter.Value>
                <Pen Brush="White" Thickness="2"/>
            </Setter.Value>
        </Setter>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="{x:Type telerik:GridViewHeaderIndentCell}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:GridViewHeaderIndentCell}">
                    <Border x:Name="OuterBorder" BorderBrush="#FF848484" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="25">
                        <Border Background="{DynamicResource Office2007Silver}" x:Name="InnerBorder" BorderBrush="#FF848484" BorderThickness="1">
                              
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="0,0,1,1"/>
        <Setter Property="BorderBrush" Value="#FF848484"/>      
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>
    <Style TargetType="{x:Type telerik:GridViewHeaderRow}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:GridViewHeaderRow}">
                    <telerik:SelectiveScrollingGrid>
                        <telerik:SelectiveScrollingGrid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </telerik:SelectiveScrollingGrid.ColumnDefinitions>
                        <Border x:Name="PART_GridViewHeaderRowBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Border BorderBrush="#FF4B4B4B" BorderThickness="1" Background="{DynamicResource Office2007Silver}"/>
                        </Border>
                        <telerik:DataCellsPresenter x:Name="PART_DataCellsPresenter" Grid.Column="3" IsTabStop="False">
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                        </telerik:DataCellsPresenter>
                        <Border x:Name="PART_IndicatorPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{TemplateBinding RowIndicatorVisibility}" Width="25">
                            <Border BorderBrush="#FF848484" Background="{DynamicResource Office2007Silver}" BorderThickness="1">
                                  
                            </Border>
                        </Border>
                        <telerik:IndentPresenter x:Name="PART_IndentPresenter" Grid.Column="1" IsTabStop="False" IndentLevel="{TemplateBinding IndentLevel}" MinHeight="{TemplateBinding MinHeight}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
                            <telerik:IndentPresenter.ItemTemplate>
                                <DataTemplate>
                                    <telerik:GridViewHeaderIndentCell IsTabStop="False">
                                        <telerik:StyleManager.Theme>
                                            <telerik:Office_BlackTheme/>
                                        </telerik:StyleManager.Theme>
                                    </telerik:GridViewHeaderIndentCell>
                                </DataTemplate>
                            </telerik:IndentPresenter.ItemTemplate>
                            <telerik:StyleManager.Theme>
                                <telerik:Office_BlackTheme/>
                            </telerik:StyleManager.Theme>
                        </telerik:IndentPresenter>
                        <Border x:Name="PART_HierarchyIndentPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,1" Grid.Column="2" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25">
                            <Border.Visibility>
                                <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">
                                    <Binding.Converter>
                                        <telerik:BooleanToVisibilityConverter/>
                                    </Binding.Converter>
                                </Binding>
                            </Border.Visibility>
                            <Border BorderBrush="#FF4B4B4B" Background="{DynamicResource Office2007Silver}" BorderThickness="1">
                                  
                            </Border>
                        </Border>
                    </telerik:SelectiveScrollingGrid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="{DynamicResource Office2007Silver}">           
        </Setter>
        <Setter Property="MinHeight" Value="27"/>
        <Setter Property="BorderBrush" Value="#FF848484"/>
        <Setter Property="BorderThickness" Value="1,0,0,1"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
    </Style>

Key Style:
<Style x:Key="GridViewHeaderRowStyle1" TargetType="{x:Type telerik:GridViewHeaderRow}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:GridViewHeaderRow}">
                        <telerik:SelectiveScrollingGrid>
                            <telerik:SelectiveScrollingGrid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </telerik:SelectiveScrollingGrid.ColumnDefinitions>
                            <Border x:Name="PART_GridViewHeaderRowBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                <Border BorderBrush="#FF4B4B4B" BorderThickness="1" Background="{DynamicResource Office2007Silver}"/>
                            </Border>
                            <telerik:DataCellsPresenter x:Name="PART_DataCellsPresenter" Grid.Column="3" IsTabStop="False">
                                <telerik:StyleManager.Theme>
                                    <telerik:Office_BlackTheme/>
                                </telerik:StyleManager.Theme>
                            </telerik:DataCellsPresenter>
                            <Border x:Name="PART_IndicatorPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,1" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{TemplateBinding RowIndicatorVisibility}" Width="25">
                                <Border BorderBrush="#FF848484" BorderThickness="1" Background="{DynamicResource Office2007Silver}"/>
                            </Border>
                            <telerik:IndentPresenter x:Name="PART_IndentPresenter" Grid.Column="1" IsTabStop="False" IndentLevel="{TemplateBinding IndentLevel}" MinHeight="{TemplateBinding MinHeight}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
                                <telerik:IndentPresenter.ItemTemplate>
                                    <DataTemplate>
                                        <telerik:GridViewHeaderIndentCell IsTabStop="False">
                                            <telerik:StyleManager.Theme>
                                                <telerik:Office_BlackTheme/>
                                            </telerik:StyleManager.Theme>
                                        </telerik:GridViewHeaderIndentCell>
                                    </DataTemplate>
                                </telerik:IndentPresenter.ItemTemplate>
                                <telerik:StyleManager.Theme>
                                    <telerik:Office_BlackTheme/>
                                </telerik:StyleManager.Theme>
                            </telerik:IndentPresenter>
                            <Border x:Name="PART_HierarchyIndentPresenter" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,1" Grid.Column="2" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25">
                                <Border.Visibility>
                                    <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">
                                        <Binding.Converter>
                                            <telerik:BooleanToVisibilityConverter/>
                                        </Binding.Converter>
                                    </Binding>
                                </Border.Visibility>
                                <Border BorderBrush="#FF4B4B4B" BorderThickness="1" Background="{DynamicResource Blue}"/>
                            </Border>
                        </telerik:SelectiveScrollingGrid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Background" Value="{DynamicResource Office2007Silver}"/>
            <Setter Property="MinHeight" Value="27"/>
            <Setter Property="BorderBrush" Value="#FF848484"/>
            <Setter Property="BorderThickness" Value="1,0,0,1"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
        </Style>

Vanya Pavlova
Telerik team
 answered on 29 Mar 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?