L
Lucas Tam
Hello,
I am trying to update a datagrid via an async call, but the datagrid
shows up empty. I've checked the datatable - there are indeed rows in
it...
Here is my code:
Private Sub LoadGroup()
_del = New TCP.ChangeGroupDelegate(AddressOf _oTCP.ChangeGroup)
'invoke the method asynchronously so we don't have to wait
_IA = _del.BeginInvoke(_Group, _frmGroupList, New AsyncCallback
(AddressOf BindDataGrid), _IA)
End Sub
Private Sub BindDataGrid(ByVal ar As IAsyncResult)
If ar.IsCompleted Then
'this is our callback to let us know the method is finished
'here we could use the connection
_dt = _del.EndInvoke(_frmGroupList, _IA)
'_frmGroupList.dgArticles.Invoke
(_frmGroupList.dgArticles.DataSource, New Object() {0, _dt})
_frmGroupList.dgArticles.DataSource = _dt
End If
End Sub
The program stops executing at this line but does not crash:
_frmGroupList.dgArticles.DataSource = _dt
DataGrid is empty...
Any help would be appreciated. Thanks!
I am trying to update a datagrid via an async call, but the datagrid
shows up empty. I've checked the datatable - there are indeed rows in
it...
Here is my code:
Private Sub LoadGroup()
_del = New TCP.ChangeGroupDelegate(AddressOf _oTCP.ChangeGroup)
'invoke the method asynchronously so we don't have to wait
_IA = _del.BeginInvoke(_Group, _frmGroupList, New AsyncCallback
(AddressOf BindDataGrid), _IA)
End Sub
Private Sub BindDataGrid(ByVal ar As IAsyncResult)
If ar.IsCompleted Then
'this is our callback to let us know the method is finished
'here we could use the connection
_dt = _del.EndInvoke(_frmGroupList, _IA)
'_frmGroupList.dgArticles.Invoke
(_frmGroupList.dgArticles.DataSource, New Object() {0, _dt})
_frmGroupList.dgArticles.DataSource = _dt
End If
End Sub
The program stops executing at this line but does not crash:
_frmGroupList.dgArticles.DataSource = _dt
DataGrid is empty...
Any help would be appreciated. Thanks!