Declined
Last Updated: 19 Nov 2023 13:29 by ADMIN
Karim
Created on: 16 Nov 2023 15:11
Category: DataForm
Type: Bug Report
0
DataForm: Group header text is not centered when setting the style in the GroupGenerated event
When using the GroupGenerated event to apply style to the GroupHeaderLabel, the text in the group cannot be centered. 
2 comments
ADMIN
Didi
Posted on: 19 Nov 2023 13:29

Hi,

The status is changed to declined as the behavior is not related to the DataForm control.

The correct way to align the text in the group header is as follow:

this.dataForm.GroupGenerated += (sender, eventArgs) =>
{
    eventArgs.Group.HeaderLabelStyle = new Style(typeof(Label))
    {
        Setters =
        {
            new Setter
            {
                Property = Label.HorizontalTextAlignmentProperty,
                Value = TextAlignment.Center
            },
            new Setter
            {
                Property = Label.VerticalTextAlignmentProperty,
                Value = TextAlignment.Center
            }
        }
    };
};

Regards,
Didi
Progress Telerik

A brand new .NET MAUI course was just added to the Virtual Classroom. The training course is developed to help you get started with the Telerik UI for .NET MAUI components and features. It aims to put you in the shoes of an engineer who adds new features to an existing application. You can check it out at https://learn.telerik.com
ADMIN
Didi
Posted on: 16 Nov 2023 15:44

Workaround:

Set the style and groups in xaml

Regards,
Didi
Progress Telerik

A brand new .NET MAUI course was just added to the Virtual Classroom. The training course is developed to help you get started with the Telerik UI for .NET MAUI components and features. It aims to put you in the shoes of an engineer who adds new features to an existing application. You can check it out at https://learn.telerik.com