Home Forums WPF controls Xceed DataGrid for WPF DataRow Trigger

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22443 |

    Hi,

    I’m trying to override the trigger style that is on the grid rows when you select a cell. When I click on one cell the other cells in the row turns their foreground to white and I want it to stay black.

    I actually tried on the DataRow Trigger “IsSelected” but it didn´t work, I assume it is because this feature is locally defined on the default style.

    I’m I right? How can I turn this behavior off?

    Thanks!

    Imported from legacy forums. Posted by Lilian (had 4514 views)

    Xceed Support
    Member
    Post count: 5658

    Can you give me more information on your particular case?

    What is the View/Theme you are using on the DataGridControl?

    Do you have any custom styles set?

    Imported from legacy forums. Posted by Marcus [Xceed] (had 288 views)

    User (Old forums)
    Member
    Post count: 23064

    I’m using the TableView with no specific theme…

    here is my code…

    <Style TargetType=”{x:Type xcdg:DataRow}”>
    <Style.Triggers>
    <Trigger Property=”IsSelected” Value=”true”>
    <Setter Property = “BorderBrush” Value=”{StaticResource OrangeStyle}” />

    </Trigger>
    </Style.Triggers>
    <Setter Property=”Control.BorderThickness” Value=”2″ />
    <Setter Property=”Control.BorderBrush”>
    <Setter.Value>
    <SolidColorBrush Opacity=”0″ />
    </Setter.Value>
    </Setter>
    </Style>

    If I try to change the background or foreground on the trigger it doesn’t work. It actually changed the selected Cell so i changed the CurrentBackground on the DataCell and it worked but it keeps changing the font on the others cells of the row.

    Imported from legacy forums. Posted by Lilian (had 427 views)

    Xceed Support
    Member
    Post count: 5658

    What is your operating system theme?

    Imported from legacy forums. Posted by Marcus [Xceed] (had 347 views)

    User (Old forums)
    Member
    Post count: 23064

    Default XP style

    Imported from legacy forums. Posted by Lilian (had 289 views)

    Xceed Support
    Member
    Post count: 5658

    OK, I cross-checked everything, to make sure the answer would be valid…

    You don’t actually need to put particular triggers in the row style to change how the “hightlight” is done. In your case, changing the following properties:

    -SelectionBackground
    -SelectionForeground
    -InactiveSelectionBackground
    -InactiveSelectionForeground

    Should be enough.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 1174 views)

    User (Old forums)
    Member
    Post count: 23064

    It worked out perfect!

    Thanks!

    Imported from legacy forums. Posted by Lilian (had 5658 views)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.