Home Forums WPF controls Xceed DataGrid for WPF Applying a Named Style to a DataRow

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

    I’ve seen numerous examples in the documentation of applying a style to a data row, but in each case the TargetType of the style is set to DataRow without supplying a Key — meaning that the style is applied to all grids in scope.

    My situation is different. I have a NAMED style called “SpecialStyle” with a target type of DataRow that is declared at the Application level. I now want to apply that style to the DataRows in a specific DataGridcontrol in my Window. I know I’ll need to make a {DynamicResource} call, but what is the syntax to apply it?

    Thanks,

    Mungle

    Imported from legacy forums. Posted by Mungle Goonfry (had 2328 views)

    Xceed Support
    Member
    Post count: 5658

    You can assign the style to the grid’s ItemContainerStyle property.

    ItemContainerStyle={StaticResource myStyle}

    Imported from legacy forums. Posted by Jenny [Xceed] (had 188 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks, Jenny. That worked.

    Imported from legacy forums. Posted by Mungle Goonfry (had 3334 views)

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