Embedded Controls Behave Improperly

4 posts, 1 answers
  1. Thanos
    Thanos avatar
    5 posts
    Member since:
    Aug 2016

    Posted 25 Aug Link to this post

    Hello,

    I have a Wizard that has 3 pages. Each page has a ListBox with items for the user to select.

    My problem is that when the user makes the selections on the first page's Listbox then clicks "Next" to go to page 2, the first page's ListBox's SelectedItems collection becomes empty (instead of being populated with the items the user selected on the first page). However, when I go back to page 1, the ListBox's SelectedItems collection now contains what the user selected.

    Does the Wizard do something behind the scenes to the contents of the pages? (Perhaps to conserve memory, etc.) If so, is there a way to disable this?

    Thanks,
    -Thanos

  2. Answer
    Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 26 Aug Link to this post

    Hi Thanos,

    By default, RadWizard reuses a single ContentPresenter for holding the currently selected page. Each time the selection is changed, the content of the last active page is unloaded in order to load the content of the newly selected page, thus the content of the pages is not persisted. In order to save the content of each page, you need to set Wizard's IsContentPreserved property to "True".

    Regards,
    Yoan
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Thanos
    Thanos avatar
    5 posts
    Member since:
    Aug 2016

    Posted 15 Sep Link to this post

    Hey Yoan,

    That worked great, thanks!

    Just out of curiosity, why is preserving the content not the default? Seems a little unintuitive for the control to do this optimization without the user telling it to.

    Take care,
    -Thanos

  5. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 20 Sep Link to this post

    Hi Thanos,

    RadWizard was released without preserving its content and this was by design. Later, after clients demand, we had introduced the IsContentPreserved property.

    Regards,
    Yoan
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top