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

Bind SelectedItem to null

7 Answers 29 Views
ListPicker
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Peter
Top achievements
Rank 1
Peter asked on 10 Aug 2013, 01:39 AM
Am I missing something or can I not have a null value for the SelectedItem. Binding the ItemsSource automatically selects the first item.

This is killing me right now. Any ideas?

7 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 12 Aug 2013, 10:55 AM
Hi Peter,

Thank you for contacting us. While developing the ListPicker control we followed the Microsoft Design Guidelines and designed the control to have at least one selected item. I agree that there are scenarios in which an empty selection might be necessary. I've added an item in our backlog and we will do our best to improve the control in the next versions of the suite.
In the meantime, you can try setting the ItemsSource property to null. This will automatically set the SelectedItem to null as well.

Regards,
Kiril Stanoev
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
catqbat
Top achievements
Rank 1
answered on 10 Jul 2014, 07:42 PM
Hi,
Are there any news concerning this issue?

I'm developing an app where one of the use case involves editing a business object. Many of it's properties are optional but come from predefined lists. When property is null the ListPicker automatically selects the first item and changes my view model :( This is a major flaw. I'm forced to use some ugly hacks, like inserting fake item at the first index saying "No selection". This looks bad. 
The ListPicker exposes dependency property called "NoSelectionContent", so in what cases will this content be visible? Am I missing somehing here?
0
Ves
Telerik team
answered on 16 Jul 2014, 03:54 PM
Hi,

Currently NoSelectionContent will work only for Multiple and Extended selection mode. Our developers are currently working on the problem. Please, open a formal support ticket, so that we can provide you with a custom build, when the issue is fixed.

Best regards,
Ves
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Rob
Top achievements
Rank 2
answered on 17 Nov 2015, 02:23 PM
What is the status of this? Is there currently a way to have no selection in the ListPicker, in conjunction with NoSelectionContent?
0
Ves
Telerik team
answered on 24 Nov 2015, 12:37 PM
Hi Rob,

The fix has been included since Q3 2014, as described in our Release History. Note, that due to the nature of the control, it is only available in popup mode.

Best regards,
Ves
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rob
Top achievements
Rank 2
answered on 24 Nov 2015, 09:04 PM

When I attempt to set the "SelectedValue" property to null, I get an exception "Value does not fall within the expected range."

 

                    <telerikInput:DataField TargetProperty="TimeLimit" Header="Time Limit" >
                        <telerikInput:DataField.EditorStyles>
                            <Style TargetType="telerikInput:RadListPicker">
                                <Setter Property="PopupHeader" Value="Limit"/>
                                <Setter Property="DisplayMemberPath" Value="Description" />
                                <Setter Property="SelectedValuePath" Value="Id" />
                                <Setter Property="NoSelectionContent" Value="-select-"/>
                                <Setter Property="InlineModeThreshold" Value="0" />
                                <Setter Property="SelectedValue" Value="" />
                            </Style>
                        </telerikInput:DataField.EditorStyles>
                    </telerikInput:DataField> 

 

0
Ves
Telerik team
answered on 27 Nov 2015, 02:26 PM
Hi Rob,

In RadDataForm the SelectedValue will be databound to the value of the corresponding property in the underlying object, so setting SelectedValue like this will be ignored. Can you please provide a full example, showing the problem, so that we can review it and get to you with the best possible suggestion.

Best regards,
Ves
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ListPicker
Asked by
Peter
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
catqbat
Top achievements
Rank 1
Ves
Telerik team
Rob
Top achievements
Rank 2
Share this question
or