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

SelectionChanged Event Question

1 Answer 61 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
christine
Top achievements
Rank 1
christine asked on 21 Apr 2012, 05:39 AM
I am using the listbox control with a custom datatemplete..  I have noticed that the first time you select an item in the list box the selectionchanged even does not fire.  It will only fire the second time you select an item from the list, unless I want to set the selectedIndex property which I do not want to do.   

So if I dont want to have a pre selected item by default.  How do I determine the first item in the list that's selected.

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 26 Apr 2012, 08:04 AM
Hi,

We are not aware of such problem with the RadListBox control. We tried to reproduce the issue with the following sample code:

<telerik:RadListBox Width="116" SelectionChanged="RadListBox_SelectionChanged"
                    ItemsSource="{Binding YourItemsSource}">
    <telerik:RadListBox.ItemTemplate>
        <DataTemplate>
            <Border Background="Red">
                <TextBlock Text="{Binding PropertyName}" />
            </Border>
        </DataTemplate>
    </telerik:RadListBox.ItemTemplate>
</telerik:RadListBox>

but the SelectionChanged event fires everytime.

Can you give us more details about your scenario? I am glad to assist you further.


Greetings,
George
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ListBox
Asked by
christine
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or