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!!
Thanks!!
5 Answers, 1 is accepted
0
Hello Jess,
Anthony
the Telerik team
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.
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
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.
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
Hello Jess,
Anthony
the Telerik team
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.
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
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
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
Hello Jess,
Anthony
the Telerik team
I'll stand by for more information.
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Test Studio Trainings