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

OnSelectionIndexedChanged event not firing

3 Answers 36 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Vishnu Vardhan Reddy
Top achievements
Rank 2
Vishnu Vardhan Reddy asked on 26 Sep 2013, 10:08 AM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 26 Sep 2013, 12:09 PM
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.
0
Vishnu Vardhan Reddy
Top achievements
Rank 2
answered on 30 Sep 2013, 12:17 PM
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
0
Vishnu Vardhan Reddy
Top achievements
Rank 2
answered on 03 Oct 2013, 05:01 AM
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


Tags
ComboBox
Asked by
Vishnu Vardhan Reddy
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 1
Vishnu Vardhan Reddy
Top achievements
Rank 2
Share this question
or