OnSelectionIndexedChanged event not firing

4 posts, 0 answers
  1. Vishnu Vardhan Reddy
    Vishnu Vardhan Reddy avatar
    20 posts
    Member since:
    Oct 2011

    Posted 26 Sep 2013 Link to this post

    Hi,

    I am using combo box which allows me to select multiple items. And i put OnSelectionIndexedChanged event to load particular details based on selected value.But event is not firing when am selecting all values from RadComboBox. For example i have two values like "CA,AZ".If i select "CA" event is firing and loading particular to CA.If i select two values CA,AZ event is not firing.

    Your help will be great appreciated.

    Thanking u,
    Vishnu
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Sep 2013 Link to this post

    Hi Vishnu Vardhan Reddy,

    When you use the RadComboBox Checkboxes feature, there is no "SelectedItem" in the control. Instead of SelectedItem, there are CheckedItems – a collection populated with the checked items.

    So when the user checks/unchecks a checkbox - the ItemChecked event fires. Therefore it is highly recommended to handle this event instead of OnSelectedIndexChanged when you are using RadComboBox with Checkboxes set to true

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vishnu Vardhan Reddy
    Vishnu Vardhan Reddy avatar
    20 posts
    Member since:
    Oct 2011

    Posted 30 Sep 2013 Link to this post

    Hi Shinu

    Thx for the reply.I tried with "OnItemChecked" event also.But issue not resolved.When ever i am selecting all Items ( I mean if i click on All checkbox),event is not firing.Any other trick?

    Thanks,
    Vishnu Vardhan Reddy N
  5. Vishnu Vardhan Reddy
    Vishnu Vardhan Reddy avatar
    20 posts
    Member since:
    Oct 2011

    Posted 03 Oct 2013 Link to this post

    Hi 

    Thx for the support..Finally i could resolve this issue with "OnClientBlur" Client side event..Please find below the code.

        <telerik:RadComboBox ID="radState" runat="server" EmptyMessage="All" AutoPostBack="true"
                    OnClientBlur="IsCheckAllSelected" OnSelectedIndexChanged="radState_changed" CheckBoxes="true"
                    EnableCheckAllItemsCheckBox="true" Localization-CheckAllString="All" CheckedItemsTexts="DisplayAllInInput">
                    <Localization CheckAllString="All" AllItemsCheckedString="All" />
                </telerik:RadComboBox>


    Client Side JavaScript Code Snippet.

    <script type="text/javascript">
     
        function IsCheckAllSelected(sender, eventArgs) {
     
            var itemCount = sender.get_items().get_count();
     
            var selectedItemCount = sender.get_checkedItems().length;
     
            if (selectedItemCount == itemCount) {
     
                __doPostBack('RadComboBox1''Check All');
            }
            else {
                return 0
            }
        }
     
    </script>
    
    Thanks
    Vishnu Vardhan Reddy Naatla


Back to Top