public object GetItemPropertyValue (ListItemProvider item,
int propertyId)
{
if (propertyId == AutomationElementIdentifiers.BoundingRectangleProperty.Id) {
int index = item.Index;
// We need to union last column and first column
SD.Rectangle rect0 = datagrid.GetCellBounds (index, 0);
SD.Rectangle rectN = datagrid.GetCellBounds (index, header.ChildrenCount);
return Helper.GetControlScreenBounds (SD.Rectangle.Union (rect0, rectN), datagrid);
} else if (propertyId == AutomationElementIdentifiers.IsOffscreenProperty.Id) {
Rect bounds
= (Rect) GetPropertyValue (AutomationElementIdentifiers.BoundingRectangleProperty.Id);
return Helper.IsOffScreen (bounds, datagrid, true);
} else if (propertyId == AutomationElementIdentifiers.ClickablePointProperty.Id)
return Helper.GetClickablePoint (this);
else if (propertyId == AutomationElementIdentifiers.IsKeyboardFocusableProperty.Id)
return true;
else if (propertyId == AutomationElementIdentifiers.HasKeyboardFocusProperty.Id) {
SWF.DataGridCell currentCell = datagrid.CurrentCell;
return currentCell.ColumnNumber == 0 && currentCell.RowNumber == item.Index
&& datagrid.Focused;
} else
return null;
}