Windows Vista Forums

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

  1. #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. #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
Photo Editing Progam in Vista? Software
Progam for custom refresh rates ? Software
Progam install with dual boot Vista installation & setup
What progam is used to open Vista Log files? Vista General
can't log in, how to uninstall progam? Vista installation & setup