I trying to develop a new data-bound grid activex control. I have placed an unbound grid (no datasource
and datamember properties) onto usercontrol . .
I use variables to store these values:
Dim m_DataSource As Object
Dim m_DataMember As String
Public Property Get DataSource() As DataSource
Set DataSource = m_DataSource
End Property
Public Property Set DataSource(ByVal New_DataSource As DataSource)
set m_DataSource = New_DataSource
PropertyChanged "DataSource"
End Property
Public Property Get DataMember() As String
DataMember = m_DataMember
End Property
Public Property Let DataMember(ByVal New_DataMember As String)
m_DataMember = New_DataMember
PropertyChanged "DataMember"
End Property
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Set DataSource = PropBag.ReadProperty("DataSource", Nothing)
DataMember = PropBag.ReadProperty("DataMember", "")
End Sub
'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("DataSource", DataSource, Nothing)
Call PropBag.WriteProperty("DataMember", DataMember, "")
End Sub
My questions:
-A normal data-bound grid lists the possible values for DataMember property when the user selected the
DataSource, but mine dont. How could I do this?
-I obtain the recordset in the following way: (to populate data in the grid)
Public WithEvents rst As ADODB.Recordset
Set rst = m_DataSource.Recordsets(m_DataMember)
,but It doesnt work when the DataMember is a "child recordset" of a parent-child relation recordset.
help plz
and datamember properties) onto usercontrol . .
I use variables to store these values:
Dim m_DataSource As Object
Dim m_DataMember As String
Public Property Get DataSource() As DataSource
Set DataSource = m_DataSource
End Property
Public Property Set DataSource(ByVal New_DataSource As DataSource)
set m_DataSource = New_DataSource
PropertyChanged "DataSource"
End Property
Public Property Get DataMember() As String
DataMember = m_DataMember
End Property
Public Property Let DataMember(ByVal New_DataMember As String)
m_DataMember = New_DataMember
PropertyChanged "DataMember"
End Property
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Set DataSource = PropBag.ReadProperty("DataSource", Nothing)
DataMember = PropBag.ReadProperty("DataMember", "")
End Sub
'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("DataSource", DataSource, Nothing)
Call PropBag.WriteProperty("DataMember", DataMember, "")
End Sub
My questions:
-A normal data-bound grid lists the possible values for DataMember property when the user selected the
DataSource, but mine dont. How could I do this?
-I obtain the recordset in the following way: (to populate data in the grid)
Public WithEvents rst As ADODB.Recordset
Set rst = m_DataSource.Recordsets(m_DataMember)
,but It doesnt work when the DataMember is a "child recordset" of a parent-child relation recordset.
help plz