VS 2005 C# DataGridView.UserAddedRow Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I try to add this event handler, I get an error:
this.dgScheduleCamera.UserAddedRow += new
System.Windows.Forms.DataGridViewRowEventHandler(this.dgScheduleCamera_UserAddedRow);

Error:
No overload for 'dgSchedule_UserAddRow' matches delegate
'System.Windows.Forms.DataGridViewRowEventHandler'

What I am try to do is set up a parent child multi-grid form where I need to
add the parent key info in the child grid when a new row is added.

Please advise if I am doing this wrong.

Thanks Mike
 
The exception thrown, indicates that you don't have a valid definition for
the event handler

you should also have a method ...

[modifier] void dgSchedule_UserAddRow(object sender, EventArgs e) { }

now, I'm not supposing for a moment that the above signature is correct
(I've not looked at C# 2005, so I don't actually know the DataGridView
object), but it will be along those lines.
 
I was using DataGridViewCellEventArgs in the definition instead of
DataGridViewRowEventArgs.


billr said:
The exception thrown, indicates that you don't have a valid definition for
the event handler

you should also have a method ...

[modifier] void dgSchedule_UserAddRow(object sender, EventArgs e) { }

now, I'm not supposing for a moment that the above signature is correct
(I've not looked at C# 2005, so I don't actually know the DataGridView
object), but it will be along those lines.


--
--

Of all words of tongue and pen, the saddest are: "It might have been"


msmith said:
When I try to add this event handler, I get an error:
this.dgScheduleCamera.UserAddedRow += new
System.Windows.Forms.DataGridViewRowEventHandler(this.dgScheduleCamera_UserAddedRow);

Error:
No overload for 'dgSchedule_UserAddRow' matches delegate
'System.Windows.Forms.DataGridViewRowEventHandler'

What I am try to do is set up a parent child multi-grid form where I need to
add the parent key info in the child grid when a new row is added.

Please advise if I am doing this wrong.

Thanks Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top