How to pass data from a page to a user ctrl

4 posts, 0 answers
  1. Marcelo
    Marcelo avatar
    40 posts
    Member since:
    Jul 2011

    Posted 13 Oct 2011 Link to this post

    I have a main page (<Page>) that uses the Transition Ctrl to load user controls (from a menu). I need to be able to pass user data (object containing user name, roles, etc.) from main page to every user ctrl loaded.

    Any suggestions would be appreciated.

    M.
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 17 Oct 2011 Link to this post

    Hello Marcelo,

    You could provide your data object to your UserControls using their DataContext property just before setting them to the Content property of the RadTransitionControl.

    Hope this helps.

    Best wishes,
    Miroslav Nedyalkov
    the Telerik team

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Amine
    Amine avatar
    4 posts
    Member since:
    Oct 2012

    Posted 15 Feb 2014 in reply to Miroslav Nedyalkov Link to this post

    can you give avery simple exemple project please?
    thx
  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 19 Feb 2014 Link to this post

    Hi Amine,

    I've created a sample project for you. Please note that this is just one approach to achieve the desired behavior. Another option is to set different DataContext to your UserControls when you set them as content of RadTransitionControl. Everything depends on your application and requirements.

    Hope this helps.

    Regards,
    Rosen Vladimirov
    Telerik
Back to Top