Hi,
I am trying to migrate a coded UI test to validate the contents of a RadGridView table which has replaced a WPF GridView control. Previously the test retrieved the contents of the table something like;
With RadGridView I can access the column headers and find out the number of rows, however there are no rows held against the table in the Rows property. If I try to add a validation against a single cell in the coded UI test builder they appear to be under a separate hierarchy (UIPART_GridViewVirtualCustom).
I can't create individual validations against each cell using the coded UI test builder as the volume of cells to validate makes that unwieldy so I need to be able to validate them programatically which we were able to do with the standard WPF GridView control through the Rows property.
Can anyone provide any suggestions as how I can programatically check the RadGridView contents using codedUI.
Thanks in advance
I am trying to migrate a coded UI test to validate the contents of a RadGridView table which has replaced a WPF GridView control. Previously the test retrieved the contents of the table something like;
var grid = TableGrid;
List<
string
> headers =
new
List<
string
>(from h
in
grid.ColumnHeaders.AsQueryable() select h.FriendlyName);
int
idColumn = headers.FindIndex(x => x ==
"Id"
) + 1;
int
productTypeColumn = headers.FindIndex(x => x ==
"Product Type"
) + 1;
int
titleColumn = headers.FindIndex(x => x ==
"Title"
) + 1;
Collection<Collection<
string
>> contents =
new
Collection<Collection<
string
>>();
foreach
(var row
in
grid.Rows)
{
var cells = row.GetChildren();
contents.Add(
new
Collection<
string
>() {
cells[idColumn].FriendlyName, cells[productTypeColumn].FriendlyName, cells[titleColumn].FriendlyName });
}
return
contents;
With RadGridView I can access the column headers and find out the number of rows, however there are no rows held against the table in the Rows property. If I try to add a validation against a single cell in the coded UI test builder they appear to be under a separate hierarchy (UIPART_GridViewVirtualCustom).
I can't create individual validations against each cell using the coded UI test builder as the volume of cells to validate makes that unwieldy so I need to be able to validate them programatically which we were able to do with the standard WPF GridView control through the Rows property.
Can anyone provide any suggestions as how I can programatically check the RadGridView contents using codedUI.
Thanks in advance