Home Forums WPF controls Xceed DataGrid for WPF Group By Header Area

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

    I have tried numerous ways of updating/styling the Group By Header Area (The area where you drag the columns into) but I have had no luck in accomplishing it. I basically want to change the background color and possibly the shape of the columns once they are placed in there. Any ideas?

    Imported from legacy forums. Posted by keith (had 3049 views)

    User (Old forums)
    Member
    Post count: 23064

    <Style TargetType=”xcdg:GroupByControl”>
    <Setter Property=”Background” Value=”LightBlue” />
    </Style>

    <Style TargetType=”xcdg:GroupByItem”>
    <Setter Property=”Background” Value=”Pink” />
    </Style>

    Imported from legacy forums. Posted by Pascal (had 336 views)

    User (Old forums)
    Member
    Post count: 23064

    When I run the following code, shouldnt the target type apply to the control since it is typed and not named? Nothing happens to these controls. Please advise.

    <Grid>
    <Grid.Resources>
    <x:Array x:Name=”WeekDays” x:Key=”data_list” Type=”{x:Type s:String}”>
    <s:String>Sunday</s:String>
    <s:String>Monday</s:String>
    <s:String>Tuesday</s:String>
    <s:String>Wednesday</s:String>
    <s:String>Thursday</s:String>
    <s:String>Friday</s:String>
    <s:String>Saturday</s:String>
    </x:Array>
    <Style TargetType=”xcdg:GroupByControl”>
    <Setter Property=”Background” Value=”LightBlue” />
    </Style>
    <Style TargetType=”xcdg:GroupByItem”>
    <Setter Property=”Background” Value=”Pink” />
    </Style>
    </Grid.Resources>
    <xcdg:DataGridControl x:Name=”OrdersGrid” ItemsSource=”{StaticResource data_list}”/>
    </Grid>

    Imported from legacy forums. Posted by keith (had 307 views)

    User (Old forums)
    Member
    Post count: 23064

    Is you DataGrid displayed using the Aero theme? If so, that would explain why the styles for GroupByControl/GroupByItem don’t work…

    The reason is because in the templates for these controls for the aero theme, the Background is composed of a complex VisualTree which cannot be expressed by a simple Brush, so that VisualTree is hard-coded in the template and ignores the value of the Background property on the control itself.

    To change the appearance of these controls for the Aero theme, you need to override the ControlTemplate.

    Imported from legacy forums. Posted by Pascal (had 4511 views)

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