Third Party Data Grid Silverlight

6 posts, 0 answers
  1. donovan
    donovan avatar
    15 posts
    Member since:
    Jun 2011

    Posted 09 Apr 2014 Link to this post

    Hello

    I'm trying to select a cell on a third party DataGrid (ComponentOne FlexGrid) and I'm having some issues.

    I cant seem to cast it as a Generic DataGrid and when I use CastAs<DataGrid> the rows and columns are coming back as 0.

    I can see the children and they are there but I need to know how many columns there are to work out what item to select when they specify row and column.

    I guess I could possibly add a property called columnCount to the control and then get it with GetProperty(). But I don't want to do that.

    Is there a clean way I can get this info out ? In general if I have a collection can I use GetProperty or something similar to get its properties or its elements.

    Thanks
  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 14 Apr 2014 Link to this post

    Hello Donovan,

    First we need to know what type of application are you trying to test, HTML, Silverlight, WPF? I see ComponentOne has different Grid versions for different types of applications.

    I doubt that using CastAs<DataGrid> would work. What that really does is to create a wrapper object that is specifically designed to work with the standard Silverlight DataGrid UI element. If there's any slight variation, it won't be able to adjust.

    If you can point us to the right ComponentOne demo, then we may be able to investigate a solution for you.

    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  3. donovan
    donovan avatar
    15 posts
    Member since:
    Jun 2011

    Posted 15 Apr 2014 Link to this post

    Its for silverlight

    Here you go http://demos.componentone.com/Silverlight/ControlExplorer/#FlexGrid/See%20it%20in%20action


  4. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 17 Apr 2014 Link to this post

    Hello Donovan,

    Thank you for pointing me to the online demo. In studying their demo I discover they have made automating it very difficult. Each cell is simply another Border element. There is no separation of rows. The cells for row 2 are simply concatenated to the cells of row 1. Effectively you have just one long list of cells for every cell contained in the entire grid - see attached screen shot..

    With this in mind, does the target cell you want to click have a unique value? We could find the grid by name or ID, then find the cell with the correct text then click on it.

    Another approach would be to get the pixel height of the first row, do some calculation in order to click on row N with a static horizontal pixel value to click on.

    The last option would be to add a RowCount and ColCount property, both returning an int, to a subclass of the grid. These properties would simply return Rows.Count and Cells.Count respectively.

    if I have a collection can I use GetProperty or something similar to get its properties or its elements.

    No I am sorry that is not supported. GetProperty can only return something our framework already knows how to handle. It needs to be able to serialize the object, send it "over the wall" (between the Silverlight application domain and the Test Studio application domain) such that Test Studio can deserialize the object. We only support the simple types (int, bool, string) and a few common complex types (Brush).

    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  5. donovan
    donovan avatar
    15 posts
    Member since:
    Jun 2011

    Posted 21 Apr 2014 in reply to Cody Link to this post

    There is another issue when you edit a cell it inserts a new control into that list so the position of an element is not always where you expect it to be. Very annoying !

    I think I might serialize some info (AutomationId for each cell and its position) into a string property called Schema and then use that wrapped in a custom FrameworkElement. 

    Thanks for your help.
  6. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 24 Apr 2014 Link to this post

    Hi Donovan,

    Yes you have run into another well known idiosyncrasy of the Siverlight Visual Tree, the visual order does not equal the visual tree order. I hope you can come up with some workable solution. It doesn't look easy.

    Regards,
    Cody
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top