CheckedItems Binding

11 posts, 0 answers
  1. Robert
    Robert avatar
    1 posts
    Member since:
    Jan 2012

    Posted 26 Jan 2012 Link to this post

    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
  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 27 Jan 2012 Link to this post

    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 >>

  3. DevCraft banner
  4. Ilija
    Ilija avatar
    8 posts
    Member since:
    Jan 2012

    Posted 28 Jan 2012 Link to this post

    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);
                }




  5. Andrew
    Andrew avatar
    1 posts
    Member since:
    Feb 2012

    Posted 18 Jun 2013 Link to this post

    has there been any updates to the controls since this thread ended? If not, I'll give this workaround a shot. thanks all
  6. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 19 Jun 2013 Link to this post

    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.
  7. Matheus
    Matheus avatar
    6 posts
    Member since:
    Mar 2012

    Posted 04 Nov 2013 Link to this post

    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.
  8. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 06 Nov 2013 Link to this post

    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 >>
  9. Derik
    Derik avatar
    4 posts
    Member since:
    Oct 2010

    Posted 06 Dec 2013 Link to this post

    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....
  10. esskar
    esskar avatar
    5 posts
    Member since:
    Mar 2013

    Posted 11 Feb 2014 Link to this post

    Hello,

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

    Regards,
    Sascha
  11. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 14 Feb 2014 Link to this post

    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.
  12. esskar
    esskar avatar
    5 posts
    Member since:
    Mar 2013

    Posted 20 Feb 2014 Link to this post

    thanks. works!
Back to Top
DevCraft banner