Addin A Row To Datagrid Header

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?
 
J

Jim Heavey

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!!!!!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top