I am trying to update a DataGridViewCell in my UI form using a thread. Everywhere I have searched over the internet, more or less I found that they are asking to update the data source which is somehow not possible for me to implement in this project due to some restrictions.
A sample code is given below to understand my problem.
I have written a Sub in a module to get the values to be updated in the gridview.
Public Sub GetValues()
For I as Integer = 0 to N 'N = Row Count of the gridview
For J as Integer = 0 to M 'M = column count of the gridview
frmMain.DGV.Rows(I).Cells(J).Value = I * J
Next
Next
End Sub
Now I'm trying to create a thread to start the sub GetValues and want that thread to update the cells in my gridview DGV one by one.
Dim T As Threading.Thread = New Threading.Thread(AddressOf Module1.GetValues)
T.Start()
But it's not Working/Updating. Please help