Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Visual C#, Double click is not propery working on DataGridVies's row

Posted on 2009-04-28
Medium Priority
Last Modified: 2013-12-17
Hi Friends,

I am working on a Visual C# project for windows. my current issue is I have a datagridview filled with records from database.

When I double click on any row another window launches and show me the details of that particular record. Everything work well but my current issue is with Double click.

If I click on the row where some text is present in cells then it works find but if I double click on empty cells its not working. please guide me to solve this issue.

I am using "Full row selection" mode, so once you click on any part of row whole row get selected but double click is only working when I click on some text in a row.

thanks in advance.
Question by:ArunVashist
LVL 53

Accepted Solution

Dhaest earned 800 total points
ID: 24249601
In which event are you watching ?

void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
    // Do something on double click, except when on the header.
    if (e.RowIndex == -1)

Source: http://dotnetperls.com/Content/DataGridView-Tips.aspx

Author Comment

ID: 24249797
Hi Dhaest,

Thanks buddy, actually I was using "dataGridView1_CellContentDoubleClick", but now its working.
thanks for your prompt reply.


Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

564 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