ASPxGridView header and subheader
Hello I currently use the ASPxGridView from DevExpress (2010 v1). Has anyone had any success creating double headers where the first set of h开发者_如何转开发eaders span across multiple subheaders?
HeaderSpanColumn1
------- ------- -------
header1| header2| header3
------- ------- -------
3 4 bob
There doesn't seem to be much verbage about this on their support site since it isn't officially supported.
For the columns you can use the HeaderCaptionTemplate:
<dxwgv:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="AccessDataSource1" KeyFieldName="CustomerID">
<Columns>
<dxwgv:GridViewDataTextColumn FieldName="CustomerID" ReadOnly="True" VisibleIndex="0">
<HeaderCaptionTemplate>
<table>
<tr align="center">
<td colspan="2">
1o Semester</td>
</tr>
<tr align="center">
<td style="width: 100px">
1o Exam</td>
<td style="width: 100px">
2o Exam</td>
</tr>
</table>
</HeaderCaptionTemplate>
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn FieldName="CompanyName" VisibleIndex="1">
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn FieldName="City" VisibleIndex="2">
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn FieldName="Country" VisibleIndex="3">
</dxwgv:GridViewDataTextColumn>
</Columns>
</dxwgv:ASPxGridView>
This suggestion is also worth tracking: Suggestion Details: ASPXGridView - support bands (multi-header columns)
In the upcoming 2011.1 release, DevExpress Grid will have this feature out of the box! Read the Mehul's blog post for details.
精彩评论