A
Attaf
Guest
I have DataTable and I view it in grid for read only, but in background (but on Main Thread) I watch the source data to track data change, when the source data change I change the Datatable, and tell the grid to refresh view in some how.
I want to make background refresh faster.
This is my code.
Private dtView As DataTable
Public Sub RefreshRows(dtChangedRows As DataTable)
Dim Cols = dtView.Columns
For i = 0 To dtChangedRows.Rows.Count - 1
Dim SR = dtChangedRows(i)
Dim ID As String = SR("Name").ToString
Dim DR = dtView.Rows.Find(ID)
For C = 0 To dtView.Columns.Count - 1
DR.BeginEdit()
DR(Cols(C)) = SR(Cols(C).ColumnName)
'What Happend if i stop the next Line
'Is There affect?
DR.EndEdit() 'Line 1
DR.AcceptChanges() 'Line 2
Next
Next
End Sub
My question is:
What Happens if i stop Line 1 And Line 2
Is there any bad effect of that?
Thanks for Any Help.
Continue reading...
I want to make background refresh faster.
This is my code.
Private dtView As DataTable
Public Sub RefreshRows(dtChangedRows As DataTable)
Dim Cols = dtView.Columns
For i = 0 To dtChangedRows.Rows.Count - 1
Dim SR = dtChangedRows(i)
Dim ID As String = SR("Name").ToString
Dim DR = dtView.Rows.Find(ID)
For C = 0 To dtView.Columns.Count - 1
DR.BeginEdit()
DR(Cols(C)) = SR(Cols(C).ColumnName)
'What Happend if i stop the next Line
'Is There affect?
DR.EndEdit() 'Line 1
DR.AcceptChanges() 'Line 2
Next
Next
End Sub
My question is:
What Happens if i stop Line 1 And Line 2
Is there any bad effect of that?
Thanks for Any Help.
Continue reading...