'for clear the date value Sub clear() dtpDOJ.Text = " " End sub 'for return value to datetime picker when datagridview is clicked Private Sub dgvdatakaryawan_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvdatakaryawan.CellContentClick Dim i As Integer Dim n As Integer = dgvdatakaryawan.Rows.Count If n = 0 Then Call clear() Else Try i = dgvdatakaryawan.CurrentRow.Index dtpDOJ.Text = dgvdatakaryawan.Item(1, i).Value Catch ex As Exception End Try End If End Sub 'this is property of datetimepicker Private Sub dtpDOJ_ValueChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtpDOJ.ValueChanged Me.dtpDOJ.Format = Windows.Forms.DateTimePickerFormat.Custom Me.dtpDOJ.CustomFormat = "dd MMMM yyyy" End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)