PC Review


Reply
Thread Tools Rate Thread

Context Binding and Postion

 
 
MadCrazyNewbie
Guest
Posts: n/a
 
      29th Mar 2004
Hello Group,

I have a problem with my bindings.

I use the following code to define my Postition changed for my ComboBox1:

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If Me.BindingContext(objdsAccess, "Users").Position <> -1 And Not
mlLoading Then
objdsAccess.Users.Rows(Me.BindingContext(objdsAccess,
"Users").Position).Item("AccessLevelID") = Me.ComboBox1.SelectedValue
End If
End Sub

Private Sub objdsAccess_PositionChanged()
If Me.BindingContext(objdsAccess, "Users").Position <> -1 Then
Me.ComboBox1.SelectedValue =
objdsAccess.Users.Rows(Me.BindingContext(objdsAccess,
"Users").Position).Item("AccessLevelID")
End If
Me.lblNavLocation.Text = (((Me.BindingContext(objdsAccess,
"Users").Position + 1).ToString + " of ") + Me.BindingContext(objdsAccess,
"Users").Count.ToString)
End Sub

The above works fine if I use it on my Nav buttons to Navigate for example:

Private Sub btnNavNext_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNavNext.Click
Me.BindingContext(objdsAccess, "Users").Position =
(Me.BindingContext(objdsAccess, "Users").Position + 1)
Me.objdsAccess_PositionChanged()
End Sub

I`ve now added a Datagrid but when I move through the datagrid, it updates
all my Textboxs but my ComboBox1 never changes, it just sticks on the first
Item in the list

How do I get my ComboBox to change, when moving through My Datagrid?

Could somebody please point me in the right direction?

Many Thanks
MCN


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ComboBox and Binding Context Problem =?Utf-8?B?Sm9iIExvdA==?= Microsoft Dot NET 2 18th Apr 2005 04:01 AM
How to get Position in a Binding Context Luis Soler Microsoft VB .NET 0 10th Apr 2005 05:17 PM
Binding Context in datagrid Brandon Owensby Microsoft Dot NET Framework Forms 1 19th Mar 2004 03:24 PM
Can't return data through Binding Context. Mark Microsoft ADO .NET 6 20th Aug 2003 08:47 PM
Binding Context Question/Problem Jerry Microsoft Dot NET Framework Forms 3 24th Jul 2003 08:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:26 PM.