Layout changes

7 posts, 0 answers
  1. Aaron Smith
    Aaron Smith avatar
    10 posts
    Member since:
    Jun 2009

    Posted 24 Jun 2009 Link to this post

    Hi,

    I want to save the layout whenever the user changes the sizes, positions, etc with the dashboard.  I understand how to use the xml string to save, my question is what is the best way to trap the events related to these actions?  What events are exposed to do this?

    Also, can I distinguish between when someone closes a window inside of a dock vs. just changing the layout?  I need to be able to remove that window from the user account when they no longer want it.  

    Thanks for your time.
  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 26 Jun 2009 Link to this post

    Hello Aaron Smith,

    Thank you for writing to us. You can use the RadPane's LayoutUpdated and Loaded events to determine when the size, position and DockState of the RadPane are changing. Do not hesitate to contact us if you have some additional questions.

    Regards,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Aaron Smith
    Aaron Smith avatar
    10 posts
    Member since:
    Jun 2009

    Posted 26 Jun 2009 Link to this post

    Great what about the second part of my question?
  4. Aaron Smith
    Aaron Smith avatar
    10 posts
    Member since:
    Jun 2009

    Posted 26 Jun 2009 Link to this post

    Ok I found the window close event (not sure how I missed it before, doh) but now my question is, how can I get the serialization tag from this event?
  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 01 Jul 2009 Link to this post

    Hello Aaron Smith,

    As a solution you can loop throughout the RadDocking's panes and get the serialization tag value from this panes, which is an attached property: Please check the code below:

    private void Docking_WindowClose(object sender, Telerik.Windows.RadRoutedEventArgs e) 
            { 
                foreach (var panes in this.Docking.Panes) 
                { 
                    object value = panes.GetValue(RadDocking.SerializationTagProperty); 
                } 
            } 


    Regards,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Aaron Smith
    Aaron Smith avatar
    10 posts
    Member since:
    Jun 2009

    Posted 13 Jul 2009 Link to this post

    That cyles through all the panes.  How do I just get the one being closed?
  7. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 14 Jul 2009 Link to this post

    Hi Aaron Smith,

    You can use  RadDocking's Close even instead of window's Close event. The handler of this event provides you with an StateChangeEventArgs argument that contains RadPanes which are changed - in this case closed. Check the example below.
              radDocking.Close += new System.EventHandler<Telerik.Windows.Controls.Docking.StateChangeEventArgs>(radDocking_Close); 
     
        void radDocking_Close(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e) 
            { 
                foreach (var pane in e.Panes) 
                { 
                    object value = pane.GetValue(RadDocking.SerializationTagProperty); 
                } 
            } 


    Best wishes,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top