Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8912007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:05:36+00:00 2026-06-15T04:05:36+00:00

I am currently developing an DataGridView to store PDF-Files via Drag and Drop. The

  • 0

I am currently developing an DataGridView to store PDF-Files via Drag and Drop.
The user is able to d’n’d the file into the DataGridView and the PDF is stored to an container.

Then I wanted to realize a ContextMenu which allows the user to open or delete the PDF by right clicking on it and selecting the targeted option.

The option “Open” is working fine by using the HitTest(x, y) with the CursorPosition.

My problem is, that as you see the “Delete” button is placed in the cell bellow and the HitTest(x, y) will deliver me the cell right below, which is not my goal.

What I have tried

I’ve tried it by catching the CellContentClick and Click events, but those are not triggered by right clicking the cell. Also the option by saving the last entered cell by catching the CellMouseEnter event is not working propably

Is there any posibility to get to know which cell was right clicked?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:05:38+00:00Added an answer on June 15, 2026 at 4:05 am

    In Your dataGridView enable the Single Cell Selection property and then on click of your context menu you can get the selected cell

    You can get the selected cell by

    private void dataGridView_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
    {
        if (e.Button == MouseButtons.Right)
        {
            dataGridView.CurrentCell = dataGridView[e.ColumnIndex, e.RowIndex];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently developing an app that needed to associate with different file types (PDF
Currently developing a PHP framework and have ran into my first problem. I need
I am currently developing an application and I need to be able when pressing
Im currently developing a program that uses a scrollable/zoomable image as the main user
I'm currently developing a web radio app and if the user presses the pause/stop
Im currently developing a system where the user will end up having large arrays(
I am currently developing a Silverlight 3 app that needs some sort of user
Im currently developing an application that needs to store a 10 to 20 digit
I´m currently developing a Struts2 app where a user will make one of three
I am currently developing an application for an angle measurement device (goniometer). A DataGridView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.