<Window x:Class="CellMouseTrigger.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    Title="Window1" Height="300" Width="500">
    <Grid>
        <Grid.Resources>
            <ControlTemplate x:Key="NormalTemplate" TargetType="{x:Type telerik:GridViewCell}">
                <Border
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                Background="{TemplateBinding Background}">
                    <Grid>
                        <ContentPresenter Visibility="Visible" Margin="{TemplateBinding Padding}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"/>
                        <Popup Name="EditorPopup" 
                               Visibility="Collapsed" 
                               Placement="Center" 
                               AllowsTransparency="True">
                            
                            <Border 
                                    BorderBrush="#FFE2E5FF" 
                                    BorderThickness="1,1,1,1" 
                                    CornerRadius="3,3,3,3" 
                                    Margin="1,1,1,1" 
                                    VerticalAlignment="Stretch" 
                                    Height="Auto">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,0.034" StartPoint="0.5,1">
                                        <GradientStop Color="#FFB8C7EA" Offset="0"/>
                                        <GradientStop Color="#FFBAC3FF" Offset="1"/>
                                        <GradientStop Color="#FF636EAB" Offset="0.831"/>
                                        <GradientStop Color="#FF9BADD4" Offset="0.831"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            <HeaderedContentControl Header="Edit:">
                                <Grid x:Name="customCellBackground" Width="200" Height="100">
                                    <Grid.Resources>
                                        <Style TargetType="{x:Type TextBox}">
                                            <Setter Property="BorderBrush">
                                                <Setter.Value>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#FF5990FF" Offset="0"/>
                                                        <GradientStop Color="#FFFFFFFF" Offset="0.111"/>
                                                    </LinearGradientBrush>
                                                </Setter.Value>
                                            </Setter>
                                            <Setter Property="TextWrapping" Value="Wrap" />
                                            <Setter Property="VerticalAlignment" Value="Center" />
                                            <Setter Property="HorizontalAlignment" Value="Stretch" />
                                            <Setter Property="Margin" Value="24, 24, 24, 24" />
                                        </Style>
                                    </Grid.Resources>

                                    <ContentPresenter Name="PART_EditorPresenter" />
                                </Grid>
                            </HeaderedContentControl>
                            </Border>
                        </Popup>
                    </Grid>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Value="True" Property="IsInEditMode">
                        <Setter Property="IsOpen" TargetName="EditorPopup" Value="True"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <Style TargetType="{x:Type telerik:GridViewCell}">
                <Setter Property="Margin" Value="0"/>
                <Setter Property="Padding" Value="0"/>
                <Setter Property="Template" Value="{StaticResource NormalTemplate}">
                </Setter>
            </Style>
        </Grid.Resources>
        <telerik:RadGridView Name="RadGridView1"></telerik:RadGridView>
    </Grid>
</Window>
