Get actual TreeList Column Width

1 Answer 10 Views
TreeList
Scott
Top achievements
Rank 1
Scott asked on 05 Sep 2025, 04:55 PM
I have a TreeList with a column width set to "auto."  Unless I change something with the state of the TreeList, the state shows the width of the column is "auto" but I can't find the actual width.  Is there a way to get the actual width of the column without resizing, sorting, etc?

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 09 Sep 2025, 12:21 PM

Hello Scott,

There is currently no built-in API or property in the Telerik UI for Blazor TreeList that directly exposes the actual rendered pixel width of a column when its width is set to "auto." The TreeList state will continue to show "auto" until a user action (like resizing or sorting) updates it, but it does not provide the computed pixel value automatically.

How to Get the Actual Rendered Width:

To obtain the pixel width of a column set to "auto," you can use JavaScript interop to inspect the DOM after the TreeList has rendered:

Example JavaScript function:

function getColumnWidth(selector) {
    var element = document.querySelector(selector);
    return element ? element.offsetWidth : null;
}

You can call this JavaScript function from your Blazor component using IJSRuntime after the TreeList has rendered.

I hope the provided information serves you well.

    Regards,
    Tsvetomir
    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.

    Tags
    TreeList
    Asked by
    Scott
    Top achievements
    Rank 1
    Answers by
    Tsvetomir
    Telerik team
    Share this question
    or