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

CheckedItems Binding

10 Answers 142 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.
Robert
Top achievements
Rank 1
Robert asked on 26 Jan 2012, 05:58 PM
Hi,
since the CheckedItems collection is no DependencyProperty of the DataBoundListBox, I can not use something like
<RadDataBoundListBox ItemsSource="{Binding List}" CheckedItems="{Binding FilteredList, Mode=TwoWay}" ...
in XAML code. Is there an easy way to achieve this behaviour?

Thank you in advance
Robert

10 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 27 Jan 2012, 09:37 AM
Hi Robert,

Currently we do not support bound mode for the CheckedItems collection in RadDataBoundListBox/RadJumpList. Since we have had a couple of requests to implement this feature, we will consider it for our next major release but currently our plans for Q1 2012 are already tight in schedule and we will not be able to include this feature in the upcoming package.

Greetings,
Deyan
the Telerik team

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

0
Ilija
Top achievements
Rank 1
answered on 28 Jan 2012, 07:27 AM
Hi Robert,

a simple workaround for this problem is, to implement the ItemCheckedStateChange Event in your xaml code behind file and to fill a ObservableCollection<T> and set object for the type parameter. Then when you check or uncheck your add/remove the currently checked item to this collection. You then simply bind to this collection:

private void lstBrowser_ItemCheckedStateChanged(object sender, Telerik.Windows.Controls.ItemCheckedStateChangedEventArgs e)
      {
          if (e.IsChecked)
          {
              App.ViewModelForApp.CheckedItems.Add(e.Item);
          }
          else
          {
              App.ViewModelForApp.CheckedItems.Remove(e.Item);
          }
      }

This is against the MVVM rules, but it is a workaround that can be used, until the Telerik implementation is working. Afterwards you can get your bound data like this (maybe there is a shorter way to get the values):

foreach (var item in this.CheckedItems)
            {
                itemsFileInformation.Enqueue(
                    ((Telerik.Windows.Data.IDataSourceItem)item).Value as SkyDriveFileInformation);
            }




0
Andrew
Top achievements
Rank 1
answered on 18 Jun 2013, 03:26 PM
has there been any updates to the controls since this thread ended? If not, I'll give this workaround a shot. thanks all
0
Deyan
Telerik team
answered on 19 Jun 2013, 06:57 AM
Hi Andrew,

You can use the workaround mentioned in this thread.

Let us know should you have additional questions.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Matheus
Top achievements
Rank 2
answered on 04 Nov 2013, 06:10 PM
Did you guys managed to add the Dependency Property to the RadDataBoundListBox or should I use the workaround? Thanks a lot. It would be great to simply add the binding to keep my MVVM clean.
0
Deyan
Telerik team
answered on 06 Nov 2013, 11:25 AM
Hello Matheus,

This feature is still not implemented. We will escalate its priority in our TODO list though and will try to implement it for our next major release.

Regards,
Deyan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Derik
Top achievements
Rank 1
answered on 06 Dec 2013, 02:07 PM
Sucks that things like this would not be designed w/ MVVM in mind from the onset.  Really is a disappointment.  Oh well I guess I will use the work around....
0
esskar
Top achievements
Rank 1
answered on 11 Feb 2014, 11:57 PM
Hello,

the workaround is fine but how do i uncheck the items from code?

Regards,
Sascha
0
Deyan
Telerik team
answered on 14 Feb 2014, 09:29 AM
Hello Sascha,

To uncheck or check items in code you simply need to remove or add them from/to the CheckedItems collection. Or there is something specific to your scenario that prevents you from  doing that?

Regards,
Deyan
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
0
esskar
Top achievements
Rank 1
answered on 20 Feb 2014, 10:12 AM
thanks. works!
Tags
DataBoundListBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Ilija
Top achievements
Rank 1
Andrew
Top achievements
Rank 1
Matheus
Top achievements
Rank 2
Derik
Top achievements
Rank 1
esskar
Top achievements
Rank 1
Share this question
or