Telerik Forums
UI for WPF Forum
4 answers
365 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
270 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
199 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
77 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
120 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
612 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
3 answers
207 views
Hello,

I am using a RadMaskNumericInput control, but I am not able to clean the value on the ViewModel. My set property is not hit when the user clicks the RadMaskNumericInput.ClearButton. 
I also tried to set the ClearCommand to an ICommand, but it is neither hit when the user clicks on the Clear button.
The only thing that happens when the clear button is clicked is that the text of the RadMaskNumericInput is cleaned, but not the value bound to it.
The version is the 2011 Q1
What I am doing wrong?

Thanks in advance,

This is the xaml:

            <telerik:RadMaskedNumericInput Grid.Column="1"
                                           VerticalAlignment="Center" HorizontalAlignment="Stretch"
                                           Mask="{Binding Path=Mask}"
                                           IsClearButtonVisible="True"
                                           AutoFillZeros="True"
                                           AutoFillNumberGroupSeparators="{Binding Path=IsNumber}"
                                           AllowSkipPlaceholders="False"
                                           Background="{Binding Path=IsValid, Converter={StaticResource boolToBackgroundConverter}, Mode=OneWay}">                <telerik:RadMaskedNumericInput.Value>
                    <Binding Path="Value"
                             Mode="TwoWay"
                             UpdateSourceTrigger="LostFocus"
                             NotifyOnValidationError="True"
                             ValidatesOnExceptions="True"
                             ValidatesOnDataErrors="True">
                    </Binding>
                </telerik:RadMaskedNumericInput.Value>
            </telerik:RadMaskedNumericInput>

Alex Fidanov
Telerik team
 answered on 29 Mar 2011
5 answers
169 views
Hello,

I use 2 DateTimePicker, and i set the property "telerik:StartEndDatePicker.EndPicker". I'd like to disable the message "The end date you enterd occurs before the start date.". How can i do this?

Thanks
Yana
Telerik team
 answered on 29 Mar 2011
8 answers
191 views
Hi,

i am binding my data  but i want to have my own custom label for data. in addition i dont want to show the label for every data point but for every say 5th point.
how can i achieve this. ???
Missing User
 answered on 29 Mar 2011
3 answers
222 views
I am trying to load a standard xaml file into the RichTextBox and I am getting an exception when I do the import function.  The exception I am getting is:
"Unable to cast object of type 'System.Windows.Documents.FlowDocument' to type 'Telerik.Windows.Documents.Model.RadDocument'."

The file I am trying to import is:
 

<FlowDocument
  xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
  xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
  <Paragraph FontFamily="Calibri" FontWeight="Bold" FontSize="24">
    WPF Flow Documents</Paragraph>
  <Paragraph>WPF Flow Documents are <Italic>quite sophisticated</Italic>.
    They support all common layout options, as well as many you probably
    do <Span Foreground="Red">not expect</Span>.</Paragraph>
  <List>
    <ListItem><Paragraph>First List Item</Paragraph></ListItem>
    <ListItem><Paragraph>Second List Item</Paragraph></ListItem>
    <ListItem><Paragraph>Third List Item</Paragraph></ListItem>
  </List>
  <Paragraph>Of course, Flow Documents also support the definition
    of <Bold><Span FontFamily="Comic Sans MS" FontSize="24"
    Foreground="Blue">in line</Span></Bold> font sizes and font faces.
  </Paragraph>
</FlowDocument>

 

My code is:

FileStream

 

 

xamlInStream = new FileStream(@"C:\testimport.xaml",FileMode.Open,FileAccess.Read);

 

 

 

 

XamlFormatProvider xamlFormatProvider = new XamlFormatProvider();

 

 

 

RadDocument radDocument = xamlFormatProvider.Import(xamlInStream);

 

 

editor.Document = radDocument;


What do I need to do to open standard xaml files.  Also, I noticed that when documents are saved as xaml documents the file format is of a RadDocument, is there a way to get a standard FlowDocument from the text box?
Ivailo Karamanolev
Telerik team
 answered on 29 Mar 2011
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?