I am using the below code to create a sub head in my gridview. I would like to display the sub heading but for some reason the link is still appearing in my sub heading rows. can someone help me how to remove the link from my sub heading rows and also how can i merge all the cells in my sub head rows. I have 6 columns in my gridview.
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="contid" DataNavigateUrlFormatString="advdetail.aspx?contid={0}"
Text="View Detail..." >
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Wrap="False" Font-Bold="True" Font-Italic="True" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:HyperLinkField>
<asp:BoundField DataField="Sp" HeaderText="S.P. Number">
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Font-Italic="True" Wrap="False" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Route Number" HeaderText="Route Number">
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Font-Italic="True" Wrap="False" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="DistrictId" HeaderText="District Name">
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Font-Italic="True" Wrap="False" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="LetDate" HeaderText="Letting Date">
<ItemStyle Font-Size="Smaller" Font-Italic="True" Wrap="False" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="FULLDESC" HeaderText="Other S.P(s),Route Number, Project Location, Work Type...">
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Font-Italic="True" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
</Columns>
Dim curSect As String = ""
Dim prevSect As String = ""
Dim i As Integer = 0
Do While i <= dsItem.Tables(0).Rows.Count - 1
curSect = dsItem.Tables(0).Rows(i).Item("LetDate")
If curSect <> prevSect Then
prevSect = curSect
Dim AddedRow As DataRow = dsItem.Tables(0).NewRow
AddedRow("Sp") = "Letting Date :" & dsItem.Tables(0).Rows(i).Item("LetDate")
'AddedRow("Sp") = "Letting"
dsItem.Tables(0).Rows.InsertAt(AddedRow, i)
i += 1
End If
i += 1
Loop
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="contid" DataNavigateUrlFormatString="advdetail.aspx?contid={0}"
Text="View Detail..." >
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Wrap="False" Font-Bold="True" Font-Italic="True" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:HyperLinkField>
<asp:BoundField DataField="Sp" HeaderText="S.P. Number">
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Font-Italic="True" Wrap="False" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Route Number" HeaderText="Route Number">
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Font-Italic="True" Wrap="False" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="DistrictId" HeaderText="District Name">
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Font-Italic="True" Wrap="False" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="LetDate" HeaderText="Letting Date">
<ItemStyle Font-Size="Smaller" Font-Italic="True" Wrap="False" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="FULLDESC" HeaderText="Other S.P(s),Route Number, Project Location, Work Type...">
<ItemStyle Font-Size="Smaller" HorizontalAlign="Left" Font-Italic="True" />
<HeaderStyle Font-Size="Smaller" HorizontalAlign="Left" />
</asp:BoundField>
</Columns>
Dim curSect As String = ""
Dim prevSect As String = ""
Dim i As Integer = 0
Do While i <= dsItem.Tables(0).Rows.Count - 1
curSect = dsItem.Tables(0).Rows(i).Item("LetDate")
If curSect <> prevSect Then
prevSect = curSect
Dim AddedRow As DataRow = dsItem.Tables(0).NewRow
AddedRow("Sp") = "Letting Date :" & dsItem.Tables(0).Rows(i).Item("LetDate")
'AddedRow("Sp") = "Letting"
dsItem.Tables(0).Rows.InsertAt(AddedRow, i)
i += 1
End If
i += 1
Loop