Hello everyone,
I have a datagridview which I fill with a database. Sorting and everything works fine.
Now I addded a column manually which uses the hostname value of a database field to check if this PC is online. Works.
Now I want to order by status online and nothing happends. When I sort a database column the online staus disappears.
How can I migrate my manually fields to become a full member?
This is for example the code how I add the online status
Hope someone can help me with that
Thx
I have a datagridview which I fill with a database. Sorting and everything works fine.
Now I addded a column manually which uses the hostname value of a database field to check if this PC is online. Works.
Now I want to order by status online and nothing happends. When I sort a database column the online staus disappears.
How can I migrate my manually fields to become a full member?
This is for example the code how I add the online status
VB.NET:
Private Sub PingWorker_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles PingWorker.DoWork
On Error Resume Next
If My.Computer.Network.IsAvailable = True Then
For Each row As DataGridViewRow In HardwareDataGridView.Rows
row.Cells(StatusOnline.Index).Value = Nothing
Next
For Each row As DataGridViewRow In HardwareDataGridView.Rows
'MessageBox.Show(CStr(row.Cells(DataGridViewTextBoxColumn32.Index).Value))
If CStr(row.Cells(DataGridViewTextBoxColumn14.Index).Value) > -1 Then
If My.Computer.Network.Ping(CStr(row.Cells(DataGridViewTextBoxColumn14.Index).Value), 1000) = True Then
'MsgBox("Online")
row.Cells(StatusOnline.Index).Style.ForeColor = Color.Green
row.Cells(StatusOnline.Index).Value = "Online"
Else
'MsgBox("Offline")
row.Cells(StatusOnline.Index).Style.ForeColor = Color.Red
row.Cells(StatusOnline.Index).Value = "Offline"
End If
End If
Next
End If
End Sub
Hope someone can help me with that
Thx