Handler doesnot have the same signature

  • Thread starter Thread starter Ger
  • Start date Start date
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.
 
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.
 
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.
 
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.
 
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
 
Humm. I don't see a SelectedIndexChanged event for the DataGridView. Are
you sure you don't confuse the DataGridView and a ComboBox ?
 
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.
 
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.
 
Back
Top