This is a migrated thread and some comments may be shown as answers.

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

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Trisha
Top achievements
Rank 1
Trisha asked on 25 Apr 2018, 02:50 PM

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?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 27 Apr 2018, 11:09 AM
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>
        </ClientSettings>
        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
        <MasterTableView>
            <Columns>
                <telerik:GridEditCommandColumn HeaderStyle-Width="50px"></telerik:GridEditCommandColumn>
                <telerik:GridTemplateColumn HeaderStyle-Width="50px">
                    <ItemTemplate>
                        <asp:Button Text="some button" runat="server" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridButtonColumn HeaderStyle-Width="50px" ButtonType="LinkButton" Text="some link button"></telerik:GridButtonColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</div>
<asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="SELECT TOP 25 CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers"
    runat="server"></asp:SqlDataSource>


Regards,
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.
Tags
Grid
Asked by
Trisha
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or