Question radiobutton and the DateTimePicker Please

elianeasmar

Well-known member
Joined
Oct 3, 2013
Messages
76
Programming Experience
Beginner
Hello :)
I need you help in something.
i have a DataGridView. What i need is when i double click a certain row, the record will be displayed in the texboxes,radiobuttons and comboboxes that i have in my from.
i succeded to do it for the texboxes and comboboxes

Private Sub DataGridView1_CellMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseDoubleClick
        If e.RowIndex >= 0 AndAlso e.ColumnIndex >= 0 Then
            Dim selectedRow = DataGridView1.Rows(e.RowIndex)
            txtCode.Text = selectedRow.Cells(0).Value
            txtName.Text = selectedRow.Cells(1).Value
            cmbPosition.Text = selectedRow.Cells(3).Value
            cmbTitle.Text = selectedRow.Cells(4).Value
            txtPhoneNumber.Text = selectedRow.Cells(5).Value
            txtAddress.Text = selectedRow.Cells(6).Value
            End If


    End Sub

It's working. so I need your help in the radiobutton and the DateTimePicker Please.
I tried these lines but no positiv result :/
If selectedRow.Cells(2).Value = Female Then
                RDFemale.PerformClick()
            Else
                If selectedRow.Cells(2).Value = Male Then
                    RDMale.PerformClick()
                End If
            End If
DateTimePicker1 = selectedRow.Cells(7).Value
        

Thank you :)
 
Last edited by a moderator:
Hi,

When you want to set the RadioBottons you need to set the Checked Property and when you want to set the DataTimePicker then you need to set the Value property.

Hope that helps.

Cheers,

Ian

BTW, when posting code please do remember to encase your code in Code Tags for readability.
 
Back
Top