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


  1.    21 Jul 2008 #1
    News.Individual.NET Guest

    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:

    >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

  2.    21 Jul 2008 #2
    Jack Jackson Guest

    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:

    >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

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

Similar Threads
Thread Forum
Quick Defrag Progam????Any Ideas People???
I want to defrag my Drive but windows Defrag is slow, what is a good freeware defrag that is fast????
Software
Photo Editing Progam in Vista?
Hi, I wasn't sure where to post this, so I am here. I scanned (Well not me but someone who helped me) a bunch of old photo album pages into the...
Software
Missing Progam Name in Start/All Programs
My desktip pc's os is Windows Vista Home Basic. I installed Microsoft Office Home and Student 2007. The program name Microsoft Office Home and...
Vista performance & maintenance
Progam for custom refresh rates ?
Hi i'm looking for a program that can force refresh rates that are not seen by the generic monitor driver. I have a Dell P1120 and there are no...
Software
Progam install with dual boot
I am dual booting Vista and XP, on separate hard drives. When I install programs in Vista is there any reason why I cannot install the program right...
Vista installation & setup
What progam is used to open Vista Log files?
Hi All, A simple question: what program could I use to read Vista Log files? I tried to open them with Notepad but got a blank screen. As always,...
Vista General
can't log in, how to uninstall progam?
ok, a member of my family tried to download 'maple story' off of 'nexon.net' and it said that it wasn't compatible with windows vista. None the...
Vista installation & setup

Our Sites
  • Ten Forums
  • Eight Forums
  • Seven Forums
  • Help Me Bake
  • Site Links
  • Contact Us
  • Privacy and Cookies
  • About Us
    Windows Vista Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 05:50.
    .