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

Table layout auto not working

1 Answer 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
marcus_m
Top achievements
Rank 1
marcus_m asked on 25 Feb 2013, 07:03 AM
Hi - I am populating a grid from a datatable, with AutoGenerateColumns=true. I have tried using the master table view Tablelayout=auto property and it still resizes the columns to equal widths despite having some columns with long text and others with id values.  I have client side column resizing turned on - could this be interfering with this working correctly?  Thanks for your help

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 28 Feb 2013, 10:53 AM
Hello Marcus,

You will need to set the columns width manually:
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
{
    if (e.Column.UniqueName == "ShipName")
    {
        e.Column.HeaderStyle.Width = Unit.Pixel(300);
    }
}

Alternatively, you can try the following approach:
http://www.telerik.com/help/aspnet-ajax/grid-gridcolumn-resizetofit.html

Hope this helps.

Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
marcus_m
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or