Also, I am unable to use this IsReadOnly attribute in a Validate statement. When I use the common "ReadOnly" attribute in a validate statement for a TEXT field, it works fine. But for "IsReadOnly", I get an error.
Below is a sample of how I was able to use "IsReadOnly". It works if I use it this way, I'm just not sure if this is the best way to get to the same result.
public void CheckEditableFields()
{
Ranorex.Table myTable = repo.MyForm.TestFolder.MyGrid;
for (int i = 1; i < myTable.Rows.Count; i++)
{
Ranorex.Row myRow = repo.MyForm.TestFolder.MyGrid.Rows[i];
foreach (Ranorex.Cell myCell in myRow.Cells)
{
int mmIndex = myCell.Element.ChildIndex;
// ----------- Check if cells are ReadOnly -----------
if (repo.MyForm.TestFolder.MyGrid.Rows[i].Cells[mmIndex].Enabled == true)
{
if (repo.MyForm.TestFolder.MyGrid.Rows[i].Cells[mmIndex].Element.Attributes.IsReadOnly == false)
{
Report.Info("Success: cell is Editable");
}
else
{
Report.Failure("Failure: cell is ReadOnly.");
}
}
else
{
Report.Failure("Failure: cell is Disabled.");
}
}
}
}Thanks