Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
GeneralRe: Static Method Variables Pin
tsramkumar7-Oct-05 9:44
tsramkumar7-Oct-05 9:44 
AnswerRe: Static Method Variables Pin
S. Senthil Kumar7-Oct-05 20:56
S. Senthil Kumar7-Oct-05 20:56 
GeneralRe: Static Method Variables Pin
tsramkumar8-Oct-05 17:46
tsramkumar8-Oct-05 17:46 
AnswerRe: Static Method Variables Pin
Tom Larsen8-Oct-05 9:19
Tom Larsen8-Oct-05 9:19 
QuestionInternal Rate of Return code (IRR) Pin
zaboboa7-Oct-05 9:07
zaboboa7-Oct-05 9:07 
AnswerRe: Internal Rate of Return code (IRR) Pin
leppie7-Oct-05 11:21
leppie7-Oct-05 11:21 
GeneralRe: Internal Rate of Return code (IRR) Pin
zaboboa11-Oct-05 3:01
zaboboa11-Oct-05 3:01 
QuestionDataGridView + DoubleClick + Close = Exception? Pin
Anonymous7-Oct-05 8:00
Anonymous7-Oct-05 8:00 
Hi there!

I hope you guys can help me, here's my problem:

I have a form (Form1) with a button (Button1) which open another form (Form2) as such:

<br />
Form2 frm2 = new Form2()<br />
<br />
frm2.Show();<br />


On the second form (Form2) I have a DataGridView with this code:

<br />
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)<br />
{<br />
    this.Close();<br />
}<br />


My goal is to close the second form when the user double-clicks (makes a selection) in the DataGridView. I've tried more than 20 events and I always have the same problem:

Object reference not set to an instance of an object.
at System.Windows.Forms.DataGridView.HitTest(Int32 x, Int32 y)

Can you guys help me? Thanks!
AnswerRe: DataGridView + DoubleClick + Close = Exception? Pin
XRaheemX7-Oct-05 8:18
XRaheemX7-Oct-05 8:18 
GeneralRe: DataGridView + DoubleClick + Close = Exception? Pin
Anonymous7-Oct-05 8:19
Anonymous7-Oct-05 8:19 
GeneralRe: DataGridView + DoubleClick + Close = Exception? Pin
XRaheemX7-Oct-05 8:24
XRaheemX7-Oct-05 8:24 
GeneralRe: DataGridView + DoubleClick + Close = Exception? Pin
Anonymous7-Oct-05 9:09
Anonymous7-Oct-05 9:09 
GeneralRe: DataGridView + DoubleClick + Close = Exception? Pin
Anonymous11-Oct-05 5:26
Anonymous11-Oct-05 5:26 
QuestionDialog opening behavior on a dual monitor system Pin
Dan Neely7-Oct-05 7:40
Dan Neely7-Oct-05 7:40 
AnswerRe: Dialog opening behavior on a dual monitor system Pin
XRaheemX7-Oct-05 7:44
XRaheemX7-Oct-05 7:44 
GeneralRe: Dialog opening behavior on a dual monitor system Pin
Dan Neely7-Oct-05 8:00
Dan Neely7-Oct-05 8:00 
GeneralRe: Dialog opening behavior on a dual monitor system Pin
XRaheemX7-Oct-05 8:05
XRaheemX7-Oct-05 8:05 
GeneralRe: Dialog opening behavior on a dual monitor system Pin
Dan Neely7-Oct-05 8:44
Dan Neely7-Oct-05 8:44 
GeneralRe: Dialog opening behavior on a dual monitor system Pin
XRaheemX7-Oct-05 8:45
XRaheemX7-Oct-05 8:45 
GeneralRe: Dialog opening behavior on a dual monitor system Pin
XRaheemX7-Oct-05 8:58
XRaheemX7-Oct-05 8:58 
QuestionDatabound Textbox and TabControl Pin
rich_wenger7-Oct-05 7:35
rich_wenger7-Oct-05 7:35 
Questionstring to int in C#? Pin
Lilli Alexis7-Oct-05 7:22
Lilli Alexis7-Oct-05 7:22 
AnswerRe: string to int in C#? Pin
XRaheemX7-Oct-05 7:28
XRaheemX7-Oct-05 7:28 
AnswerRe: string to int in C#? Pin
leppie7-Oct-05 7:29
leppie7-Oct-05 7:29 
AnswerRe: string to int in C#? Pin
leejo12310-Oct-05 3:16
leejo12310-Oct-05 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.