Private Sub DataGrid1_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemCreated
If e.Item.ItemType = ListItemType.Header Then
e.Item.Cells(0).RowSpan = 2
e.Item.Cells(1).RowSpan = 2
e.Item.Cells(2).RowSpan = 2
e.Item.Cells(3).ColumnSpan = 12
e.Item.Cells(3).HorizontalAlign = HorizontalAlign.Center
Dim TmpTd As String = "尺 码</td><td RowSpan = 2>总数</td> </tr>"
TmpTd = TmpTd & "<tr><td class=""Headstyle"" align=""center"" valign=""top"">24<br>99</td>
<td class=""Headstyle"" align=""center"" valign=""top"">25</td>"
TmpTd = TmpTd & "<td class=""Headstyle"" align=""center"" valign=""top"">26<br>XS</td>
<td class=""Headstyle"" align=""center"" valign=""top"">27<br>S</td>"
TmpTd = TmpTd & " <td class=""Headstyle"" align=""center"" valign=""top"">28<br>M</td>
<td class=""Headstyle"" align=""center"" valign=""top"">29<br>L</td>"
TmpTd = TmpTd & "<td class=""Headstyle"" align=""center"" valign=""top"">30<br>XL</td>
<td class=""Headstyle"" align=""center"" valign=""top"">31<br> XXL</td>"
TmpTd = TmpTd & "<td class=""Headstyle"" align=""center"" valign=""top"">32</td>
<td class=""Headstyle"" align=""center"" valign=""top"">34</td>"
TmpTd = TmpTd & "<td class=""Headstyle"" align=""center"" valign=""top"">36</td>
<td class=""Headstyle"" align=""center"" valign=""top"">38</td></tr><tr><td>"
e.Item.Cells(3).Text = TmpTd
e.Item.Cells(4).Visible = False
e.Item.Cells(5).Visible = False
e.Item.Cells(6).Visible = False
e.Item.Cells(7).Visible = False
e.Item.Cells(8).Visible = False
e.Item.Cells(9).Visible = False
e.Item.Cells(10).Visible = False
e.Item.Cells(11).Visible = False
e.Item.Cells(12).Visible = False
e.Item.Cells(13).Visible = False
e.Item.Cells(14).Visible = False
e.Item.Cells(15).Visible = False
End If
If e.Item.ItemType = ListItemType.Header Then
e.Item.Cells(0).RowSpan = 2
e.Item.Cells(1).RowSpan = 2
e.Item.Cells(2).RowSpan = 2
e.Item.Cells(3).ColumnSpan = 12
e.Item.Cells(3).HorizontalAlign = HorizontalAlign.Center
Dim TmpTd As String = "尺 码</td><td RowSpan = 2>总数</td> </tr>"
TmpTd = TmpTd & "<tr><td class=""Headstyle"" align=""center"" valign=""top"">24<br>99</td>
<td class=""Headstyle"" align=""center"" valign=""top"">25</td>"
TmpTd = TmpTd & "<td class=""Headstyle"" align=""center"" valign=""top"">26<br>XS</td>
<td class=""Headstyle"" align=""center"" valign=""top"">27<br>S</td>"
TmpTd = TmpTd & " <td class=""Headstyle"" align=""center"" valign=""top"">28<br>M</td>
<td class=""Headstyle"" align=""center"" valign=""top"">29<br>L</td>"
TmpTd = TmpTd & "<td class=""Headstyle"" align=""center"" valign=""top"">30<br>XL</td>
<td class=""Headstyle"" align=""center"" valign=""top"">31<br> XXL</td>"
TmpTd = TmpTd & "<td class=""Headstyle"" align=""center"" valign=""top"">32</td>
<td class=""Headstyle"" align=""center"" valign=""top"">34</td>"
TmpTd = TmpTd & "<td class=""Headstyle"" align=""center"" valign=""top"">36</td>
<td class=""Headstyle"" align=""center"" valign=""top"">38</td></tr><tr><td>"
e.Item.Cells(3).Text = TmpTd
e.Item.Cells(4).Visible = False
e.Item.Cells(5).Visible = False
e.Item.Cells(6).Visible = False
e.Item.Cells(7).Visible = False
e.Item.Cells(8).Visible = False
e.Item.Cells(9).Visible = False
e.Item.Cells(10).Visible = False
e.Item.Cells(11).Visible = False
e.Item.Cells(12).Visible = False
e.Item.Cells(13).Visible = False
e.Item.Cells(14).Visible = False
e.Item.Cells(15).Visible = False
End If
demo img Url: http://myx.name/demo/demoimg/GridHead.jpg