本文介绍了抱歉重新发布 - 数据绑定问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 Hey Group, 很抱歉,我一直在寻找这个甚至出去买了一本 ADO书,但仍然找不到我正在寻找:( 我的代码改为以下代码: Private Sub objdsAccess_PositionChanged() 如果Me.BindingContext(objdsAccess," Users")。Position<> -1则 Me.ComboBox1.SelectedValue = objdsAccess.Users。行(Me.BindingContext(objdsAcce ss, " Users"。)。Position).Item(" AccessLevelID") 结束如果 Me.lblNavLocation.Text =(((Me.BindingContext(objdsAccess, " Users")。Position + 1).ToString +" of)+ Me.BindingContext(objdsAccess, " Users")。Count.ToString) End Sub 这个工作正常,我的组合框。我的ComboBox使用以下代码: Private Sub ComboBox1_SelectedIndexChanged(ByVal sender A s Object,ByVal e As System.EventArgs)处理ComboBox1.SelectedIndexChanged 如果Me.BindingContext(objdsAccess," Users")。Position<> -1而不是 mlLoading然后 objdsAccess.Users.Rows(Me.BindingContext(objdsAcce ss, " Users")。 ).Item(" AccessLevelID")= Me.ComboBox1.SelectedValue 结束如果 结束子 这一切都有效很好,如果我使用导航按钮并调用: Me.objdsAccess_PositionChanged()。 但是我现在已经添加了一个Datagrid到我的表单,因为我在我的表单中选择一行。 如何更新我的ComboBox,并注意位置已更改? 谢谢 MCNHey Group,Sorry but i`ve been searching everywhere for this even went out and bought aADO book and still carn`t find what im looking for:(I have the following code for my postion changed:Private Sub objdsAccess_PositionChanged()If Me.BindingContext(objdsAccess, "Users").Position <> -1 ThenMe.ComboBox1.SelectedValue =objdsAccess.Users.Rows(Me.BindingContext(objdsAcce ss,"Users").Position).Item("AccessLevelID")End IfMe.lblNavLocation.Text = (((Me.BindingContext(objdsAccess,"Users").Position + 1).ToString + " of ") + Me.BindingContext(objdsAccess,"Users").Count.ToString)End SubThis works fine, with my Combo Box. My ComboBox is using the following code:Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal eAs System.EventArgs) Handles ComboBox1.SelectedIndexChangedIf Me.BindingContext(objdsAccess, "Users").Position <> -1 And NotmlLoading ThenobjdsAccess.Users.Rows(Me.BindingContext(objdsAcce ss,"Users").Position).Item("AccessLevelID") = Me.ComboBox1.SelectedValueEnd IfEnd SubThis all works fine, if im using Navigation buttons and calling:Me.objdsAccess_PositionChanged().However I`ve now added a Datagrid to my Form, as I select a Row in my form.How would i get it to update my ComboBox, and notice the position changed?ThanksMCN推荐答案 Me.BindingContext(objdsAccess, Me.BindingContext(objdsAccess, 代码: $ b $ as As System.EventArgs)处理ComboBox1.SelectedIndexChanged 如果Me.BindingContext(objdsAccess," Users")。Position<> -1而不是 mlLoading然后 objdsAccess.Users.Rows(Me.BindingContext(objdsAcce ss," Users"。)。Position).Item(" AccessLevelID")= Me。 ComboBox1.SelectedValue 结束如果结束子 这一切正常,如果我使用导航按钮并调用: Me.objdsAccess_PositionChanged()。 但是我现在已经在我的表单中添加了一个Datagrid,因为我在e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged If Me.BindingContext(objdsAccess, "Users").Position <> -1 And Not mlLoading Then objdsAccess.Users.Rows(Me.BindingContext(objdsAcce ss, "Users").Position).Item("AccessLevelID") = Me.ComboBox1.SelectedValue End If End Sub This all works fine, if im using Navigation buttons and calling: Me.objdsAccess_PositionChanged(). However I`ve now added a Datagrid to my Form, as I select a Row in my 表单中选择了一行。 form. Simon, 因为你宣布你的cmDsAccess WithEvents你可以在顶部 左下拉列表中查找它所描述的所有对象等(如文本框和所以 on。 在那里你会看到你的cmDsAccess对象。如果你点击它,你会看到看到右侧组合框中的事件。其中一个将是定位 更改。 点击它(订阅它)然后那是你的通知 位置在您的数据网格中已更改。那时,无论你想要什么,你都可以做到。例如,在你的头寸交易事件中你可以获得 来自货币管理器的当前行(cmDsAccess.Current())和 maniuplate你的组合框基于此。 怎么样?事情很忙,因为这些事情很糟糕。 =) -CJ " MadCrazyNewbie" ; < TE ** @ nospam.com>在消息中写道 新闻:Dc ******************** @ karoo.co.uk ... (或 (or 移动 moving 事件 event找到 find上的事件 买了 Me.BindingContext(objdsAccess, Me.BindingContext(objdsAccess, 代码: ByVal e As System.EventArgs)处理ComboBox1.SelectedIndexChanged 如果Me.BindingContext(objdsAccess," Users")。Position<> -1而不是 mlLoading然后 objdsAccess.Users.Rows(Me.BindingContext(objdsAcce ss," Users"。)。Position).Item(" AccessLevelID")= Me。 ComboBox1.SelectedValue 结束如果结束子 这一切正常,如果我使用导航按钮并调用: Me.objdsAccess_PositionChanged()。 但是我现在已经在我的表单中添加了一个Datagrid,因为我在ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged If Me.BindingContext(objdsAccess, "Users").Position <> -1 And Not mlLoading Then objdsAccess.Users.Rows(Me.BindingContext(objdsAcce ss, "Users").Position).Item("AccessLevelID") = Me.ComboBox1.SelectedValue End If End Sub This all works fine, if im using Navigation buttons and calling: Me.objdsAccess_PositionChanged(). However I`ve now added a Datagrid to my Form, as I select a Row in my 表单中选择了一行。 form. 这篇关于抱歉重新发布 - 数据绑定问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-15 13:26
查看更多