Solved

Navigating a DataGridView bound to a Dataset

Posted on 2006-07-06
5
481 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

627 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