VSTO - DataGridView get row index on click or selection

Posted on 2011-05-11
Last Modified: 2012-05-11

How do you get the column index of a DataGridView row that the user selects using code.
can anyone also tell me where the VSTO zone is - it doesn't come up by entering that into the search box
Question by:murbro
    LVL 83

    Accepted Solution

    You can use

    LVL 17

    Assisted Solution

    in the OnClick event, the row index is
    e.RowIndex, so you can get it by
    Dim MyIndex = e.RowIndex

    Open in new window

    LVL 35

    Assisted Solution

    by:Miguel Oz
    The above answers solve your main question.
    Regarding VSTO, check:
    it should come if you type VSTO on the zone box . But this is a Win form question.

    Author Closing Comment

    Thanks all

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    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…
    Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
    The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

    734 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

    23 Experts available now in Live!

    Get 1:1 Help Now