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

Working with 3rd Party DataGrid

5 Answers 69 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jess
Top achievements
Rank 1
Jess asked on 24 Feb 2012, 05:08 PM
I have a 3rd party DataGrid (ComponentOne) that I need to extract the values of it's cells using the Test Framework. Not sure how to go about it. I'm somewhat new to the Test Framework so bear with me. I have used the FrameworkElement before and have used AutomationProperty to get a field off a 3rd party control before but am not sure how to work it with the DataGrid as it returns a Collection that I want to iterate over and get values off the individual cells. They're text cells so they're not holding anything fancy. 

Thanks!!

5 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 24 Feb 2012, 11:00 PM
Hello Jess,

See our code sample article on Verifying Sort Order in a Silverlight DataGrid. It demonstrates how to iterate through the DataGrid extracting the text you need. You can ignore the final portion on sorting if it isn't relevant.

Regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Jess
Top achievements
Rank 1
answered on 16 Mar 2012, 07:48 PM
I'm not working with the Silverlight DataGrid.... I know I should be aware of how to work with 3rd party or internally developed controls but I need a better understanding of how to do that... ultimately that is the solution I'm looking for - how to fully manipulate and access various properties w/in 3rd party or custom controls. yes, I know, wrapper classes...

One of the specifics I ran into was I attempted to get the Columns property of the 3rd party DataGrid by using an Automated Property. The code isn't available to me at the moment but I wanted to get a count of the Column objects to make sure that my datagrid had data in it... that was a basic starting point. I tried getting the Automated Property("Columns", typeOf(DataGridCellColumns))); etc... but was told I could only cast that property to a string... not sure why. I can seemingly grab Automated Properties if they are of type int, or bool or something but if they are a derived object type like a DataGridCellColumn collection it complains that the cast fails and that it can only be cast to String... so I guess that's one of my questions. I can provide a more explicit code example on Monday.

thanks. 
0
Anthony
Telerik team
answered on 16 Mar 2012, 11:07 PM
Hello Jess,

How is it not working? Do you receive an error or unexpected results? Please provide a copy of the code you're using against a public site. I'll need more information to continue troubleshooting this.

Kind regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Jess
Top achievements
Rank 1
answered on 16 Mar 2012, 11:20 PM
I'm sorry Anthony I meant to include more information but I was pressed for time. I'm sorry for the terse post, it has been a frustrating day. I'm terribly squeezed for time and I'm trying to get a lot done by deadline, etc. Anyway I'll follow up with details of what specifically is not working for me on Monday when I get back to the office. It's the usual issues of having to use Framework Element for everything or having to create a wrapper for it myself - it's just my lack of proper understanding as to how to work within the structure of the Test Framework, nothing more. 

EDIT: I'll post my specific questions regarding what I'm trying to do when I get back into the office Monday morning. Apologies for the lack of clarity on my part. Some days you bite the bar, other days, well, the bar, it bites you... 

thanks
0
Anthony
Telerik team
answered on 21 Mar 2012, 09:17 PM
Hello Jess, 

I'll stand by for more information. 

Greetings,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Jess
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Jess
Top achievements
Rank 1
Share this question
or