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

Databoundlistbox - Can't select some items

7 Answers 108 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dele
Top achievements
Rank 2
Dele asked on 17 Mar 2011, 05:52 PM
I recently switched some of my Listboxes to use the new Telerik DataBoundListBox.  However, I am coming across a problem.  I can't seem to click on some of the items in my list.  And it does not throw an error either.  Please this is urgent.  Thanks.

Please see below sample code:

<telerikPrimitives:RadDataBoundListBox CacheMode="BitmapCache" x:Name="lbRecentAlerts" Grid.Row="1"  
                                       ItemsSource="{Binding RecentAlerts}" 
                                       SelectedItem="{Binding SelectedAlert, Mode=TwoWay}"
                                       ItemTemplate="{StaticResource AmberAlertListTemplate}">
    <telerikPrimitives:RadTransitionControl.Transition>
        <telerikPrimitives:RadTileTransition />
    </telerikPrimitives:RadTransitionControl.Transition>
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="SelectionChanged">
            <mvvmLightCommand:EventToCommand Command="{Binding GoToAlertCommand, Mode=OneWay}"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>                        
</telerikPrimitives:RadDataBoundListBox>

7 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 17 Mar 2011, 06:43 PM
Hello Dele,

We are not aware of such problem. To reproduce it we will need your help:
  1. Can you replace the telerik listbox with the standard listbox and check if the problem is gone. Just to make sure that the problem is really coming from the Telerik listbox.
  2. You can subscribe to the ItemTap event and see if the event is raised
  3. You can subscribe to the MouseLeftButtonDown event of the DataBoundListBox to see if the control gets any input from the framework.
  4. Check if there is something that is above the databound listbox and "eats" the tap events.

If none of these help - can you provide us with the whole solution where the problem is reproducible and we can investigate the problem on our own?

Best wishes,

Valentin.Stoychev
the Telerik team

 

Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Dele
Top achievements
Rank 2
answered on 17 Mar 2011, 06:46 PM
Thanks for the quick reply.  I'll try all the steps listed below.  However, I am able to click on some of the items, but not all of them in the listbox

What is the best way to handle calling commands to the View model with the Databound list box?  Is what i have in my code snippet good?
0
Valentin.Stoychev
Telerik team
answered on 17 Mar 2011, 06:59 PM
Hello Dele,

Your solution is OK - there is no good comanding mechanism in WP7, and MVVMLight is one of the best solutions for this out there.

BTW: Can you also try using the ItemTap event in your event trigger instead of the SelectionChanged, to see if this will fix your problem.

Kind regards,
Valentin.Stoychev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Dele
Top achievements
Rank 2
answered on 17 Mar 2011, 07:58 PM
Ok.  ItemTap event seems to solve my problem.  Thanks for your help.  i'll probably do tiny blog post about it for anyone else who may be using MVVM Light and the DataBoundListBox.

the code now looks like this.

<telerikPrimitives:RadDataBoundListBox CacheMode="BitmapCache" x:Name="lbRecentAlerts" 
                                                           ItemsSource="{Binding RecentAlerts}"
                                                           SelectedItem="{Binding SelectedAlert, Mode=TwoWay}"
                                                           ItemTemplate="{StaticResource AmberAlertListTemplate}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="ItemTap">
                                <mvvmLightCommand:EventToCommand Command="{Binding GoToAlertCommand, Mode=OneWay}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>                       
                    </telerikPrimitives:RadDataBoundListBox>
0
Valentin.Stoychev
Telerik team
answered on 18 Mar 2011, 10:31 AM
Hi Dele,

This is not a normal behavior. Can you send us the complete project so we can investigate. Also are you sure you are not clicking on already selected item? If you click on already selected item the selection change event will not be raise - thus your command will not execute.

Greetings,
Valentin.Stoychev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Dele
Top achievements
Rank 2
answered on 18 Mar 2011, 03:09 PM
Hi.

Yes, it's definitely not because the item is already selected.  As soon as the listbox loads, some of the items are already unselectable.

I went ahead and created the ticket for it.  And you'll find my project attached.

Thanks again.
0
Deyan
Telerik team
answered on 19 Mar 2011, 04:51 PM
Hi Dele,

For further information on this case please refer to the ticket you have opened.

Thanks for your time.

Best wishes,
Deyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
DataBoundListBox
Asked by
Dele
Top achievements
Rank 2
Answers by
Valentin.Stoychev
Telerik team
Dele
Top achievements
Rank 2
Deyan
Telerik team
Share this question
or