Thread: DataGrid...
View Single Post
 
Old April 11th, 2006, 10:52 AM
mrideout mrideout is offline
Authorized User
 
Join Date: Jul 2004
Location: St. John\'s, NL, Canada.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataGrid...

Hello,
I have a datagrid in which I click a user's name and get a another datagrid
(DG2) displaying all records for that individual user. In DG2 I need to check
the Due Date colunm to ensure due dates are correctly if not I write out to
the screen a little message. My problem is when I select teh due date column
I get the column header has well, but I only need the contains of the cells
NOT the header.
My code for this routine is:
 Sub SetDueDateColor(ByVal s As Object, ByVal e As DataGridItemEventArgs)

        Dim strSQL, strDate As String
        Dim datNowDate, datDueDate, datReturnDate As DateTime

        datDueDate = e.Item.Cells(7).Text

        If Now.DayOfWeek = DayOfWeek.Tuesday Then
            datNowDate = Now.AddDays(7)

            If strSQL > strDate Then
                Response.Write("Due date is Over")
            Else
                Response.Write("Due date is fine")
            End If
        End If

    End Sub


On the line "datDueDate = e.Item.Cells(7).Text", the column header "DUE" is
not a date, so I get an error.
Is there a way for NOT selecting the column header? Or another way of doing
this?
Thanks in advance!
MGR