Hello
thank you for providing us your project.
Well, the following code snippet worked well for us accessing the grid in your VS-Project.
Creating serializable return Type
Code: Select all
[Serializable]
private class SCellData
{
public string aValue;
}
Code to get access to the DX-Grid with invoke remotely.
Code: Select all
Ranorex.Control MyControl = "/form[@controlname='Form1']/element[@controlname='gridControl']";
SCellData[] outputData = (SCellData[]) MyControl.InvokeRemotely (delegate (System.Windows.Forms.Control control, object input)
{
DevExpress.XtraGrid.GridControl MyGrid = (DevExpress.XtraGrid.GridControl) control;
List<SCellData> remoteOutputData = new List<SCellData>();
// Iterate through your Rows/Cells
SCellData MyCellData = new SCellData();
MyCellData.aValue = "TestData"; //MyGrid. -> Get your cell Display Text here in a list
remoteOutputData.Add (MyCellData);
// End of Iteration
return remoteOutputData.ToArray();
});
// Handle your outputdata
foreach (SCellData MyData in outputData){
Ranorex.Report.Info("Values: " + MyData.aValue);
}
Of course you have to replace the pseudo-code for getting the values with real code for accessing the cells.
You are also able to extent serializable return type (SCellData) with other attributes like ColumnIdx or RowIdx.
Kind regards,
Roland (E)
Ranorex Support Team