ExpanderControl inside RadDataBoundListBox doesn't correctly rebind

6 posts, 0 answers
  1. Brendan
    Brendan avatar
    3 posts
    Member since:
    Jul 2011

    Posted 13 Apr 2013 Link to this post

    Hi,

    Following the email sample that you've produced to show the Expander control, it uses an ExpderControl inside a RadDataBoundListBox which looks great out of the box. 

    When the bound list changes, the header in the ExpanderControl does not refresh/rebind. I've put together a sample application here; which shows both changing the List entirely and also just clearing the list with new items. On the second page of the pivot control, the same items are bound to the build-in longlistselector which updates without problems.

    The other behaviour I've noticed is that the Expander Control doesn't properly work in an ItemsControl or LongListSelector, as in, none of the items seem to bind properly, though this could be a separate issue.

    My use case is: A user has done a search to view an initial list of items, and can then re-search with different parameters to return a completely different set of items.

    Thanks,
    Brendan
  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 15 Apr 2013 Link to this post

    Hello Brendad,

    Thanks for writing.

    When you put a RadExpanderControl into a Data Template you need to bind its Content and ExpandableContent properties to the data context as follows:

    <DataTemplate>
        <telerikPrimitives:RadExpanderControl
            Content="{Binding}"
            ExpandableContent="{Binding}"

    This should resolve the issues that you experience.

    I hope this helps.

    Kind regards,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Brendan
    Brendan avatar
    3 posts
    Member since:
    Jul 2011

    Posted 16 Apr 2013 Link to this post

    Thanks for the reply.

    The content binds fine the first time, it just doesn't update if the ItemsSource
    items change until the ExpanderControl is expanded and collapsed.
    The viewmodel correctly implements INotifyPropertyChanged and the regular LongListSelector updates fine using the same ItemsSource. Unless there's something else, it seems like it could be a bug in the control.

    Brendan
  5. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 16 Apr 2013 Link to this post

    Hello Brendan,

    Thanks for writing back.

    I am not quite sure that I correctly understand the case.

    By implementing the bindings as shown in my previous post I am not able to reproduce any undesired behavior. This is the way the ExpanderControl is used in DataBoundListBox.

    Can you please try implementing the bindings first and if the issue persists, send me an updated project so that I can further investigate the case?

    Regards,

    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  6. Brendan
    Brendan avatar
    3 posts
    Member since:
    Jul 2011

    Posted 16 Apr 2013 Link to this post

    Essentially what I'm seeing is in this screen shot.

    I've updated the project here with your suggestion.

    And here is a list of steps:
    1. When the app initially loads [link]
    2. Swipe across to the equivalent LongListSelector on pivot page 2 [link]
    3. From the Menu select "change items" which will remove all items from the observable collection and add new ones [link]
    4. The long list selector has updated [link]
    5. The Expander control is showing the previous values... [link]
    6. Expanding and collapsing an item shows the new value link]

    Ideas?
  7. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 17 Apr 2013 Link to this post

    Hello Brendan,

    Thanks for getting back to me.

    We have introduced some fixes in RadExpanderControl in one of our Internal Builds recently.

    I am not able to reproduce this behavior with these bits so I suggest you check the LIB we have on our website and let me know if it works for you.

    All the best,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top
DevCraft banner