2017-12-18 247 views
0

我的自定义控件基于Telerik的控制自定义控制的SelectedIndexChanged没有被解雇

Public Class ComboBoxСountries 
    Inherits RadComboBox 
End Class 

使用控制

<mc:ComboBoxСountries ID="ComboCountry" runat="server" Width="100%" AutoPostBack="true"></mc:ComboBoxСountries> 

事件

Protected Sub ComboCountry_SelectedIndexChanged(sender As Object, e As RadComboBoxSelectedIndexChangedEventArgs) Handles ComboCountry.SelectedIndexChanged 
    ' not fired 
End Sub 

ComboCountry_SelectedIndexChanged没有被解雇,但是如果使用<telerik:RadComboBox />一切正常。如何解决这个问题呢?

+0

也许你需要'OnLoad'事件过程中添加自定义事件处理程序是这样的:'ComboCountry.SelectedIndexChanged + =新的EventHandler(ComboCountry_SelectedIndexChanged)'。 –

+1

@Tetsuya Yamamoto多数民众赞成不是如何处理程序添加到vb.net中... – Codexer

回答

0

添加OnSelectedIndexChanged = “ComboCountry_SelectedIndexChanged” 帮助

<mc:ComboBoxСountries ID="ComboCountry" runat="server" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="ComboCountry_SelectedIndexChanged"></mc:ComboBoxСountries>