private void ToggleItemRowsExpansion(IList itemList, bool expand)
        {
            if (itemList.Count == 0)
            {
                return;
            }

            expandedRowsUpdate = true;

            foreach (object item in itemList)
            {
                int itemIndex = ((IList)TargetControl.ItemsSource).IndexOf(item);
                if (itemIndex != -1)
                {
                    int rowHandle = TargetControl.GetRowHandleByListIndex(itemIndex);
                    TargetControl.SetMasterRowExpanded(rowHandle, expand);
                }
            }

            expandedRowsUpdate = false;
        }