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

RadGrid resize column not working properly

1 Answer 373 Views
Grid
This is a migrated thread and some comments may be shown as answers.
amol
Top achievements
Rank 1
amol asked on 10 Apr 2014, 07:16 AM
Hi,

I have grid which contains 3 columns, when I resize first column remaining 2 column width also gets changed.

I am using below client setting for my grid

<Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" />

I don't want to change width of others column.

Currently grid has 100% width & only last column has fixed width.

If I set grid width fixed as well as those of 3 columns, then resizing works fine.

Is it bug in RadGrid resize functionality if we set grid width to 100%?

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 14 Apr 2014, 11:33 AM
Hello Amol,

The behavior that you are describing is not expected and the width of the grid should be changed in such scenario, even with Width property set to "100%".

I have tested the following RadGrid on my end and everything is working correctly with our latest version (2014.1 403):
<telerik:RadGrid runat="server" ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" Width="100%">
    <MasterTableView AutoGenerateColumns="false">
        <Columns>
            <telerik:GridBoundColumn DataField="ID"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="FirstName"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LastName" HeaderStyle-Width="200px"></telerik:GridBoundColumn>
        </Columns>             
    </MasterTableView>
    <ClientSettings>
        <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" />
    </ClientSettings>
</telerik:RadGrid>

And the code-behind:
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    DataTable table = new DataTable();
    table.Columns.Add("ID", typeof(int));
    table.Columns.Add("FirstName", typeof(string));
    table.Columns.Add("LastName", typeof(string));
    for (int i = 0; i < 5; i++)
    {
        table.Rows.Add(i, "FirstName" + i, "LastName" + i);
    }
 
    (sender as RadGrid).DataSource = table;
}

Please test the above on your side and see if everything is working correctly.

If you continue to experience that issue, please provide the markup of your grid and elaborate on the version you are currently using.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
amol
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or