superservo15
Member
Hi,
I am having problems figuring this one out and am hoping someone here might know
I have a base form and I am trying to get the DataSource of the ActiveControl if the control is a datagridview.
What I have so far is:
I can't seem to get the dataSource from the control object, but am unsure how to access the datagridview from the base form. Any ideas or suggestions would be great!
Thanks in advance.
I am having problems figuring this one out and am hoping someone here might know
I have a base form and I am trying to get the DataSource of the ActiveControl if the control is a datagridview.
What I have so far is:
VB.NET:
Dim curControl As Control = Me.ActiveControl
Dim ControlType As String = curControl.GetType.ToString()
If ControlType = "System.Windows.Forms.DataGridView" Then
'get the data out from datagridview to a datatable
Dim dtGridData As DataTable
dtGridData = ???
End If
I can't seem to get the dataSource from the control object, but am unsure how to access the datagridview from the base form. Any ideas or suggestions would be great!
Thanks in advance.