Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
Having limited experience with the control in question, any advice I'd give would depend a lot on what's going on with the control
For this particular grid, there's a content table child object. That table has a "RowCount" property that will return the number of rows. It also has a "ColumnCount" property for the number of columns. With that information, you can set up a pair of nested "for" loops that would loop through the rows and columns using the Cell property of the content table and verify the contents based upon some data file or data array of expected values.
The following is PseudoCode only and has not been tested in a real world situation so YMMV.
For this particular grid, there's a content table child object. That table has a "RowCount" property that will return the number of rows. It also has a "ColumnCount" property for the number of columns. With that information, you can set up a pair of nested "for" loops that would loop through the rows and columns using the Cell property of the content table and verify the contents based upon some data file or data array of expected values.
The following is PseudoCode only and has not been tested in a real world situation so YMMV.
function AssertContents(TwoDArrayOfValues)
{
var RowIndex;
var ColumnIndex;
var GridRowCount = Aliases.MyPage.MyRadGrid.MyContentTable.RowCount;
var GridColumnCount = Aliases.MyPage.MyRadGrid.MyContentTable.ColumnCount;
for (RowIndex=1;RowIndex<=VarToInt(GridRowCount);RowIndex++)
{
for (ColumnIndex=1;ColumnIndex<=VarToInt(GridColumnCount);ColumnIndex++)
{
if (Aliases.MyPage.MyRadGrid.MyContentTable.Cell(RowIndex, ColumnIndex).innerText != TwoDArrayOfValues[RowIndex, ColumnIndex])
{
Log.Warning("The values don't match")
}
}
}
}