Solved

Navigating a DataGridView bound to a Dataset

Posted on 2006-07-06
5
469 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

13 Experts available now in Live!

Get 1:1 Help Now