Element.ChildCount returns wrong number
Posted: Tue May 20, 2008 8:20 am
I want to find out the number of items on a list using the following code:
the returned value is wrong and always [expected value] + 1
Code: Select all
..
int i = 0;
control = form.FindControlId(31);
control.Focus();
controlElement = control.Element;
// Find List
Element listElement = controlElement.FindChild(Role.List);
if (listElement != null)
{
i = listElement.ChildCount;
}
return i;
..