Solved

How to navigate to specific cells in a datagridview programmatically?

Posted on 2006-06-19
1
447 Views
Last Modified: 2006-11-18
Hi
I would like to know how I can move from one cell to another (not necessary in the same area) in a datagridview.
To be more specific, I have a datagridview that is checked each time a datamember is changed.
The checking process assigns error texts to the not validated cells.

How can I navigate from one error to another using some "Previous error" and "Next error" buttons I created, so that the user has not to look for errors, just to edit the cell's content in order to fit the right format?
0
Comment
Question by:humer2000
1 Comment
 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
ID: 16934088
you have to set current cell

Private Sub setCurrentCellButton_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles setCurrentCellButton.Click

    ' Set the current cell to the cell in column 1, Row 0.
    Me.dataGridView1.CurrentCell = Me.dataGridView1(1, 0)' col , row

End Sub

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

713 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