ClientSelectedIndexChanged event for RadCombobox in Listview

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    1 posts
    Member since:
    Oct 2011

    Posted 08 Oct 2013 Link to this post

    I've been trying to attach a ClientSelectedIndexChanged event to add a javascript function on a radCombobox inside a listview 


    protected void AdListView1_ItemCreated(object sender, RadListViewItemEventArgs e)
    {
            RadComboBox box = (RadComboBox)e.Item.FindControl("ItemTypeCbx");
            box.Attributes.Add("OnClientSelectedIndexChanged", "ItemTypeCbxOnClientSelectedIndexChanged");
     
      }


    Then I'd like a javascript event to fire 

    function ItemTypeCbxOnClientSelectedIndexChanged(sender, eventArgs) {
             
               
         }
    The event doesn't fire and I'm pretty sure I'm probably missing some important step.  Can someone point me in the right 
    direction? I've tried to attach that event inside Itemdatabound as well and no luck either.  Thanks 


  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 11 Oct 2013 Link to this post

    Hi Jeff,

     Note that the client side and server side SelectedIndexChanged events wont fire when the default item is selected (even if the AutoPostBack property is set to true). This is the default nature and these events will fire instantly once an item other than the default item in the RadComboBox is selected.
    Please try the same control out of the RadListView and attach its event in the PageLoad server event and verify if it fires correctly.
    Also sharing your page markup and full code behind will help us further investigate the issue and do our best to provide proper solution.

    Regards,
    Maria Ilieva
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top