Telerik Forums
UI for WPF Forum
3 answers
675 views
Hi

I noticed that the default RadGridView style does not provide a gray row when a Row is selected but not active; window with both textbox and gridView; select line in gridView; line is blue; activate textbox (click or tab); selected line is still blue.

I tried to modify this behavior inside a GridViewRow style using a Multitrigger but it seems that Selector.IsSelectionActive is always false.

This is my current GridViewRow template : 

   <Style TargetType="{x:Type telerik:GridViewRow}">
           
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:GridViewRow}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <Border x:Name="SelectionBackground"
                                    Grid.Column="2"
                     Background="{TemplateBinding Background}"
                     MinHeight="{TemplateBinding MinHeight}"
                     BorderBrush="{TemplateBinding BorderBrush}"
                     BorderThickness="{TemplateBinding BorderThickness}"
                     Margin="{TemplateBinding Margin}"
                     Padding="{TemplateBinding Padding}" />

                            <Rectangle x:Name="BackgroundRectangle"
                                       Grid.Column="2" Opacity="0"
                        Fill="{DynamicResource telerik.GridViewRowSelectedBackground}"
                        Stroke="{DynamicResource telerik.GridViewRowSelectedBorderBrush}"
                        StrokeThickness="1" />

                            <telerik:IndicatorPresenter x:Name="PART_IndicatorPresenter" 
                                                        Visibility="{TemplateBinding RowIndicatorVisibility}" Grid.Column="0"
                              Background="{TemplateBinding Background}"
                              BorderBrush="BlueViolet"
                              BorderThickness="1,0,1,1">

                                <Path x:Name="NavigatorIndicator"
          Fill="#FF000000" Stretch="Fill" Width="5" Height="8" Data="M254.5,183.75 L254.5,193.33333 260.75,188.16682 z"
          Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center" />

                            </telerik:IndicatorPresenter>
                            <telerik:IndentPresenter x:Name="PART_IndentPresenter" 
                                                     IndentLevel="{TemplateBinding IndentLevel}"
                                                     Grid.Column="1"
                                                     Background="{TemplateBinding Background}" />
                            <telerik:DataCellsPresenter  Height="Auto"
                                                         x:Name="PART_DataCellsPresenter"
                                                         Grid.Column="2"
                     MinHeight="{TemplateBinding MinHeight}" />

                            <Rectangle Width="Auto" Height="Auto"
                                       x:Name="InvalidBorder"
                                       Margin="0"
                                       Visibility="Collapsed"
                                       Stroke="Red"
                                       StrokeThickness="2"
                                       Grid.Column="0" Grid.ColumnSpan="3" />

                        </Grid>
 
                        <ControlTemplate.Triggers>
                           
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="Selector.IsSelectionActive" Value="false"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Fill"
                                        TargetName="BackgroundRectangle"
                                        Value="{DynamicResource telerik.GridViewRowSelectedInactiveBackground}"/>
                                <Setter Property="Stroke"
                                        TargetName="BackgroundRectangle"
                                        Value="{DynamicResource telerik.GridViewRowSelectedInactiveBorderBrush}"/>
                            </MultiTrigger>

                            <Trigger Property="IsSelected" Value="True">
                                <Setter Property="Opacity" TargetName="BackgroundRectangle" Value="1"/>
                            </Trigger>
                           
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" TargetName="SelectionBackground" Value="{DynamicResource telerik.GridViewRowMouseOverBackgroundBrush}"/>
                            </Trigger>
                           
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="False" />
                                    <Condition Property="IsMouseOver" Value="True" />
                                </MultiTrigger.Conditions>
                                <Setter Property="Opacity" TargetName="BackgroundRectangle" Value=".5"/>
                            </MultiTrigger>
                           
                            <Trigger Property="IsCurrent" Value="True">
                                <Setter TargetName="NavigatorIndicator" Property="Visibility" Value="Visible" />
                            </Trigger>
                           
                            <Trigger Property="IsContentValid" Value="False">
                                <Setter TargetName="InvalidBorder" Property="Visibility" Value="Visible" />
                            </Trigger>
                           
                        </ControlTemplate.Triggers>
                       
                    </ControlTemplate>
                </Setter.Value>
            </Setter>

            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="BorderBrush" Value="{DynamicResource telerik.GridViewRowBorderBrush}" />
            <Setter Property="BorderThickness" Value="0,0,0,0" />
            <Setter Property="Margin" Value="0" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="MinHeight" Value="18" />
            <Setter Property="FontSize" Value="11" />
            <Setter Property="FontFamily" Value="Verdana" />
            <Setter Property="FontWeight" Value="Normal" />
            <Setter Property="Foreground" Value="#FF000000" />

             <Style.Triggers>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding Path=IsAlternating, RelativeSource={RelativeSource Self}}" Value="true"/>
                        <Condition Binding="{Binding Path=UseAlternateRowStyle, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type telerik:RadGridView}}}" Value="true"/>
                    </MultiDataTrigger.Conditions>
                    <Setter Property="Background" Value="{DynamicResource telerik.GridViewRowAlternatingRowBackground}" />
                </MultiDataTrigger>
            </Style.Triggers>

        </Style>

Do you have any idea how to solve this ?

Kalin Milanov
Telerik team
 answered on 31 Jul 2009
1 answer
110 views
Hi,

I am using the chart control with SeriesMappings.  Once I define a custom layout, like below, the chart no longer shows data.
        <telerik:RadChart x:Name="RadChart1" UseDefaultLayout="False">  
            <Grid> 
                <Grid.RowDefinitions> 
                    <RowDefinition Height="Auto" /> 
                    <RowDefinition Height="*" /> 
                    <RowDefinition Height="Auto" /> 
                </Grid.RowDefinitions> 
 
                <chart:ChartArea x:Name="ChartArea1" LegendName="ChartLegend1" 
                      Grid.Row="0" /> 
                <chart:ChartTitle Content="Sample Report" Grid.Row="1" 
                       VerticalAlignment="Top" HorizontalAlignment="Center" 
                       TextElement.FontWeight="Bold" TextElement.FontSize="24" /> 
                <chart:ChartLegend x:Name="ChartLegend1" Header="Legend:" 
                        Grid.Row="2" 
                        VerticalAlignment="Top" /> 
            </Grid> 
        </telerik:RadChart> 

Are SeriesMappings not possible with custom layouts?

Thanks,
Pauly
Ves
Telerik team
 answered on 30 Jul 2009
1 answer
111 views
Hi

I cannot change the font size of Chart Title in code. The following code does not work.
Is there any way to chhange the font size?

radChart1.DefaultView.ChartTitle.FontSize = 8;

Thanks in advance.

Hyong

 

Vladimir Milev
Telerik team
 answered on 30 Jul 2009
4 answers
185 views
Does the Grid support RadioButtons?
Pavel Pavlov
Telerik team
 answered on 30 Jul 2009
1 answer
168 views

When I scroll combobox (not using up-down arrow, but the bar in combobox Vertical Scrollbar).

The combobox item cannot be selected using mouse click and not closing if I click outside combobox area.

Boyan
Telerik team
 answered on 30 Jul 2009
2 answers
101 views
I'm trying to bind data using XmlDataProvider to image item in radcarousel but it didn't work . i think that am doing something wrong or i miss something . what should i use to read xml file .
 

 

 

 

<Grid.DataContext>   
    <XmlDataProvider x:Name="objectDataProvider" Source="People.xml" XPath="/People/Person" />    
</Grid.DataContext> 
<telerik:RadCarousel Margin="12,30,12,34" Name="radCarousel1" >    
   <telerik:RadCarousel.ContextMenu>   
        <ContextMenu AllowDrop="True" HasDropShadow="True" IsTabStop="True" />   
   </telerik:RadCarousel.ContextMenu>   
      <Image Source="{Binding XPath=ImageFile}"></Image>   
</telerik:RadCarousel>   
 

 

 

i would appreciate any help, thanks in advance. 

 

 

 

 

 

 

Beesh
Top achievements
Rank 1
 answered on 29 Jul 2009
0 answers
122 views
Hi,

I just made a new blog about how to (easily) use telerik WPF controls in a SketchFlow project.
Maybe it's helpfully for some of you:
http://manni-at.spaces.live.com/blog/cns!82CF2A6C0D0C6F3C!204.entry

Regards

Manfred
ManniAT
Top achievements
Rank 2
 asked on 29 Jul 2009
1 answer
115 views
Hi there.
I'm using a (2009Q2) Combobox.
When utilizing the "isEditable"-autocompletion i am experiancing a small Problem: After typing someting the Backspace key isn't working anymore. Delete however is working fine.
Someone else experiancing this ?

Nils
Boyan
Telerik team
 answered on 29 Jul 2009
2 answers
105 views
Environment: 
WPF - XBAP style deployment
Version 2009.2.701.35

I'm trying to use the RadWindow to create a dynamic modal dialog from the code behind.

I'm creating the RadWinow as such:

 

var window = new RadWindow

 

{

WindowStartupLocation =

WindowStartupLocation.CenterOwner,

 

CanClose =

true,

 

CanMove =

true,

 

ResizeMode =

ResizeMode.NoResize,

 

Content =

new UnhandledError(),

 

Height = 300,

Width = 500

};

window.ShowDialog();

The problem is that the UserControl doesn't get displayed at all in the content.

The UserControl is pure XAML as:

 

<

 

UserControl x:Class="PCSWeb.WPFShell.Views.UnhandledError"

 

 

 

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

 

 

 

Height="300" Width="300" Name="window" Loaded="window_Loaded" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">

 

 

 

 

 

 

 

<Grid Background="AliceBlue" Height="Auto" Width="Auto">

 

 

 

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

 

 

 

<RowDefinition />

 

 

 

 

 

 

 

<RowDefinition />

 

 

 

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

 

 

 

<ColumnDefinition Width="*" />

 

 

 

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

 

 

 

<Border Grid.Row="0" BorderBrush="#feca00" CornerRadius="0,10,20,40"

 

 

 

 

 

 

BorderThickness="2" Height="Auto">

 

 

 

 

 

 

 

<StackPanel>

 

 

 

 

 

 

 

 

<TextBlock Text="Error">adafdfasdf</TextBlock>

 

 

 

 

 

 

 

</StackPanel>

 

 

 

 

 

 

 

</Border>

 

 

 

</Grid>

 

</

 

UserControl>

 

 

 


 

Hristo Borisov
Telerik team
 answered on 29 Jul 2009
2 answers
142 views
I want to set a default selected item
that means, when I select a "father" one of the "children" will be selected
what I do now is this
I have a case which "runs" on the name of the selected item and do what I need...
what I miss is
when I select a father and actually make it select one of the children (my default)
the selected child is not colored in the white color
as it happens when I "really" select the child
Orit
Top achievements
Rank 1
 answered on 29 Jul 2009
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?