This is a migrated thread and some comments may be shown as answers.

Provide Name for RadSplitContainer

2 Answers 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rajendar
Top achievements
Rank 1
Rajendar asked on 19 Sep 2014, 09:12 AM
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 Answers, 1 is accepted

Sort by
0
Rajendar
Top achievements
Rank 1
answered on 23 Sep 2014, 08:30 AM
Hi,

Can anyone please reply my query?

Regards,
Rajendar
0
Accepted
Georgi
Telerik team
answered on 23 Sep 2014, 11:49 AM
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.
 
Tags
General Discussions
Asked by
Rajendar
Top achievements
Rank 1
Answers by
Rajendar
Top achievements
Rank 1
Georgi
Telerik team
Share this question
or