void DisableAllowDropByNewLineItem() { int row = 1; while (row < GroupTable.RowDefinitions.Count) { List <ItemTypeOrder> itemTypeList = GetItemsByRow(row); bool found = false; int i = 0; while (i < itemTypeList.Count && !found) { if (itemTypeList[i].DesignID != null && itemTypeList[i].DesignID.Equals("198")) { found = true; i++; // To make sure that AllowDrop is disabled for the rest of the items } else { i++; } } while (i < GroupTable.ColumnDefinitions.Count && found) { Border borderCell = (Border)GroupTable.GetCellChild(row, i); borderCell.AllowDrop = false; i++; } row++; } }
void EnableAllowDropNewLine(int startColumnPosition, int row) { int i = startColumnPosition; while (i < GroupTable.ColumnDefinitions.Count) { Border borderCell = (Border)GroupTable.GetCellChild(row, i); borderCell.AllowDrop = true; i++; } }