Vb.net 不在集合中反映的数据绑定

Vb.net 不在集合中反映的数据绑定,vb.net,data-binding,infragistics,ultracombo,Vb.net,Data Binding,Infragistics,Ultracombo,我已经为一个集合指定了2个数据索引的ultracombobox。但是当我更改组合框的值时,集合没有得到反映 但是,当我更改第二个组合框的值时,第一个组合框所做的更改将得到反映,而第二个组合框则没有 //代码 'DataBinding Declaration Public Shared ObjLookupHeaderBindings As BindingSource = New BindingSource() 'Binding Asignment ObjLookupHead

我已经为一个集合指定了2个数据索引的ultracombobox。但是当我更改组合框的值时,集合没有得到反映

但是,当我更改第二个组合框的值时,第一个组合框所做的更改将得到反映,而第二个组合框则没有

//代码

'DataBinding Declaration

    Public Shared ObjLookupHeaderBindings As BindingSource = New BindingSource() 

'Binding Asignment

    ObjLookupHeaderBindings.DataSource = LookupHeadersCollection
    ultraGridBase.DataSource = ObjLookupHeaderBindings

'Collection Class Example code
Public Class LookupHeadersCollection

Public Event LookupSQLCommandChanged As EventHandler

 ''' <summary>
    ''' Get or set the SQL Query values
    ''' </summary>
    ''' <value></value>
    ''' <remarks></remarks>
    Public Property LookupSQLCommand() As String
        Get
            Return Me.m_sLookupSQLCommand
        End Get

        Set(ByVal value As String)
            Me.m_sLookupSQLCommand = value
            Me.m_bIsChanged = True
            RaiseEvent LookupSQLCommandChanged(Me, EventArgs.Empty)
        End Set

    End Property
End Class

'Add Binding into to controls
cmbSQLServer.DataBindings.Add(New Binding("Text", ObjLookupHeaderBindings, "LookupConnection", False))
cmbDatabaseName.DataBindings.Add(New Binding("Text", ObjLookupHeaderBindings, "LookupDatabaseName", False))
txtSQLCommand.DataBindings.Add(New Binding("Value", ObjLookupHeaderBindings, "LookupSQLCommand", False))


'I tried to the following ways, but its not working.
txtSQLCommand.DataBindings(O).ReadValue()
ObjLookupHeaderBindings.CurrencyManager.Refresh()
cmbSQLServer.DataBindings.Add(New Binding("Text", Controller.ObjLookupHeaderBindings, "LookupConnection", False, DataSourceUpdateMode.OnPropertyChanged))
“数据绑定声明”
作为BindingSource=New BindingSource()的公共共享ObjLookupHeaderBindings
"约束力声明",
ObjLookupHeaderBindings.DataSource=LookupHeadersCollection
ultraGridBase.DataSource=ObjLookupHeaderBindings
'集合类示例代码
公共类外观管理员集合
公共事件LookupSqlCommands已更改为EventHandler
''' 
''获取或设置SQL查询值
''' 
''' 
''' 
公共属性LookupSQLCommand()作为字符串
得到
返回Me.m_sLookupSQLCommand
结束
设置(ByVal值作为字符串)
Me.m_sLookupSQLCommand=值
Me.m_bIsChanged=真
RaiseEvent LookupSQLCommandChanged(Me,EventArgs.Empty)
端集
端属性
末级
'将绑定添加到控件中
添加(新绑定(“文本”,ObjLookupHeaderBindings,“LookupConnection”,False))
cmbDatabaseName.DataBindings.Add(新绑定(“Text”,ObjLookupHeaderBindings,“lookupdateabasename”,False))
添加(新绑定(“值”,objlookupsqlcommand,False))
我试着用下面的方法,但它不起作用。
txtSQLCommand.DataBindings(O.ReadValue)()
ObjLookupHeaderBindings.CurrencyManager.Refresh()

哪里出了问题?

添加了
数据源的
UpdateMode
,然后工作正常

//代码

'DataBinding Declaration

    Public Shared ObjLookupHeaderBindings As BindingSource = New BindingSource() 

'Binding Asignment

    ObjLookupHeaderBindings.DataSource = LookupHeadersCollection
    ultraGridBase.DataSource = ObjLookupHeaderBindings

'Collection Class Example code
Public Class LookupHeadersCollection

Public Event LookupSQLCommandChanged As EventHandler

 ''' <summary>
    ''' Get or set the SQL Query values
    ''' </summary>
    ''' <value></value>
    ''' <remarks></remarks>
    Public Property LookupSQLCommand() As String
        Get
            Return Me.m_sLookupSQLCommand
        End Get

        Set(ByVal value As String)
            Me.m_sLookupSQLCommand = value
            Me.m_bIsChanged = True
            RaiseEvent LookupSQLCommandChanged(Me, EventArgs.Empty)
        End Set

    End Property
End Class

'Add Binding into to controls
cmbSQLServer.DataBindings.Add(New Binding("Text", ObjLookupHeaderBindings, "LookupConnection", False))
cmbDatabaseName.DataBindings.Add(New Binding("Text", ObjLookupHeaderBindings, "LookupDatabaseName", False))
txtSQLCommand.DataBindings.Add(New Binding("Value", ObjLookupHeaderBindings, "LookupSQLCommand", False))


'I tried to the following ways, but its not working.
txtSQLCommand.DataBindings(O).ReadValue()
ObjLookupHeaderBindings.CurrencyManager.Refresh()
cmbSQLServer.DataBindings.Add(New Binding("Text", Controller.ObjLookupHeaderBindings, "LookupConnection", False, DataSourceUpdateMode.OnPropertyChanged))