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

SelectedIndexChanged does not fire

1 Answer 154 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Caesar
Top achievements
Rank 1
Caesar asked on 03 Sep 2009, 07:44 AM
Hi,

I'm using a RadListBox to select an item in a list. There is a scroll in the list box since I have several items in the list. When I'm clicking on an item in the top and the whole item is not visible the SelectedIndexChanged event does not fire. The "clicked" item does not get selected either,  it just scrolls the item down the list and makes it "Active" (the css class rlbActive is set to the item I clicked).

To reproduce it use the following code. When the ListBox is loaded, scroll down so the half of the top item in the list is visible. Click that item. The item will not be selected, just "active"...

Thanks in advance

 

 

 

 

<telerik:RadScriptManager ID="rsm" runat="server" /> 
    <div> 
        <telerik:RadListBox ID="rlb" runat="server" Height="100px">  
            <Items> 
                <telerik:RadListBoxItem Text="09:30" /> 
                <telerik:RadListBoxItem Text="10:00" /> 
                <telerik:RadListBoxItem Text="10:30" /> 
                <telerik:RadListBoxItem Text="11:00" /> 
                <telerik:RadListBoxItem Text="11:30" Selected="true" /> 
                <telerik:RadListBoxItem Text="12:00" /> 
                <telerik:RadListBoxItem Text="12:30" /> 
                <telerik:RadListBoxItem Text="13:00" /> 
                <telerik:RadListBoxItem Text="13:30" /> 
            </Items> 
        </telerik:RadListBox> 
    </div> 

 

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 08 Sep 2009, 10:57 AM
Hello Caesar,

Thank you for reporting the bug.

Please handle the SelectedIndexChanged event and put the code below on your page to work around the bug:

function onSelectedIndexChanged(sender, eventArgs) { 
    sender._activateItem(eventArgs.get_item()); 
 
Sys.Application.add_init(function() { 
    Telerik.Web.UI.RadListBox.prototype._onGroupMouseDown = function() { }; 
}); 

I logged the bug in our bug-tracking system and updated your Telerik points for the report.

All the best,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ListBox
Asked by
Caesar
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or