Ask a Question

VisibleOnScreen is TRUE when row in grid control is not visible (need scrolling to view row)

SOLVED
leeedwin005
New Contributor

VisibleOnScreen is TRUE when row in grid control is not visible (need scrolling to view row)

I have a grid control with 100 rows. The grid control is placed in a small window where only 10 rows are visible with need to scroll up/down to see the desired row.

 

Both 'Visible' & 'VisibleOnScreen' are TRUE even when the desired row is last in grid while viewing the top 10 rows. I am required to do a right-click to open a context menu on desired row.

 

How should I proceed to check if row is truly visible else scroll till visible?

 

 

4 REPLIES 4
Mr_Bro
Frequent Contributor

Hi @leeedwin005 ,

 

can you please tell what are all the properties you are using to find the required object.

and also can you please share the image of "Object browser" where you have selected the the required  (last)row which is visible on screen.

 

Regards,

Sathish

 

UnitRowIndex = FindGridRowIndexByValue(GridObject, "Unit", UnitID)
Set UnitRowObject =GetObjectRowByIndex(GridObject, UnitRowIndex)

I can get the row index from the grid. With this, I could use GridObject.ClickRowIndicator to scroll to desired row with help from stated. (ref: https://community.smartbear.com/t5/TestComplete-Desktop-Testing/How-to-click-the-control-which-is-no...).

 

However, the row indicator is HIDDEN in my grid thus ClickRowIndicator call will give me the error: 'There was an attempt to perform an action at point (0, 0) which is transparent or out of the window bounds.'.

 

Is there any alternative to ClickRowIndicator?

BTW, I am using DevExpress WPF GridControl.

Hi,

 

> I am using DevExpress WPF GridControl.

I would recommend to check in the Object Browser if native .MakeRowVisible() method is accessible (it should be) and use it (like recommended, for example, here: https://www.devexpress.com/Support/Center/Question/Details/T110580/how-to-make-grid-scroll-to-a-row-...)

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

'GridObject.ClickRowIndicator(UnitRowIndex - 1) 'Replaced by the following
GridObject.View.ScrollIntoView(UnitRowIndex - 1)

Thanks for the tip. Using the native code works (finally a green tick).

 

cancel
Showing results for 
Search instead for 
Did you mean: