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

RadGrid horizontal scrolling with too many columns

1 Answer 272 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Oleksandr
Top achievements
Rank 1
Oleksandr asked on 29 Oct 2010, 01:48 AM
Hi,

On my page I have a RadGrid control and I am creating columns dynamically. Also I have a child grid which suppose to be displayed for some records when user hits expand column. Now the problem I am facing is that the horizontal scroll is not displayed when the ExpandCollapse column is visible and the grid is trying to fit all the columns within page width which causing headers and data to overlap. When I am hiding ExpandCollapse column on ColumnCreated event all alignments and horizontal scrolling works as expected.
Any help is appreciated.

I'm using a 2008.3.1314.35 version of Rad Controls

Thank you.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 29 Oct 2010, 02:42 PM
Hi Oleksandr,

When using RadGrid scrolling with static headers, the MasterTableView's TableLayout is "Auto", unless one or more columns have explicit width. In this case the TableLayout becomes "Fixed" and all columns with no explicit width squeeze to fit in the MasterTableView. In your case the column with explicit width is the hierarchy expand/collapse column.

You should either set explicit column widths or a pixel width to the MasterTableView. An alternative approach is to remove the expand column's width at runtime, but this will most probably make it wider than usual:

C#

protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
{
    if (e.Column is GridExpandColumn)
    {
        e.Column.HeaderStyle.Width = Unit.Empty;
    }
}

More on column widths:

http://www.telerik.com/community/forums/aspnet/grid/best-practice-for-grid-and-column-widths.aspx

Greetings,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Oleksandr
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or