A
AMD Desktop
Hi,
I need to add a header to a datagrid.
This is the code I am trying to use:
Dim dgStaffingReport As New DataGrid
Dim dgitem As New DataGridItem(0, 0, ListItemType.Header)
Dim mycell As New TableCell()
mycell.ColumnSpan = 2
mycell.Text = "Staff"
dgitem.Cells.Add(mycell)
dgStaffingReport.Controls(0).Controls.AddAt(0, dgitem)
And this is the error I am getting (index of the AddAt method, pretty
standard...):
Exception Details: System.ArgumentOutOfRangeException: Specified argument
was out of the range of valid values. Parameter name: index
Source Error:
Line 175: mycell.Text = "This Is the top level header item spanning two
columns!"
Line 176: dgitem.Cells.Add(mycell)
Line 177: dgStaffingReport.Controls(0).Controls.AddAt(0, dgitem)
Line 178:
Line 179:
Any idea why. Can anyone help?
Thank you
I need to add a header to a datagrid.
This is the code I am trying to use:
Dim dgStaffingReport As New DataGrid
Dim dgitem As New DataGridItem(0, 0, ListItemType.Header)
Dim mycell As New TableCell()
mycell.ColumnSpan = 2
mycell.Text = "Staff"
dgitem.Cells.Add(mycell)
dgStaffingReport.Controls(0).Controls.AddAt(0, dgitem)
And this is the error I am getting (index of the AddAt method, pretty
standard...):
Exception Details: System.ArgumentOutOfRangeException: Specified argument
was out of the range of valid values. Parameter name: index
Source Error:
Line 175: mycell.Text = "This Is the top level header item spanning two
columns!"
Line 176: dgitem.Cells.Add(mycell)
Line 177: dgStaffingReport.Controls(0).Controls.AddAt(0, dgitem)
Line 178:
Line 179:
Any idea why. Can anyone help?
Thank you