Wrong Selected Window when Loading from Xml

5 posts, 0 answers
  1. Marien Monnier
    Marien Monnier avatar
    2 posts
    Member since:
    Jul 2009

    Posted 17 Jul 2009 Link to this post

    Hi the Telerik Team,

    There is a error with the RadDock when loading layout from XML file.
    When you load the layout from an XML file, the selected index of a DocumentContainer or a ToolTabStrip is incorrect. The last one is always selected, even if the SelectedIndex is the first.
    You can easily reproduce this bug with the demo application on Dock / Serialization:
    - Add a tool window to the same area as Tool Window 2
    - Select the first window of the ToolTabStrip (Tool Window 4)
    - Save the layout
    - If you open the layout file in an editor, you can see that the ToolTabStrip's SelectedIndex is 0 (correct).
    - Remove all windows
    - Load the layout file
    - The Tool Window 2 is selected instead of the Tool Window 4.

    Thank you,

  2. Marien Monnier
    Marien Monnier avatar
    2 posts
    Member since:
    Jul 2009

    Posted 17 Jul 2009 Link to this post

    In the mean time, if someone encounter this problem, and while it's not fixed, I made this solution:

    // Load the configuration file

    // Load the file in an xmldocument
    XmlDocument xmlDoc = new XmlDocument();

    // We select all the ToolTabStrip and DocumentTabStrip nodes
    XmlNodeList toolNodes = xmlDoc.SelectNodes("//Telerik.WinControls.UI.Docking.ToolTabStrip | //Telerik.WinControls.UI.Docking.DocumentTabStrip");
    foreach (XmlNode toolNode in toolNodes)

      // The name of the TabStripPanel and the selected index
      string panelName = toolNode.Attributes["Name"].Value;
      int selectedIndex = int.Parse(toolNode.Attributes["SelectedIndex"].Value);

      // Retrieve this field. TODO : replace MainForm by your form name
      FieldInfo fieldInfo = typeof(MainForm).GetField(panelName, BindingFlags.Instance | BindingFlags.NonPublic);
      // Set the correct value for the selected index
      ((Telerik.WinControls.UI.TabStripPanel)fieldInfo.GetValue(this)).SelectedIndex = selectedIndex;

  3. DevCraft R3 2016 release webinar banner
  4. Jordan
    Jordan avatar
    547 posts

    Posted 22 Jul 2009 Link to this post

    Hello Marien Monnier,

    Thank you for writing.
    We have already fixed this issue.
    The fix will be available in the Q2 2009 SP1 release (due at the end of this month).

    Best wishes,
    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.
  5. Abhishek
    Abhishek avatar
    3 posts
    Member since:
    Apr 2011

    Posted 26 Apr 2011 Link to this post

    Hi Team,

    We're facing the same issue in the "Q1 - 2011" version of RadControls for Winforms.

    The same can be easily reproduced in the sample demo provided as well.

    Please provide us a solution to this as it is critical to our application.

    Abhishek Dudeja
  6. Stefan
    Stefan avatar
    2891 posts

    Posted 29 Apr 2011 Link to this post

    Hi Abhishek,

    Thank you for writing.

    I am writing to confirm that this issue appears in the latest version of RadControls for WinForms. I have added this into our PITS system, where you can add your vote for it or subscribe for its status updates

    Meanwhile, you can overcome this behavior, by using the code that Marien Monnier have provided earlier.

    Your Telerik points have been updates for this report.

    Should you have any other questions, do not hesitate to contact us.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft R3 2016 release webinar banner