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

[Solved] UseStaticHeaders - Headers Not Filling Grid

6 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
LAURA BERGERON
Top achievements
Rank 1
LAURA BERGERON asked on 07 Dec 2009, 05:20 PM
I am experiencing an issue when using UseStaticHeaders="true". The headers do not fill the width of the grid and are therefore misaligned with the columns which are auto-sized. When clicking on a header to sort the column, the issue is resolved. TableLayout="Auto" on MasterTableView - I have tried all of the things recommended in similar posts but have not had success. The issue does not occur in Firefox, but occurs in IE 7,8

6 Answers, 1 is accepted

Sort by
0
LAURA BERGERON
Top achievements
Rank 1
answered on 07 Dec 2009, 05:50 PM
Update - it only happens on a page with two grids. When the last grid is drawn, if it's width exceeds the page it causes the issue on the previous grid.
0
Pavlina
Telerik team
answered on 07 Dec 2009, 05:58 PM
Hi LAURA,

I would suggest that you set column widths explicitly, according to your preference and control datasource, so that the control's layout and available space are used optimally.

Let us know if you need more information.

All the best,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
LAURA BERGERON
Top achievements
Rank 1
answered on 07 Dec 2009, 06:06 PM
I would prefer auto layout - I don't care how wide the grids get....there is approx. 25 columns and they can all contain alot of data.
0
Pavlina
Telerik team
answered on 08 Dec 2009, 10:20 AM
Hi LAURA,

Please note that when scrolling is enabled and UseStaticHeaders is True, the grid columns should declare HeaderStyle.Width.
For more information, please refer to the following articles:
Scroll with static headers
Scrolling
 
All the best,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Chris McGrath
Top achievements
Rank 1
answered on 02 Feb 2010, 05:06 PM
Hello, I'm having a similar problem.  I have a grid that I want to be resizable by the user as they resize their window.  The headers should stay at the top of the page as they scroll up and down through the data, but the headers and columns should resize automatically if the user changes the size of the window.

Right now I can have one or the other:  A grid that autosizes perfectly, but the headers scroll off the screen (UseStaticHeaders = False); or a grid where the headers stay put but the columns don't change size when the grid is resized (UseStaticHeaders = True).  Both of these have one feature I want, but I cannot get them to work together.

Is this possible?  The only answer I have heard so far is to manually set the widths, but this is not what I want to do because I prefer the autosized columns.  The only other idea I have is to use javascript to resize all the columns when the grid itself is resized, but this would require a lot of extra code and would be difficult to match the perfect sizes that radgrid determines on its own.

It seems that these two things should be separate properties: UseStaticHeaders and FixedColumnWidths or something. =)
0
Pavlina
Telerik team
answered on 03 Feb 2010, 11:11 AM
Hello Chris,

Please find attached a simple runnable project which handles the desired functionality. Give it a try and  let me know if it works for you.

I hope this helps.

Regards,
Pavlina
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Grid
Asked by
LAURA BERGERON
Top achievements
Rank 1
Answers by
LAURA BERGERON
Top achievements
Rank 1
Pavlina
Telerik team
Chris McGrath
Top achievements
Rank 1
Share this question
or