Right now my code below shows the column headers and row headers when loaded..However, when I bring the table up I want the table to be completely editable so that you can type in it. Any ideas of how to do that?
Public Sub GetChartDataGrid()
SqlChart.SelectCommand = "SELECT NAMES, vacAccrued, vacUsed, vacBalance, perAccrued" & _
"FROM EMPLOYEES" & _
"WHERE (NAMES = ?)'" & lblName.Text & "'"
Dim dt As New DataTable()
dt.Columns.Add(New DataColumn("Accrued", GetType(Integer)))
dt.Columns.Add(New DataColumn("Used", GetType(Integer)))
dt.Columns.Add(New DataColumn("Balance", GetType(Integer)))
dt.Columns.Add(New DataColumn("Accrued ", GetType(Integer)))
dt.Columns.Add(New DataColumn("Used ", GetType(Integer)))
dt.Columns.Add(New DataColumn("Balance ", GetType(Integer)))
dt.Columns.Add(New DataColumn("Total Balance", GetType(Integer)))
dt.Columns.Add(New DataColumn("Sick", GetType(Integer)))
dt.Columns.Add(New DataColumn("Other", GetType(Integer)))
For j As Int16 = 1 To 13
Dim dr As DataRow = dt.NewRow()
For i As Int16 = 0 To 8
dr(i) = 0
Next i
dt.Rows.Add(dr)
Next j
GridViewChart.DataSource = dt
GridViewChart.DataBind()
End Sub
Private Sub GridViewChart_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GridViewChart.RowDataBound
Dim mons() As String = {"January", "February", "March", "April", "May", "June", "July", "August", "September",
"October", "November", "December", "Years Totals"}
If e.Row.RowType = DataControlRowType.DataRow Then
Dim lblRowHdr As Label = DirectCast(e.Row.FindControl("lblRowHdr"), Label)
lblRowHdr.Text = mons(e.Row.RowIndex)
End If
End Sub