With timer to next checkbox in datagridview

  • Thread starter Thread starter KeesBlunder
  • Start date Start date
K

KeesBlunder

Guest
Hello,

Is it possible to go with a timer to the next Checkbox in a datagridview every 3 seconds ?

Load Checkbox in Formload

Dim chk As DataGridViewCheckBoxColumn = New DataGridViewCheckBoxColumn()
DataGridView1.Columns.Add(chk)
chk.HeaderText = "Bekijken"
chk.Name = "chk"

And in CellContentClick , i load some data from the datagridview in some textboxes

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

If e.ColumnIndex = 0 AndAlso e.RowIndex >= 0 Then
For Each row As DataGridViewRow In DataGridView1.Rows
row.Cells(e.ColumnIndex).Value = False
Next
End If
Dim senderGrid As DataGridView = sender
Dim data = senderGrid.Rows(e.RowIndex).DataBoundItem

If senderGrid.Columns(e.ColumnIndex).GetType() Is GetType(DataGridViewCheckBoxColumn) And e.RowIndex >= 0 Then

TextBox1.Text = DataGridView1.CurrentRow.Cells("Naam").Value.ToString()
TextBox3.Text = DataGridView1.CurrentRow.Cells("Imo").Value.ToString()
TextBox4.Text = DataGridView1.CurrentRow.Cells("Vlag").Value.ToString()
TextBox2.Text = DataGridView1.CurrentRow.Cells("Datum").Value.ToString()
TextBox5.Text = DataGridView1.CurrentRow.Cells("Adres").Value.ToString()
TextBox6.Text = DataGridView1.CurrentRow.Cells("City").Value.ToString()
TextBox7.Text = DataGridView1.CurrentRow.Cells("Country").Value.ToString()
TextBox8.Text = DataGridView1.CurrentRow.Cells("Customer").Value.ToString()
TextBox10.Text = DataGridView1.CurrentRow.Cells("Aankoppeling").Value.ToString()
TextBox9.Text = DataGridView1.CurrentRow.Cells("Ton").Value.ToString()
TextBox11.Text = DataGridView1.CurrentRow.Cells("Bijzonderheden").Value.ToString()
Databaseid.Text = DataGridView1.CurrentRow.Cells("Id").Value.ToString()

If con.State = ConnectionState.Open Then con.Close()

End If

End Sub

When i click the data from the datagridview go's to the textboxes .

Or is it beter to load the textboxes form the database every 3 seconds ?

Continue reading...
 
Back
Top