This is a migrated thread and some comments may be shown as answers.

Selectedindexchanged event of dropdownlistcolumn Error

1 Answer 35 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Supriya
Top achievements
Rank 1
Supriya asked on 27 Sep 2012, 03:09 PM
Hello,

I am working on the selected index change event of the dropdownlist column in insert,delete and update radgridview.. And I get a strange error. I have pasted the code and error below



Protected Sub gvInsert_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
 
        If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then
            Dim item As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
            Dim editor As GridDropDownListColumnEditor = DirectCast(item.EditManager.GetColumnEditor("UniqueID"), GridDropDownListColumnEditor)

            'handle selected change on server
            editor.ComboBoxControl.AutoPostBack = True
            editor.ComboBoxControl.SelectedIndexChanged += New RadComboBoxSelectedIndexChangedEventHandler(AddressOf list_SelectedIndexChanged)
        End If
    End Sub

    
    Private Sub list_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)

        Dim editedItem As GridEditableItem = TryCast(TryCast(sender, DropDownList).NamingContainer, GridEditableItem)

    End Sub



Error:Public Event SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.


Can someone please help get thru this error, I have been trying to solve this for the past 2 weeks..
Any help will be appreciated

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 01 Oct 2012, 04:17 PM
Hello Supriya,

I guess this error occurs because you declared SelectedIndexChanged event as private. Try to use protected instead of private.
If that does not fix the error, you could check this link for more information about using RaiseEvent statement.


Greetings,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Supriya
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or