Solved

Navigating a DataGridView bound to a Dataset

Posted on 2006-07-06
5
474 Views
Last Modified: 2012-06-27
Hi,

I am writing a program to take an attendance register and have a datagridview control which is bound to a dataset:

DataGridView1.DataSource = ds.Tables("attendance_marks")

When i click a button e.g. "Present", i have set the action to change the value of a field to "present", but then i want it to automatically move to the next record. It would make it much quicker for users however i can't figure out how to do this.

With VB6 it was just the case of calling the .MoveNext function but that does not exist now as far as i can see.

Thanks
Adam
0
Comment
Question by:adamday
  • 2
5 Comments
 
LVL 2

Expert Comment

by:Bill_PSC
ID: 17050912
Try this:

 Me.BindingContext(dataset, "datatable").Position += 1
0
 

Author Comment

by:adamday
ID: 17050979
Hi,

Ive tried that and it doesn't work. The datagridview just stays in the same line and if i click the button again, it just changes the same entry.

Adam
0
 

Author Comment

by:adamday
ID: 17051553
Hi,

Ive solved the problem.

Dim cm As CurrencyManager
cm = BindingContext(DataGridView1.DataSource, DataGridView1.DataMember)
cm.Position += 1

Adam
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 17105611
Closed, 250 points refunded.
Netminder
Site Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now