public GroupTypeOrder GetGroupType(Grid grid) { Border b = (Border)grid.GetCellChild(0, 0); GroupTypeOrder gto = (GroupTypeOrder)b.DataContext; return gto; }