BirnBaumBlüte BirnBaumBlüte - 4 months ago 59
Vb.net Question

Style background of Cell in EditMode in RadGridView

I want to style a cell in a RadGridView so whenever the cell turns into edit mode the backgroundcolor is e.g. yellow.

<telerik:RadGridView x:Name="Name" SelectionUnit="Cell">
<telerik:RadGridView.Resources>
<Style TargetType="telerik:GridViewCell">
<Style.Triggers>
<Trigger Property="IsInEditMode" Value="True">
<Setter Property="Background" Value="Yellow"/>
</Trigger>
</Style.Triggers>
</Style>
</telerik:RadGridView.Resources>
</telerik:RadGridView>


This doesn't do anything.

Answer

In the telerik:RadGridView try:

<telerik:RadGridView.Resources>
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="Background" Value="LightYellow"/>
        </Style>
</telerik:RadGridView.Resources>

It changes the backgroundcolor of each selected-to-edit Cell to lightyellow.