Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - VB.Net progam the selecting of a row of a DataGridView

Reply
 
Old 07-21-2008   #1 (permalink)
News.Individual.NET


 
 

VB.Net progam the selecting of a row of a DataGridView

On 21 Jul 2008 17:57:43 GMT, "News.Individual.NET"
<josephoget@xxxxxx> wrote:
Quote:

>Hi all,
>
>I can detect the active row (iRowIndex: see below please) and do whatever I
>want, but I do not seem to be able to set a row to be selected.
>
>How can I do that in vb.Net?
>
>Private Sub DataGridView1_MouseDown(etc.....
>
>Dim btnLeft = Windows.Forms.MouseButtons.Left
>
>If e.Button = btnLeft Then
>
> Dim hit As DataGridView.HitTestInfo = DataGridView1.HitTest(e.X, e.Y)
> If hit.Type = DataGridViewHitTestType.Cell Then
> clickedCell = DataGridView1.Rows(hit.RowIndex).Cells(hit.ColumnIndex)
> iRowIndex = CInt(hit.RowIndex)
> etc...
>
Set the Row.Selected property to True.

My System SpecsSystem Spec
Old 07-21-2008   #2 (permalink)
Jack Jackson


 
 

Re: VB.Net progam the selecting of a row of a DataGridView

On 21 Jul 2008 17:57:43 GMT, "News.Individual.NET"
<josephoget@xxxxxx> wrote:
Quote:

>Hi all,
>
>I can detect the active row (iRowIndex: see below please) and do whatever I
>want, but I do not seem to be able to set a row to be selected.
>
>How can I do that in vb.Net?
>
>Private Sub DataGridView1_MouseDown(etc.....
>
>Dim btnLeft = Windows.Forms.MouseButtons.Left
>
>If e.Button = btnLeft Then
>
> Dim hit As DataGridView.HitTestInfo = DataGridView1.HitTest(e.X, e.Y)
> If hit.Type = DataGridViewHitTestType.Cell Then
> clickedCell = DataGridView1.Rows(hit.RowIndex).Cells(hit.ColumnIndex)
> iRowIndex = CInt(hit.RowIndex)
> etc...
>
Set the Row.Selected property to True.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Photo Editing Progam in Vista? Software
Missing Progam Name in Start/All Programs Vista performance & maintenance
Progam for custom refresh rates ? Software
What progam is used to open Vista Log files? Vista General
can't log in, how to uninstall progam? Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46