I have a DataGridView for which I want to create an event handler for double clicks on individual cells. I’m trying to add a Windows.Forms.DataGridViewCellEventHandler to the DataGridView.DoubleClick event, but it will only accept a System.EventHandler. A simple type cast doesn’t seem to work:
this.song_grid.DoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.cell_doubleclick);
Could someone please tell me the best way to get my DataGridView to accept a DataGridViewCellEventHandler? Thanks in advance.
These events are different and they need different signature of event handlers. You can’t add
DataGridViewCellEventHandlerto simpleEventHandler. What you can do is call some method inside handlers of these events:I assume you have subscribed both event handlers: