Question : Reference a selected rows column value from a gridview in VB .Net 3.5

I've been pulling my hair out for hours, so hoping someone can point me in the right direction. I cannot seem to find how to reference the text value of a cell of a selected row in a gridview using VB. Here is what I've attempted so far:

Below is what I have in code behind, which runs without error but when I click the GridView's edit it returns a null value. I thought this to be a binding issue so I setup a binding method for the gridview so I could manually bind before or after returning the column value, but where ever I placed the binding method it always returned a null value.

    Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing
        Dim MyCellValue As String
       MyCellValue = GridView1.Rows(e.NewEditIndex).Cells(1).Text
'Textbox used to display contents of selected gridview column
MyTextBox.Text = MyCellValue

    End Sub

Answer : Reference a selected rows column value from a gridview in VB .Net 3.5

Do you have the CONVERT NULL DATES TO DEFAULT option set?

Open the report
Click FILE --> REPORT OPTIONS
Is the option CONVERT DATABASE VALUES TO DEFAULT checked?

Is the database actually returning that date?

You could also suppress the value with a formula
Right click the field
Click FORMAT FIELD
Click the COMMON TAB
Click the FORMULA BUTTON to the right of suppress
{YourField} = Date(1900,1,1)

mlmcc
Random Solutions  
 
programming4us programming4us