Provide Name for RadSplitContainer

3 posts, 1 answers
  1. Rajendar
    Rajendar avatar
    69 posts
    Member since:
    Jun 2013

    Posted 19 Sep 2014 Link to this post

    Hi,

    My application has RadSplitContainers in it.  They are created dynamically.  They do not have unique properties.  So, I am not able to test my application using Coded UI Test.

    Can you suggest how to provide unique Names for these RadSplitContainers?

    Regards,
    Rajendar
  2. Rajendar
    Rajendar avatar
    69 posts
    Member since:
    Jun 2013

    Posted 23 Sep 2014 in reply to Rajendar Link to this post

    Hi,

    Can anyone please reply my query?

    Regards,
    Rajendar
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Georgi
    Admin
    Georgi avatar
    347 posts

    Posted 23 Sep 2014 Link to this post

    Hi Rajendar,

    You can try using custom  "DefaultGeneratedItemsFactory" where you can ovveride the CreateSplitContainer() method and there to set name or automation id to the currently created SplitContainer:

    public class CustomGeneratedItemsFactory : DefaultGeneratedItemsFactory
        {
            int counter = 0;
     
            public override Telerik.Windows.Controls.RadSplitContainer CreateSplitContainer()
            {
                var currentContainer = base.CreateSplitContainer();
                currentContainer.Name = "myName " + counter.ToString();
                counter++;
                return currentContainer;
            }
        }

    Also you can see how the DefaultGeneratedItemsFactory can be used in our WinFormsInsideDocking github SDK example.

    Nevertheless if this does not work for you it would be great if you can provide us with more information on your scenario.

    Regards,
    Georgi
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top