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

Hierarchical Column Alignment

5 Answers 224 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 08 Dec 2010, 04:14 PM
I've got a hierarchical grid bound to a dataset with AutoGenerateHierarchy set to true.I'm setting the column widths in the OnColumnCreated event handler by setting HeaderStyle.Width. ( note that tablelayout is set to fixed). so that the columns in each level of the hierarchy align.

This works fine except when there are fewer columns than needed to fill the width. In this case IE8, all the columns on each level of the hierarchy stretch to the page width and align (which isn't really the expected behaviour as I'm setting a fixed width, but looks ok as they align), whereas in the case of IE7 the columns in the master table stretch to the page width but the columns in the detail tables are rendering as the fixed width I have assigned programatically so master and detail columns are not aligning.

I need either all the columns to stretch and align in IE7 or (preferably) all the columns to render as the asigned fixed width on both master and detail tables in both IE7 and IE8. Any Suggestions?

Thanks in advance :)

5 Answers, 1 is accepted

Sort by
0
Philip
Top achievements
Rank 1
answered on 09 Dec 2010, 03:57 PM
It seems the columns do line up in IE7 when all columns are visible (I'm hiding a few columns). Is there any way to get all the columns to line up when some are hidden?
0
Pavlina
Telerik team
answered on 14 Dec 2010, 11:20 AM
Hello Philip,

Child tables are rendered as separate <table> elements inside the nested item of the parent table. Their columns are not aligned with their parent's. If you need parent and child table columns aligned, you need to set the HeaderStyle-Width of the columns in both the master and detail table to some value in pixels, so that column widths adjust respectively. Also, hiding columns works on a grid table level, so hiding parent items does not automatically resize detail tables and vice versa.

Kind regards,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Philip
Top achievements
Rank 1
answered on 14 Dec 2010, 11:45 AM
I am in fact setting the width of columns in code, in the ColumnCreated event, using column.HeaderStyle.Width programatically (which I assume has the same effect as HeaderStyle-Width?) but it doesn't seem to have an effect when the total width of the columns is less than that of the page width (the TableLayout is set to fixed). This only seems to be the case with the master table though, the detail table widths are being set as expected.
0
Philip
Top achievements
Rank 1
answered on 15 Dec 2010, 05:45 PM
I managed to resolve this be setting UseStaticHeaders to true, if anyone's interested.
0
Pavlina
Telerik team
answered on 20 Dec 2010, 12:19 PM
Hello Philip,

I am glad to hear that the problem was fixed. In case you experience other problems do not hesitate to contact us again.

Greetings,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Philip
Top achievements
Rank 1
Answers by
Philip
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or