Allowing grid to resize to widow width on load except for one column

2 posts, 0 answers
  1. Trisha
    Trisha avatar
    2 posts
    Member since:
    Feb 2018

    Posted 25 Apr 2018 Link to this post

    Each column has a set width by setting HeaderStyle-Width. for the Resizing i also have <Resizing AllowRowResize="False" AllowColumnResize="True" EnableRealTimeResize="True"
    ResizeGridOnColumnResize="False" AllowResizeToFit="true"   ></Resizing>.


    There is a certian column i have that is just a button and i would really like it be a certian width all the time whille all the other column adjust to the screen size (if screen is larger than the grid)


    Is there a way to do this in telerik or is this a feature i would have to request?

  2. Marin Bratanov
    Marin Bratanov avatar
    5315 posts

    Posted 27 Apr 2018 Link to this post

    Hello Trisha,

    Setting a fixed width on a column will keep it from resizing. Here is a basic example and below is attached a video that shows the expected behavior.

    <div style="width: 80%">
        <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" AllowPaging="True"
            GridLines="None" PageSize="10">
            <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                <Resizing AllowRowResize="False" AllowColumnResize="True" EnableRealTimeResize="True"
                    ResizeGridOnColumnResize="False" AllowResizeToFit="true"></Resizing>
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                    <telerik:GridEditCommandColumn HeaderStyle-Width="50px"></telerik:GridEditCommandColumn>
                    <telerik:GridTemplateColumn HeaderStyle-Width="50px">
                            <asp:Button Text="some button" runat="server" />
                    <telerik:GridButtonColumn HeaderStyle-Width="50px" ButtonType="LinkButton" Text="some link button"></telerik:GridButtonColumn>
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT TOP 25 CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers"

    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top