private GroupDropAreaItem CreateGroupDropAreaItem(GridColumn column) { if (column.HeaderText == null) { column.HeaderText = column.MappingName; } var groupItem = new GroupDropAreaItem { GroupDropAreaItemTapped = OnGroupDropAreaItemTapped, GroupDropAreaItemRemoved = OnGroupDropAreaItemRemoved, GridColumn = column, GroupDropArea = this, Margin = new Thickness(5, 0, 5, 0), MinWidth = 120 }; var binding = new Binding() { Path = new PropertyPath("HeaderText"), Source = groupItem.GridColumn }; groupItem.SetBinding(GroupDropAreaItem.GroupNameProperty, binding); return(groupItem); }
internal void MoveGroupDropAreaItem(GridColumn column, ListSortDirection direction, int moveToIndex) { GroupDropAreaItem item = this.Panel.Children.ToList <GroupDropAreaItem>().FirstOrDefault(x => (x as GroupDropAreaItem).GridColumn == column) as GroupDropAreaItem; if (item != null) { var oldIndex = this.Panel.Children.IndexOf(item); this.Panel.Children.Remove(item); this.Panel.Children.Insert(moveToIndex, item); this.dataGrid.GroupColumnDescriptions.Move(oldIndex, moveToIndex); } }