by Aracknid » Tue Jun 28, 2011 5:26 pm
It seems I was partially mistaken. There are 2 cases and they behave as follows:
If the entire cell is not in view, EnsureVisible DOES work to show the entire cell.
If the cell is partially visible, then EnsureVisble does nothing. So for example, If it is a cell that is 100 pixels wide by default, and the column has been scrolled to only show a few pixels, then the cells within the column are still partially visible and EnsureVisible does not scroll the entire column into view. Under the covers I can spy on the cell and Ranorex believes it is actually only a few pixels wide. It doesn't realize that it should be 100 pixels. So ScreenLocation values are "what you see". I have no idea if this is a bug or not (perhaps this is how Silverlight's grid reports info to you).
Focus seems to do nothing.
The reason this is an issue for me, is because the cells contain other controls when clicked, like text, combos, date pickers, etc... When I click a partially visible cell, I cannot always see the controls within the cells. The logic (or lack thereof) in my code assumes that if the cell is visible then all items within it are also visible. But even though the cell itself is only as big as "what you see", the controls within it are their actual size, and underneath the frozen columns. So, if I try to click directly on the control within the cell, it seems as though it is trying to click on the center of the control (which happens to be under the frozen column), and clicks on the wrong column. Like for the cells, if the text boxes within the cells are partially visible, EnsureVisible does not move them into view.
I have e-mailed support a snapshot and a screen shot with info in it to try to explain what I'm talking about. In my screen shot I have a green box around the area that I refer to as "what you see" and a purple box around the true actual size of the cell. There is also the Red ranorex highlight of the text control within the cell. This is mostly not actually visible since it is covered by the frozen cell.
I believe I have a work around, which I don't care much for, but it will do if there is no way to make a partially visible cell entirely visible. My work around is to use the tab and arrow keys to navigate the spreadsheet, which forces the cells into full view. This is not great for a large grid with lots of rows...
Thanks,
Aracknid