Thanks Cor!
I tried it and indeed it goes very smooth, hehe :-)
Once again I was looking to far and made it too complicated, hehe :-)
Thanks a lot! And enjoy the sun overthere! Here below it's sunny too :-)
Pieter
"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:%23ukGqW$(E-Mail Removed)...
> Hi Pieter,
>
> I was curious and made this, in my idea this goes in batches, what is it
you
> want to archieve what you said, however it goins very smooth on this sunny
> day here.
>
> :-)
>
> Cor
>
> Dim dt As DataTable
> Private Sub Form1_Load(ByVal sender As Object, _
> ByVal e As System.EventArgs) Handles MyBase.Load
> dt = New DataTable("Pieter")
> dt.Columns.Add("Time", GetType(System.DateTime))
> DataGrid1.DataSource = dt
> Dim ts As New DataGridTableStyle
> ts.MappingName = "Pieter"
> Dim column As New DataGridTextBoxColumn
> ts.GridColumnStyles.Add(column)
> DataGrid1.TableStyles.Add(ts)
> column.MappingName = "Time"
> column.HeaderText = "Tijd"
> column.Width = 50
> column.Format = ("HH:mm:ss")
> End Sub
> Private Sub Timer1_Tick(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) Handles Timer1.Tick
> For i As Integer = 0 To 20
> Dim dr As DataRow = dt.NewRow
> dr(0) = Now
> dt.Rows.Add(dr)
> DataGrid1.ScrollToRow(dt.Rows.Count - 1)
> Next
> End Sub
> End Class
> Public Class MyDataGrid
> Inherits DataGrid
> Sub ScrollToRow(ByVal row As Integer)
> If Not Me.DataSource Is Nothing Then
> Me.GridVScrolled(Me, _
> New ScrollEventArgs(ScrollEventType.LargeIncrement, row))
> End If
> End Sub
> End Class
>
>
>
>
|