Telerik Forums
UI for WPF Forum
2 answers
141 views

I am trying to change the last row's row header to have a * in it. Like Access has for the new row.
I have been playing with the Template and the RowStyleSelector but have not been able to achieve this.

For the Template I created the NewRowIndicator but I am not sure what property I can trigger that would be true only for the last row in the grid??

<Style x:Key="ss"  TargetType="{x:Type telerik:GridViewRow}">
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:GridViewRow}">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <telerik:SelectiveScrollingGrid x:Name="grid">
                                <telerik:SelectiveScrollingGrid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </telerik:SelectiveScrollingGrid.ColumnDefinitions>
                                <telerik:SelectiveScrollingGrid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </telerik:SelectiveScrollingGrid.RowDefinitions>
                         
                                <Border x:Name="SelectionBackground" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" Grid.Column="2" Margin="{TemplateBinding Margin}" Padding="{TemplateBinding Padding}" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                <Border x:Name="Background_Over" BorderBrush="#FFFFC92B" BorderThickness="1" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,1,2" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" Visibility="Collapsed">
                                    <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"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                    </Border>
                                </Border>
                                <Border x:Name="Background_Selected" BorderBrush="#FFFFC92B" BorderThickness="1" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,1,2" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" Visibility="Collapsed">
                                    <Border BorderBrush="White" BorderThickness="1">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFFCE79F" Offset="1"/>
                                                <GradientStop Color="#FFFDD3A8"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                    </Border>
                                </Border>
                                <Border x:Name="Background_Invalid" BorderBrush="#FFCE7D7D" BorderThickness="1" Grid.ColumnSpan="2" Grid.Column="2" CornerRadius="1" Margin="1,1,1,2" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" Visibility="Collapsed">
                                    <Border BorderThickness="1">
                                        <Border.BorderBrush>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFEBF4FD"/>
                                                <GradientStop Color="#FFDBEAFD" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.BorderBrush>
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFFCDCDC"/>
                                                <GradientStop Color="#FFFCC1C1" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                    </Border>
                                </Border>
                                <telerik:GridViewToggleButton x:Name="PART_HierarchyExpandButton" Grid.Column="2" IsHitTestVisible="{Binding IsExpandable, RelativeSource={RelativeSource TemplatedParent}}" IsTabStop="{TemplateBinding IsTabStop}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Width="25">
                                    <telerik:GridViewToggleButton.Opacity>
                                        <Binding Path="IsExpandable" RelativeSource="{RelativeSource TemplatedParent}">
                                            <Binding.Converter>
                                                <telerik:BooleanToOpacityConverter/>
                                            </Binding.Converter>
                                        </Binding>
                                    </telerik:GridViewToggleButton.Opacity>
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                    <telerik:GridViewToggleButton.Template>
                                        <ControlTemplate TargetType="{x:Type telerik:GridViewToggleButton}">
                                            <Border Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Height="9" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="9">
                                                    <Grid>
                                                        <Path x:Name="plus" Data="M1.937,0L2.937,0 2.937,2.0209999 5,2.0209999 5,3.0209999 2.937,3.0209999 2.937,5 1.937,5 1.937,3.0209999 0,3.0209999 0,2.0209999 1.937,2.0209999z" Fill="Black" Height="5" Margin="{TemplateBinding Padding}" Stretch="Fill" Stroke="{x:Null}" Width="5"/>
                                                        <Rectangle x:Name="minus" Fill="Black" HorizontalAlignment="Center" Height="1" Margin="{TemplateBinding Padding}" Opacity="0" RadiusY="0" RadiusX="0" Stroke="{x:Null}" VerticalAlignment="Center" Width="5"/>
                                                    </Grid>
                                                </Border>
                                            </Border>
                                            <ControlTemplate.Triggers>
                                                <Trigger Property="IsChecked" Value="True">
                                                    <Setter Property="Opacity" TargetName="plus" Value="0"/>
                                                    <Setter Property="Opacity" TargetName="minus" Value="1"/>
                                                </Trigger>
                                            </ControlTemplate.Triggers>
                                        </ControlTemplate>
                                    </telerik:GridViewToggleButton.Template>
                                    <telerik:GridViewToggleButton.Visibility>
                                        <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">
                                            <Binding.Converter>
                                                <telerik:BooleanToVisibilityConverter/>
                                            </Binding.Converter>
                                        </Binding>
                                    </telerik:GridViewToggleButton.Visibility>
                                </telerik:GridViewToggleButton>
                                <Border Grid.Column="2" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
                                    <Border.Visibility>
                                        <Binding Path="HasHierarchy" RelativeSource="{RelativeSource TemplatedParent}">
                                            <Binding.Converter>
                                                <telerik:BooleanToVisibilityConverter/>
                                            </Binding.Converter>
                                        </Binding>
                                    </Border.Visibility>
                                </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_RowBorder" BorderBrush="{TemplateBinding HorizontalGridLinesBrush}" Grid.ColumnSpan="4" Grid.Column="1" Grid.RowSpan="4" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True" VerticalAlignment="Bottom">
                                    <Border.BorderThickness>
                                        <Binding ConverterParameter="Bottom" Path="HorizontalGridLinesWidth" RelativeSource="{RelativeSource TemplatedParent}">
                                            <Binding.Converter>
                                                <telerik:GridLineWidthToThicknessConverter/>
                                            </Binding.Converter>
                                        </Binding>
                                    </Border.BorderThickness>
                                </Border>
                                <Border BorderBrush="#FF848484" BorderThickness="0,1" Background="#FFBBBBBB" Grid.ColumnSpan="2" Grid.Column="2" Padding="6" Grid.Row="2" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True">
                                    <Border.Visibility>
                                        <Binding Path="IsExpanded" RelativeSource="{RelativeSource TemplatedParent}">
                                            <Binding.Converter>
                                                <telerik:BooleanToVisibilityConverter/>
                                            </Binding.Converter>
                                        </Binding>
                                    </Border.Visibility>
                                    <ContentPresenter x:Name="PART_HierarchyChildPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True"/>
                                </Border>
                                <telerik:DetailsPresenter x:Name="PART_DetailsPresenter" Grid.ColumnSpan="2" Grid.Column="2" DetailsProvider="{TemplateBinding DetailsProvider}" IsTabStop="False" Grid.Row="1" telerik:SelectiveScrollingGrid.SelectiveScrollingClip="True">
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                </telerik:DetailsPresenter>
                                <telerik:IndentPresenter x:Name="PART_IndentPresenter" Grid.Column="1" IsTabStop="False" IndentLevel="{TemplateBinding IndentLevel}" Grid.RowSpan="4" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                </telerik:IndentPresenter>
                                <Border x:Name="PART_IndicatorPresenter" BorderBrush="#FF848484" BorderThickness="0,0,1,1" Grid.Column="0" Grid.RowSpan="3" telerik:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{TemplateBinding RowIndicatorVisibility}" VerticalAlignment="Stretch" Width="25">
                                    <Border x:Name="NavigatorIndicatorBackground" BorderBrush="White" BorderThickness="1" Background="#FFE4E4E4">
                                        <Grid>
                                            <Grid x:Name="NavigatorIndicator" HorizontalAlignment="Center" Height="11" Visibility="Collapsed" VerticalAlignment="Center" Width="11">
                                                <Path Data="F1M32.0234,6.66669L24.2923,0.0248413 28.3697,0.0248413 32,3.14362 36.1492,6.70819 32,10.2728 28.4664,13.3085 24.2923,13.3085 32.0234,6.66669z" Fill="#FF848484" HorizontalAlignment="Center" Height="8" Margin="0" Stretch="Fill" VerticalAlignment="Center" Width="8"/>
                                            </Grid>
                                            <Grid x:Name="EditIndicator" HorizontalAlignment="Center" Height="10" Visibility="Collapsed" VerticalAlignment="Center" Width="16">
                                                <Path Data="M14,9L15,9 15,10 14,10z M1,9L2,9 2,10 1,10z M15,8L16,8 16,9 15,9z M0,8L1,8 1,9 0,9z M15,1L16,1 16,2 15,2z M0,1L1,1 1,2 0,2z M14,0L15,0 15,1 14,1z M1,0L2,0 2,1 1,1z" Fill="#7F848484" Stretch="Fill"/>
                                                <Path Data="M0.99999994,6.9999995L2,6.9999995 3,6.9999995 4,6.9999995 5,6.9999995 6,6.9999995 7,6.9999995 8,6.9999995 9,6.9999995 10,6.9999995 11,6.9999995 12,6.9999995 13,6.9999995 13,7.9999995 12,7.9999995 11,7.9999995 10,7.9999995 9,7.9999995 8,7.9999995 7,7.9999995 6,7.9999995 5,7.9999995 4,7.9999995 3,7.9999995 2,7.9999995 0.99999994,7.9999995z M13,0.99999994L14,0.99999994 14,1.9999999 14,2.9999995 14,3.9999995 14,4.9999995 14,5.9999995 14,6.9999995 13,6.9999995 13,5.9999995 13,4.9999995 13,3.9999995 13,2.9999995 13,1.9999999z M0,0.99999994L0.99999994,0.99999994 0.99999994,1.9999999 0.99999994,2.9999995 0.99999994,3.9999995 0.99999994,4.9999995 0.99999994,5.9999995 0.99999994,6.9999995 0,6.9999995 0,5.9999995 0,4.9999995 0,3.9999995 0,2.9999995 0,1.9999999z M11,0L12,0 13,0 13,0.99999994 12,0.99999994 11,0.99999994 10,0.99999994 9,0.99999994 8,0.99999994 7,0.99999994 6,0.99999994 5,0.99999994 4,0.99999994 3,0.99999994 2,0.99999994 0.99999994,0.99999994 0.99999994,2.3841858E-07 2,2.3841858E-07 3,2.3841858E-07 4,2.3841858E-07 5,2.3841858E-07 6,2.3841858E-07 7,2.3841858E-07 8,2.3841858E-07 9,2.3841858E-07 10,2.3841858E-07z" Fill="#FFCBCBCB" Margin="1" Stretch="Fill"/>
                                                <Path Data="M2,9L3,9 4,9 5,9 6,9 7,9 8,9 9,9 10,9 11,9 12,9 13,9 14,9 14,10 13,10 12,10 11,10 10,10 9,10 8,10 7,10 6,10 5,10 4,10 3,10 2,10z M14,8L15,8 15,9 14,9z M1,8L2,8 2,9 1,9z M15,2L16,2 16,3 16,4 16,5 16,6 16,7 16,8 15,8 15,7 15,6 15,5 15,4 15,3z M3,2L4,2 5,2 6,2 6,3 5,3 5,4 5,5 5,6 5,7 6,7 6,8 5,8 4,8 3,8 3,7 4,7 4,6 4,5 4,4 4,3 3,3z M0,2L1,2 1,3 1,4 1,5 1,6 1,7 1,8 0,8 0,7 0,6 0,5 0,4 0,3z M14,1L15,1 15,2 14,2z M1,1L2,1 2,2 1,2z M2,0L3,0 4,0 5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 13,0 14,0 14,1 13,1 12,1 11,1 10,1 9,1 8,1 7,1 6,1 5,1 4,1 3,1 2,1z" Fill="#FF848484" Stretch="Fill"/>
                                                <Path Data="M4,0L5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 12,1 12,2 12,3 12,4 12,5.0000001 12,6 11,6 10,6 9,6 8,6 7,6 6,6 5,6 4,6 4,5.0000001 3,5.0000001 3,4 3,3 3,2 3,1 4,1z M0,0L1,0 1,1 2,1 2,2 2,3 2,4 2,5.0000001 1,5.0000001 1,6 0,6 0,5.0000001 0,4 0,3 0,2 0,1z" Fill="White" Margin="2" Stretch="Fill"/>
                                            </Grid>
                                            <Grid x:Name="ErrorIndicator" HorizontalAlignment="Center" Height="16" Visibility="Collapsed" VerticalAlignment="Center" Width="16">
                                 
                                                <Path Data="M3,12.999999L4,12.999999 5,12.999999 6,12.999999 7,12.999999 8,12.999999 9,12.999999 10,12.999999 11,12.999999 11,13.999999 10,13.999999 9,13.999999 8,13.999999 7,13.999999 6,13.999999 5,13.999999 4,13.999999 3,13.999999z M11,11.999999L12,11.999999 12,12.999999 11,12.999999z M2.0000001,11.999999L3,11.999999 3,12.999999 2.0000001,12.999999z M12,10.999999L13,10.999999 13,11.999999 12,11.999999z M1,10.999999L2.0000001,10.999999 2.0000001,11.999999 1,11.999999z M13,2.9999992L14,2.9999992 14,3.9999992 14,4.9999992 14,5.9999992 14,6.9999992 14,7.9999992 14,8.9999992 14,9.9999992 14,10.999999 13,10.999999 13,9.9999992 13,8.9999992 13,7.9999992 13,6.9999992 13,5.9999992 13,4.9999992 13,3.9999992z M0,2.9999992L1,2.9999992 1,3.9999992 1,4.9999992 1,5.9999992 1,6.9999992 1,7.9999992 1,8.9999992 1,9.9999992 1,10.999999 0,10.999999 0,9.9999992 0,8.9999992 0,7.9999992 0,6.9999992 0,5.9999992 0,4.9999992 0,3.9999992z M12,1.9999999L13,1.9999999 13,2.9999992 12,2.9999992z M1,1.9999999L2.0000001,1.9999999 2.0000001,2.9999992 1,2.9999992z M11,0.99999994L12,0.99999994 12,1.9999999 11,1.9999999z M2.0000001,0.99999994L2.9999998,0.99999994 2.9999998,1.9999999 2.0000001,1.9999999z M2.9999998,0L3.9999998,0 5,0 6,0 7,0 8,0 9,0 10,0 11,0 11,0.99999994 10,0.99999994 9,0.99999994 8,0.99999994 7,0.99999994 6,0.99999994 5,0.99999994 3.9999998,0.99999994 2.9999998,0.99999994z" Margin="1" Stretch="Fill">
                                                    <Path.Fill>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="#FFFC9999" Offset="0"/>
                                                            <GradientStop Color="#FFC26666" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </Path.Fill>
                                                </Path>
                                                <Path Data="M1.4901161E-07,8L1.0000001,8 2.0000002,8 2.0000002,9 2.0000002,10 1.0000003,10 1.0000003,9 1.0000001,10 1.4901161E-07,10 1.4901161E-07,9z M1.4901161E-07,0L1.0000001,0 2.0000002,0 2.0000002,1 2.0000002,2 2.0000002,3 2.0000002,4.0000001 2.0000002,5 2.0000002,5.9999999 2.0000002,7 1.0000001,7 1.4901161E-07,7 1.4901161E-07,5.9999999 1.4901161E-07,5 1.4901161E-07,4.0000001 1.4901161E-07,3 1.4901161E-07,2 0,1z" Fill="White" Margin="7,3" Stretch="Fill"/>
                                                <Path Data="M4,15L5,15 6,15 7,15 8,15 9,15 10,15 11,15 12,15 12,16 11,16 10,16 9,16 8,16 7,16 6,16 5,16 4,16z M12,14L13,14 13,15 12,15z M3,14L4,14 4,15 3,15z M13,13L14,13 14,14 13,14z M2,13L3,13 3,14 2,14z M14,12L15,12 15,13 14,13z M1,12L2,12 2,13 1,13z M7,11L7,12 7,13 8,13 9,13 9,12 9,11 8,11z M15,4L16,4 16,5 16,6 16,7 16,8 16,9 16,10 16,11 16,12 15,12 15,11 15,10 15,9 15,8 15,7 15,6 15,5z M0,4L1,4 1,5 1,6 1,7 1,8 1,9 1,10 1,11 1,12 0,12 0,11 0,10 0,9 0,8 0,7 0,6 0,5z M14,3L15,3 15,4 14,4z M7,3L7,4 7,5 7,6 7,7 7,8 7,9 7,10 8,10 9,10 9,9 9,8 9,7 9,6 9,5 9,4 9,3 8,3z M1,3L2,3 2,4 1,4z M13,2L14,2 14,3 13,3z M4,2L5,2 6,2 7,2 8,2 9,2 10,2 11,2 12,2 12,3 13,3 13,4 14,4 14,5 14,6 14,7 14,8 14,9 14,10 14,11 14,12 13,12 13,13 12,13 12,14 11,14 10,14 9,14 8,14 7,14 6,14 5,14 4,14 4,13 3,13 3,12 2,12 2,11 2,10 2,9 2,8 2,7 2,6 2,5 2,4 3,4 3,3 4,3z M2,2L3,2 3,3 2,3z M12,1L13,1 13,2 12,2z M3,1L4,1 4,2 3,2z M4,0L5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 12,1 11,1 10,1 9,1 8,1 7,1 6,1 5,1 4,1z" Stretch="Fill">
                                                    <Path.Fill>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="Red" Offset="0"/>
                                                            <GradientStop Color="#FF990000" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </Path.Fill>
                                                </Path>
                                            </Grid>
                                            <Grid x:Name="NewRowIndicator" HorizontalAlignment="Center" Height="11" Visibility="Collapsed" VerticalAlignment="Center" Width="11">
                                                <TextBlock Text="*" HorizontalAlignment="Center" FontSize="20" VerticalAlignment="Center" />
                                            </Grid>
                                            <Border x:Name="PART_RowResizer" Background="Transparent" Cursor="SizeNS" Height="2" VerticalAlignment="Bottom"/>
                                        </Grid>
                                    </Border>
                                </Border>
                            </telerik:SelectiveScrollingGrid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="True"/>
                                    <Condition Property="DisplayVisualCues" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Visibility" TargetName="Background_Selected" Value="Visible"/>
                                <Setter Property="Background" TargetName="NavigatorIndicatorBackground">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="White" Offset="0"/>
                                            <GradientStop Color="#FFE4E4E4" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="DisplayVisualCues" Value="True"/>
                                    <Condition Property="IsMouseOver" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Visibility" TargetName="Background_Over" Value="Visible"/>
                            </MultiTrigger>
                            <Trigger Property="IsValid" Value="False">
                                <Setter Property="Visibility" TargetName="ErrorIndicator" Value="Visible"/>
                                <Setter Property="Visibility" TargetName="EditIndicator" Value="Collapsed"/>
                                <Setter Property="Visibility" TargetName="NavigatorIndicator" Value="Collapsed"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsValid" Value="False"/>
                                    <Condition Property="DisplayVisualCues" Value="True"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Visibility" TargetName="Background_Invalid" Value="Visible"/>
                            </MultiTrigger>
                            <Trigger Property="IsCurrent" Value="True">
                                <Setter Property="Visibility" TargetName="NavigatorIndicator" Value="Visible"/>
                            </Trigger>
                            <Trigger Property="IsInEditMode" Value="True">
                                <Setter Property="Visibility" TargetName="EditIndicator" Value="Visible"/>
                                 
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Background" Value="White"/>
            <Setter Property="BorderBrush" Value="#FFCBCBCB"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="AllowDrop" Value="True"/>
            <Setter Property="FontWeight" Value="Normal"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
        </Style>


Jessica
Top achievements
Rank 1
 answered on 24 Feb 2012
10 answers
231 views
I'm evaluating if your WPF component suite is capable of meeting our needs, and it's beginning to look like a no for the simple reason that I can't even get the tool to display my data. I have the following target:

Get a chart to display 2048 brand new values every 27 ms.

I have attempted this in two different ways, using a RadChart, and using a ChartArea 
.
1) RadChart
This was the first chart that I found that I was able simply declare/assign data to.

e.g. 
var temp = new RadChart();
temp.ItemsSource = Data;


 Data is an ObservableCollection<float> which, on a timer ticks every 27 ms, completely changes the data to new random numbers.

The RadChart performed marvelously, except for 1 flaw, it wanted to be fancy, erasing the whole chart and redrawing from left to right the new data. This is not acceptable, as new data arrives so quickly that not 1 data point is plotted before it's wiped again. After scouring these forums for ways to disable this functionality, and only getting "Just set the EnableAnimations to false in the ChartArea" with absolutely no idea how/where this ChartArea is in my RadChart, I opted to making a ChartArea instead.

2) ChartArea
So wanting to disable the animations of the chart, I immediately discovered this functionality:

e.g.
var temp = new ChartArea();
temp.ItemsSource = Data;
temp.EnableAnimations = false;
;


Alas, "No Data Series." ... What? I clearly set it in the exact same way as the RadChart. No combination of DataContext/ItemsSource assigning has resulted in any data points being presented. I'm clearly doing this incorrectly, but am unable after hours of searching these forums to locate such a simple setup as I have defined above. 


Any assistance with this would be greatly appreciated, as I cannot actually test the capabilities of this suite otherwise.
(for clarification, I have tried this via xaml as well, and have had identical results. My code is also being implemented in c# 2010, .net 4.0)
Giuseppe
Telerik team
 answered on 24 Feb 2012
1 answer
166 views
Hi

I need to extract text from a ranges of DocumentElements.
For example the text between a BookmarkRangeStart and its paired BookmarkRangeEnd.

My solution is to walk from NextSibling to NextSibling, check the siblings to be of type Span
and get the text. If they are not Spans I recursively walk through the Children collection
and of the sibling, check these to be spans, if not recurse again etc or quit if there are no Children
unti I reach the BookmarkRangeEnd as the last Sibling.
This seems to work.
Questions:
1) is there an easier / more reliable way to get the text of "range" of elements?
(I use TextFormatter.Export for complete Documents, but not for parts)
2) is text always located inside Spans?
3) Can Spans be nested - If so, does the Text property of the "parent" Span contain
the Text content of all "child" spans? (Like InnerText in HTML)?
4) Is there a straight forward way to get the text from a Table as a CSV / TSV string?

Grettings,
Chris
Iva Toteva
Telerik team
 answered on 24 Feb 2012
2 answers
234 views
Hi

we have a problem with the RadWindow while dragging it with the mouse.
It only happens when you have "show window content while dragging" enabled in the windows-system preferences.

I think I don't have to attach an example, because it also happens in the "WPF Controls Examples".
The problem only occurs when the RadWindow is very large. So if you resize the RadWindow from the "Frist Look" example to cover nearly the entire size of the monitor and try to drag it around with the mouse, it lags behind the mouse enormously.

If you have a high resolution (e.g. 1920 x 1080), a big RadWindow (which covers nearly the entire screen) lags more then a big RadWindow on 1024x768 while dragging.

Is there a way to fix this?
chp
Top achievements
Rank 1
 answered on 24 Feb 2012
1 answer
115 views

Hi everyone,

 

I’m using the 2011 Q2 WPF package.

Is it possible to remove the background to create a very simple style.
Like the styles from the new Telerik gauges?
 

Thanks!

 

greetings,

Christian

Andrey
Telerik team
 answered on 24 Feb 2012
1 answer
105 views
Hi,

I add appointments programmaticaly to the appointmentslist and calculate the end new. If i calculate an end which is smaler than 1 hour (MinorTickLength = 1h) the ScheduleView shows me anyhow the appointment with 1h lenght. My tooltip shows me the real start and end but the scheduleview appointment-bar not. I set the BeginEdit and Commit things and i remove and add the appointments again to the property, but always he shows me the appointment-bar wrong.

Look at my picture. In this example i have 2 Appointments but it looks like 3 Appointments. What is the little shadow over the green appointment? These "shadow" has the rigth length.

I want that an appointment end is 12:59 pm or the start of the next appointment diff 1 minute. No overlapping!

Here my code:
this is the calculating in method
private void RefeshAppointmentSettings()
{
// ... do some stuff
 
    CustomAppointment previous = null;
    var i = 0;
    foreach (var custSorted in toSort)
    {
        if (i > 0)
        {
            if (previous != null)
            {
                previous.End = custSorted.Start.AddMinutes(-1);
            }
        }
        previous = custSorted;
        previous.End = previous.Start.Date.AddDays(1).AddMinutes(-1);
        i++;
    }
    Appointments.AddRange(toSort);
// ... do some stuff
}

this is the caller event:
private void SwitchTimeSpecialTimeTLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
    var scheduleViewModel = DataContext as ScheduleViewModel;
    if (scheduleViewModel != null)
    {
        scheduleViewModel.RefeshAppointmentSettings();
        _radSchedView.BeginEdit();
        var arr = new CustomAppointment[scheduleViewModel.Appointments.Count];
        scheduleViewModel.Appointments.CopyTo(arr, 0);
        scheduleViewModel.Appointments.Clear();
        for(int i = 0;i<arr.Length;i++)
        {
            scheduleViewModel.Appointments.Add(arr[i]);
        }
        _radSchedView.Commit();
    }
}

Thanks

Annett
Annett
Top achievements
Rank 1
 answered on 24 Feb 2012
1 answer
51 views
Hi,

I wonder if someone have the same problem like me. I have set the Minor and MajorTickLength of scheduleview in xaml. And every time if i type the = and VS 2010 wants to open the intellisense for these properties the VS 2010 crashes. To use these properties in xaml i must type the code including the values in an editor like Notepad and copy/paste it to the xaml-file.

Is this a bug of VS or of the control? Any other intellisense works.
VS2010, Win7x64, RadControls_for_WPF40_2011_2_0920

Thanks

Annett
Yana
Telerik team
 answered on 24 Feb 2012
2 answers
111 views
Hello,
I use the two methods provided in the sample for saving a raddocking

private string SaveLayoutAsString(RadDocking instance)
     {
         MemoryStream stream = new MemoryStream();
         instance.SaveLayout(stream,true);
 
         stream.Seek(0, SeekOrigin.Begin);
 
         StreamReader reader = new StreamReader(stream);
         return reader.ReadToEnd();
     }
 
     private void LoadLayoutFromString(string xml, RadDocking instance)
     {
         using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
         {
             stream.Seek(0, SeekOrigin.Begin);
             instance.LoadLayout(stream,true);
         }
     }

When I restore to the saved status I've the SerializationTag to null (I've also tried to set the tag field but it's the same, it's not serialized)
Any suggestion, reason it's happening?

Thanks
Michele
Top achievements
Rank 2
 answered on 24 Feb 2012
5 answers
558 views
Hi,

I have a RadGridView grouped on a property of the binding object.

GroupDescriptor phaseDescriptor = new GroupDescriptor();
phaseDescriptor.Member = "PhaseName";
this.grdScope.GroupDescriptors.Insert(0, phaseDescriptor);

The collection of object bound to grid is "Task" with a property "PhaseName"

The Task object contains another property of type  "Phase" whose Name property is same as Task's PhaseName property.

The type Phase defines another property "Index". I want to sort the Groups according to this index. Right now I can only sort the groups ascending or descending based on PhaseName only.

Any ideas?
Karan
Top achievements
Rank 1
 answered on 24 Feb 2012
1 answer
70 views
Hi,

When we use a RibbonWindow with Backstage, and open the backstage view, we can't change the size of the window using the mouse. Only minimizing and maximizing works. If we close backstage the window is sizable again. This is reproducible on the RibbonWindow sample of  Rad Controls for WCF Q1 2012.

Thank you

Ioannis
Petar Mladenov
Telerik team
 answered on 24 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?