Welcome Guest Search | Active Topics | Sign In | Register

Grid Header Multiple Lines Options
Jim Nelson
Posted: Friday, March 11, 2011 3:07:50 PM
Rank: Member
Groups: Member

Joined: 9/1/2010
Posts: 28
Is there a way to have two header lines?

EX:
---- Shift 1 ----- ---- Shift 2----
Date Time1 Time2 Time1 Time2

1/1/2011 0700 1530 1500 2130
1/1/2011 0700 1530 1500 2130
1/1/2011 0700 1530 1500 2130
1/1/2011 0700 1530 1500 2130

thx
eo_support
Posted: Friday, March 11, 2011 3:20:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Depending on your scenario, I believe you can get very close to that. But it is not as straight forward. You will need to:

1. If you do not need to resize column, set ColumnHeaderVisible to false. If you need to resize column, customize your column header style so that it is shorter. The idea is you will no longer display column header text in the column header. It's only purpose is for you to resize columns;

2. Set your Grid's FixedTopItemCount to 2. These two items will be your "headers". You will need to fill cell values in these two items to display the "header text" rather than setting GridColumn's HeaderText. You may also want to style your fixed item differently so that visually they look like a header;

3. Use CellSpan on GridCell object to span a cell into multiple columns (in your case "Shift 1", "Shift 2" if necessary).

The key is fixed top items will not scroll when you scroll the Grid, but they are in your Items collection. However you will not be able to drag a fixed item to resize a column like you do with column header.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.