Unplanned
Last Updated: 04 Jun 2026 12:08 by ADMIN
Christofer
Created on: 04 Jun 2026 11:32
Category: WatermarkTextBox
Type: Bug Report
0
WatermarkTextBox: Label row height not updated when FontSize changes while label is floated
In the current case, the font size is dynamically increased. While the label is floated, the label row size is not change to affect the font size changed.
1 comment
ADMIN
Dinko | Tech Support Engineer
Posted on: 04 Jun 2026 12:08

Hello Christofer,

Thank you for reporting this behavior. As a workaround, we can change the Height property of the PART_LabelRowDefinition inside the control.

private void ApplyScale(double delta)
{
    var resources = Application.Current.Resources;
    // Adjust size
    AdjustFontSize(resources, "FontSize.M",  delta);

    this.Dispatcher.InvokeAsync(() =>
    {
        foreach (var tb in this.ChildrenOfType<RadWatermarkTextBox>().Where(x => x.IsLabelFloated))
            FixLabelRowHeight(tb);
    }, DispatcherPriority.Loaded);
}

private static void FixLabelRowHeight(RadWatermarkTextBox tb)
{
    var rootGrid = tb.ChildrenOfType<Grid>().FirstOrDefault(g => g.Name == "RootElement");
    if (rootGrid == null) return;

    var labelEl = tb.ChildrenOfType<TelerikLabel>().FirstOrDefault(l => l.Name == "PART_LabelVisualElement");
    if (labelEl == null) return;

    RowDefinition? labelRow = rootGrid.RowDefinitions
        .FirstOrDefault(r => r.Name == "PART_LabelRowDefinition")
        ?? rootGrid.RowDefinitions.ElementAtOrDefault(Grid.GetRow(labelEl));

    if (labelRow == null) return;

    if (labelRow.Height != GridLength.Auto)
    {
        labelRow.Height = GridLength.Auto;
    }
}

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.