Highlighted
Absent Member.
Absent Member.
417 views

Drag and Drop from one msflexgrid to another msflexgrid

In UFT, I want to drag a row from one MSFlexGrid to a specific row in another MSFlexGrid. I know how to determine the row number for each of the grids but I don't know how to to the drag and drop. If I use the .GetROPropery("abs_x") and .GetROProperty("abs_y") I think I am getting back the coordinates of the grids and not the rows.

 

I believe after I find the coordinates I can use the .FireEvents for MouseDown, MouseMove and MouseUp. I did find that using Mercury.DeviceReplay I might also be able to do .DragAndDrop x,y,xx,yy,0.

 

I would appreciate any assistance anyone can give me.

 

Thanks.

0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

Re: Drag and Drop from one msflexgrid to another msflexgrid

Assumptions:
iRowWidth = 3 (say.)
iPickingRowNumber = 5 (say.)
iDropingRowNumber = 4 (say.)

 

Code:
iXTable1 = Browser().Page().Frame().FlexGrid().GetROProperty(“abs_x”)
iYTable1 = Browser().Page().Frame().FlexGrid().GetROProperty(“abs_y”)

iXTable2 = Browser().Page().Frame().FlexGrid().GetROProperty(“abs_x”)
iYTable2 = Browser().Page().Frame().FlexGrid().GetROProperty(“abs_y”)

Set objDevice = CreateObject("Mercury.DeviceReplay")

objDevice.DragAndDrop iXTable1, ((iYTable1 * iRowWidth)-( iRowWidth/2)), iXTable2, , ((iYTable2 * iRowWidth)-( iRowWidth/2)), 0

 

Hope this serves your purpose.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Drag and Drop from one msflexgrid to another msflexgrid

Thanks for your response. Sorry it's taken so long as I've been on vacation.

 

I am fairly new to UFT and am trying to do as you suggest but I am having an issue. The object that I am working with is as follows:

 

Window("Hyperspace").Window("Last Refresh Time").ActiveX("EIPDEDManager81.IPDEDManager").ActiveX("EACComnCtl81.ACLeftRightPanel").ActiveX("EACComnCtl81.ACUpDownPanel").ActiveX("EIPShrdCtrls81.IPFlexGrid").Object

 

I cannot seem to find anything that will give me the RowWidth. You say one of your assumptions is that it is 3. The only properties that I seem to be able to retrieve are the ColWidth, CellWidth, GridLineWidth or RowHeight. Maybe there is another way to get this besides using .Object - I just am not sure how to do it.

 

Also your code suggests using the following:

objDevice.DragAndDrop iXTable1, ((iYTable1 * iRowWidth)-( iRowWidth/2)), iXTable2, , ((iYTable2 * iRowWidth)-( iRowWidth/2)), 0

 

but I don't see anywhere that you take into account the row number of the grid you want to move and the row number of the grid where the row should be moved to. I don't understand how that line of code actually takes either of these rows into consideration.

 

If you have time to give me more help I would appreciate it.

 

Thanks.

 

Bette

 

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.