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

Dynamically navigating RadTreeList control

1 Answer 67 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 20 Aug 2011, 01:15 AM
Hello,

I am evaluating the Test Studio plugin for Visual Studio for testing of a Web app that has a mix of javascript/html pages and Silverlight components.  The silverlight modules consist of a mixture of rad controls and standard sl controls.  I'm required to perform validation on a screen that implements the RadTreeList control.  Specifically it's a screen that will change dynamically regarding the available columns and rows based on prior operations in the application.  Because of this I will not know the grid configuration prior to navigating to the screen.

What I need to be able to do is traverse the control to be able to extract cell contents for validations.  In the short time I've experimented with Test Studio Express, it seems that it's preferred method is to track cell/column contents via x,y coordinates.  This solution is not viable for my implementation due to the dynamic nature of the control in our implementation.  Ideally I'd like to be able to navigate via the table column headers, then extract a cell value from the selected row at the targeted column index.  I've done this with standard HTML tables and it works well.

Is this type of operation achievable with the TreeView control?  What other options might I have?

Thanks,

-John

1 Answer, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 25 Aug 2011, 01:34 PM
Hi John,
    currently no wrappers exist for the RadTreeList control. It's possible to treat the TreeList as a GridView in order to navigate it. However, some of the functionality assoicated with GridView will not be functional. For instance if you get a Row which is a part of a TreeList attempting to access its cells from the Cells property won't work. Here's a piece of code that navigate the TreeList view found here:
http://demos.telerik.com/silverlight/#TreeListView/TreeListViewDragAndDrop
int row = 0;
 
foreach (FrameworkElement ggg in  Pages.TelerikTreeListViewFor.SilverlightApp.Find.AllByType("TreeListViewRow"))
            {
 
 
                GridViewRow gg1 = ggg.As<GridViewRow>();
                Log.WriteLine("Row " + row.ToString() + "-->" + gg1.Name);
 
                int cell = 0;
 
                foreach (GridViewCell c in gg1.Cells) {                  
                    Log.WriteLine("Cell "+cell.ToString()+":"+ c.Text);
 
 
                    cell++;
                }
 
               row++;
            }

Let me know if you require additional assistance with getting this to work.

Regards,
Stoich
the Telerik team
Vote for Telerik Test Studio at the Annual Automation Honors Voting!
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Share this question
or