Home Forums WPF controls Xceed DataGrid for WPF Custom ColumnManagerCell look

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

    I’m new to using the xceed data grid and i’m trying customize the ColumnManagerCell the look i’m after is to display my column headers on a black background. Using the following xml code the background of the ColumnHeaders is still the default gray not the black that i’m after.

    <Style TargetType=”{x:Type Custom:ColumnManagerCell}”>
    <Setter Property=”Background”>
    <Setter.Value>
    <SolidColorBrush Color=”Black”/>
    </Setter.Value>
    </Setter>

    <Setter Property=”Template”>
    <Setter.Value>
    <ControlTemplate TargetType=”{x:Type Custom:ColumnManagerCell}”>
    <Border Background=”Gray” CornerRadius=”5,5,5,5″>
    <ContentPresenter/>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>

    </Style>

    Imported from legacy forums. Posted by John (had 3910 views)

    User (Old forums)
    Member
    Post count: 23064

    Try this…

    <Style TargetType=”{x:Type xcdg:ColumnManagerCell}”>
    <Setter Property=”Foreground”>
    <Setter.Value>
    <SolidColorBrush Color=”White”/>
    </Setter.Value>
    </Setter>

    <Setter Property=”Template”>
    <Setter.Value>
    <ControlTemplate TargetType=”{x:Type xcdg:ColumnManagerCell}”>
    <Border Background=”Black” CornerRadius=”5,5,5,5″>
    <ContentPresenter/>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>

    </Style>

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

    User (Old forums)
    Member
    Post count: 23064

    Nope that was not it.

    Imported from legacy forums. Posted by John (had 253 views)

    User (Old forums)
    Member
    Post count: 23064

    What effect are you getting? I tried it and I get white text on a black background with rounded edges.

    Imported from legacy forums. Posted by RJ (had 305 views)

    User (Old forums)
    Member
    Post count: 23064

    I think I have it now! Try this and let me know how it worked for you.

    <Style x:Key=”headerStyle”>
    <Setter Property=”Border.Background” Value=”Black”/>
    <Setter Property=”Border.BorderBrush” Value=”Gray” />
    <Setter Property=”Border.BorderThickness” Value=”1″ />
    <Setter Property=”Border.CornerRadius” Value=”10″ />
    <Setter Property=”Border.Height” Value=”20″ />
    <Setter Property=”Border.Margin” Value=”1″ />
    <Setter Property=”Control.FontSize” Value=”13″ />
    <Setter Property=”Control.Foreground” Value=”DarkGreen” />
    </Style>

    <Style TargetType=”{x:Type xcdg:ColumnManagerCell}”>
    <Setter Property=”xcdg:ColumnManagerCell.Template”>
    <Setter.Value>
    <ControlTemplate>
    <Border Style=”{StaticResource headerStyle}”>
    <TextBlock
    Text=”{TemplateBinding xcdg:ColumnManagerCell.Content}”
    TextAlignment=”Center”
    VerticalAlignment=”Center” />
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>

    <Style TargetType=”{x:Type xcdg:ColumnManagerRow}”>
    <Setter Property=”Background” Value=”Black” />
    </Style>

    Imported from legacy forums. Posted by RJ (had 341 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks,
    That is closer, but I want the Border to be completely grey which is the shape set on a black background. This example has a black border outlined in grey sitting on top of black. I’m looking for gray border no outline sitting on black.

    Imported from legacy forums. Posted by John (had 5209 views)

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