开发者

Telerik RadComboBox not building

开发者 https://www.devze.com 2023-03-07 02:29 出处:网络
Good afternoon all (or morning for those across the pond). I\'m receiving a very peculiar Telerik error, I was wondering if any of you with Telerik experience had come across this one before.

Good afternoon all (or morning for those across the pond).

I'm receiving a very peculiar Telerik error, I was wondering if any of you with Telerik experience had come across this one before.

I'm using a RadComboBox, when trying to build I get this error :

Method 'Protected Sub ddlMyDropDown_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)' cannot handle Event 'Public Event SelectedIndexChanged(sender As Object, e As System.EventArgs)' because they do not have t开发者_Python百科he same signature.

So you all can get a full understanding of the situation I find myself in, I'll show you my declaration and event instance:

<telerik:RadComboBox Skin="Telerik" runat="server" AutoPostBack="true" ID="ddlMyDropDown" DataTextField="uname" DataValueField="Id" EnableEmbeddedSkins="true"></telerik:RadComboBox>

and the event code :

Protected Sub ddlMyDropDown_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles ddlMyDropDown.SelectedIndexChanged
   UserId = ddlMyDropDown.SelectedValue
End Sub

It all runs as expected when I force run the project, but it won't build successfully or allow me to publish. The error message just doesn't make any logical sense.

I've tried using System.EventArgs assuming that the Telerik event args derive from it. But still no success.

Any help would be highly appreciated.


Aaah, sorry about this, I've figured out the problem. It appears that another file someone had created in the project was hooked up to the code behind of the page I was working.

Their page contained a DropDownList with the same name as my Telerik control, thus causing the error to be displayed.

I've fixed it now. Was a nightmare to find, but got there in the end.


Replace Public Event SelectedIndexChanged(sender As Object, e As System.EventArgs)
with *Protected Sub ddlUsers_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)*

in your code behind. I guess you replaced your asp dropdown to teleerik dropdown in aspx page and forgot to change the event in code behind. Telerik combobox need RadComboBoxSelectedIndexChangedEventArgs to handle selected changed event.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号