Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Programmatically resize all Columns

$
0
0

Hi, I tried below code and it works fine.

ASP

<telerik:RadGrid id="RadGrid1" runat="server">

    <ClientSettings>
        <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" AllowResizeToFit="true" />
    </ClientSettings>
</telerik:RadGrid>

Javascript:
<script type="text/javascript">
    function pageLoad() {
        var grid = $find("<%= RadGrid1.ClientID %>");
        var columns = grid.get_masterTableView().get_columns();
        for (var i = 0; i < columns.length; i++) {
            columns[i].resizeToFit();
        }
    }
 </script>

 

The problem is, when you have multiple RadGrid in RadTabStrip, it only works on the RadGrid in the first selected tab/pageview.

Hoy to autofit the RadGrid that sits in the other tab/page view?

Anyone can help?


Viewing all articles
Browse latest Browse all 78072

Trending Articles