Addin A Row To Datagrid Header

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

Hello, I am trying to figure out how to add an extra row
of heading to my datagrid. I came up with the following
code:

Public Sub dgNewMovies_ItemCreated(ByVal sender As
Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgNewMovies.ItemCreated

If e.Item.ItemType = ListItemType.Header Then
Dim Item As DataGridItem
Dim ItemCell As TableCell
Item = New DataGridItem(0, 0,
ListItemType.Header)
ItemCell = New TableCell()
ItemCell.ColumnSpan = 7
Item.Cells.Add(ItemCell)
ItemCell.Text = "Add Movies And Tapes
DataEntry"
dgNewMovies.Controls(0).Controls.AddAt(0,
Item)
End If

End Sub

It runs through the code, but no additional heading - I
still have my original headings. Any idea what I am
doing wrong?
 
I got it to work, I don't know what I was doing wrong. I was guessing that
it might have to do with the fact that I was using headertemplates, but
that did not turn out to be the case.

Thanks for "sticking" with the issue!!!!!!!!
 
Back
Top