Handler doesnot have the same signature

G

Ger

Hi,

I encountered the following error:
Method 'DG_SelectedIndexChanged' cannot handle Event 'SelectedIndexChanged'
because they do not have the same signature.

I am using SBS2003, SQL2000, ASP.net 1.1 (VB.net). On a form I drawed a
DataGrid and filled it with data from SQL2000. Now, when a user selets a row
in the DataGrid I want to retrieve the data of the row via the
SelectedIndexChanged-event. In this case, I have to modify the e from
system.eventargs into DataGridCommandEventArgs, but then I got this error.

Any help is appreciated,

regards, Ger.
 
K

kimiraikkonen

Hi,

I encountered the following error:
Method 'DG_SelectedIndexChanged' cannot handle Event 'SelectedIndexChanged'
because they do not have the same signature.

I am using SBS2003, SQL2000, ASP.net 1.1 (VB.net). On a form I drawed a
DataGrid and filled it with data from SQL2000. Now, when a user selets a row
in the DataGrid I want to retrieve the data of the row via the
SelectedIndexChanged-event. In this case, I have to modify the e from
system.eventargs into DataGridCommandEventArgs, but then I got this error.

Any help is appreciated,

regards, Ger.

Signatures must be same as defined via intellisense in events.
 
G

Ger

Thanks kimi for answering, but I donot quite understand.

When I modify the e (in stead of system.eventargs I put
DataGridCommandEventArgs) the handle gives me intellisense to
SelectedIndexChange.....

So:

Private Sub DG_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DG.SelectedIndexChanged

I stated:

Private Sub DG_SelectedIndexChanged(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs) Handles DG.SelectedIndexChanged

Intellisense shows up when typing 'Handles DG.' and SelectedIndexChanged can
be choosen, but when leaving the sentence with the cursor, a showtip shows
up, that the method could not handle the event cause it doesnot have the same
signature.

Can you explain further ?

regards, Ger.
 
F

Family Tree Mike

Ger said:
Hi,

I encountered the following error:
Method 'DG_SelectedIndexChanged' cannot handle Event 'SelectedIndexChanged'
because they do not have the same signature.

I am using SBS2003, SQL2000, ASP.net 1.1 (VB.net). On a form I drawed a
DataGrid and filled it with data from SQL2000. Now, when a user selets a row
in the DataGrid I want to retrieve the data of the row via the
SelectedIndexChanged-event. In this case, I have to modify the e from
system.eventargs into DataGridCommandEventArgs, but then I got this error.

Any help is appreciated,

regards, Ger.

You changed the signature by changing the type of "e". Your new signature
is not compatible with the handler for the SelectedIndexChanged event.
 
C

Cor Ligthert[MVP]

Ger,

The most simple by events is just to create a new one and cut and paste that
from the bottom over the original one.

Saves you a lot of time.

(Just as I do it in those cases)

Cor
 
P

Patrice

Humm. I don't see a SelectedIndexChanged event for the DataGridView. Are
you sure you don't confuse the DataGridView and a ComboBox ?
 
K

kimiraikkonen

Humm. I don't see a SelectedIndexChanged event for the DataGridView. Are
you sure you don't confuse the DataGridView and a ComboBox ?

Patrice,
For DataGridView "selectionChanged" is available, and
"SelectedIndexChanged" event is available for Listbox control.

Hope this helps.
 
P

Patrice

I'm not the OP. Actually I noticed the OP is still using a DataGrid so what
I said about the DataGridView may not apply (my first idea was a confusion
between two controls)...

Anyway it could likely be handled by just looking at the tooltip that shows
up in case of a signature mismatch. If the OP read this I would suggest to
deouble check that what is shown in the tooltip is really the same on both
sides (though if using VS2003 I'm not sure you have this tooltip)...

--
Patrice

"kimiraikkonen" <[email protected]> a écrit dans le message de (e-mail address removed)...
Humm. I don't see a SelectedIndexChanged event for the DataGridView. Are
you sure you don't confuse the DataGridView and a ComboBox ?

Patrice,
For DataGridView "selectionChanged" is available, and
"SelectedIndexChanged" event is available for Listbox control.

Hope this helps.
 

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

Top